Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresCalculationsProperties.cs =================================================================== diff -u -r68a866506bb4d072bfebe3def0f53ad95b3e15aa -r3a3fe11bf17281e359f41fc779a59258cd6a8dff --- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresCalculationsProperties.cs (.../StabilityPointStructuresCalculationsProperties.cs) (revision 68a866506bb4d072bfebe3def0f53ad95b3e15aa) +++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresCalculationsProperties.cs (.../StabilityPointStructuresCalculationsProperties.cs) (revision 3a3fe11bf17281e359f41fc779a59258cd6a8dff) @@ -24,7 +24,6 @@ using Core.Common.Base.Data; using Core.Common.Util.Attributes; using Core.Gui.Attributes; -using Core.Gui.PropertyBag; using Riskeer.Common.Forms.PropertyClasses; using Riskeer.StabilityPointStructures.Data; using Riskeer.StabilityPointStructures.Forms.Properties; @@ -35,7 +34,7 @@ /// /// Calculation related ViewModel of for properties panel. /// - public class StabilityPointStructuresCalculationsProperties : ObjectProperties + public class StabilityPointStructuresCalculationsProperties : StabilityPointStructuresFailureMechanismProperties { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; @@ -54,87 +53,17 @@ /// The instance to show the properties of. /// Thrown when /// is null. - public StabilityPointStructuresCalculationsProperties(StabilityPointStructuresFailureMechanism data) + public StabilityPointStructuresCalculationsProperties(StabilityPointStructuresFailureMechanism data) : base(data, new ConstructionProperties { - if (data == null) - { - throw new ArgumentNullException(nameof(data)); - } + NamePropertyIndex = namePropertyIndex, + CodePropertyIndex = codePropertyIndex, + GroupPropertyIndex = groupPropertyIndex, + ContributionPropertyIndex = contributionPropertyIndex, + NPropertyIndex = nPropertyIndex + }) {} - Data = data; - } - - #region Length effect parameters - - [PropertyOrder(nPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_LengthEffect))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_N_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_N_Description))] - public RoundedDouble N - { - get - { - return data.GeneralInput.N; - } - set - { - data.GeneralInput.N = value; - data.NotifyObservers(); - } - } - - #endregion - #region General - [PropertyOrder(namePropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Name_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Name_Description))] - public string Name - { - get - { - return data.Name; - } - } - - [PropertyOrder(codePropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Code_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Code_Description))] - public string Code - { - get - { - return data.Code; - } - } - - [PropertyOrder(groupPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Group_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Group_Description))] - public int Group - { - get - { - return data.Group; - } - } - - [PropertyOrder(contributionPropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Contribution_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_Contribution_Description))] - public double Contribution - { - get - { - return data.Contribution; - } - } - [PropertyOrder(gravitationalAccelerationPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.GravitationalAcceleration_DisplayName))] Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailureMechanismProperties.cs =================================================================== diff -u -r68c1056ae1d2b721cd39bcb60f3fdf3213645293 -r3a3fe11bf17281e359f41fc779a59258cd6a8dff --- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailureMechanismProperties.cs (.../StabilityPointStructuresFailureMechanismProperties.cs) (revision 68c1056ae1d2b721cd39bcb60f3fdf3213645293) +++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailureMechanismProperties.cs (.../StabilityPointStructuresFailureMechanismProperties.cs) (revision 3a3fe11bf17281e359f41fc779a59258cd6a8dff) @@ -82,14 +82,19 @@ [DynamicPropertyOrder] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_LengthEffect))] - [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_N_Rounded_DisplayName))] - [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_N_Rounded_Description))] + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_N_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailureMechanism_N_Description))] public RoundedDouble N { get { - return new RoundedDouble(2, data.GeneralInput.N); + return data.GeneralInput.N; } + set + { + data.GeneralInput.N = value; + data.NotifyObservers(); + } } #endregion