Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs =================================================================== diff -u -r2e7619109892f98d673e6b42e17983cee4cb0104 -r8e07481708d93b49a718152976e3729819099c25 --- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs (.../StabilityStoneCoverFailureMechanismProperties.cs) (revision 2e7619109892f98d673e6b42e17983cee4cb0104) +++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailureMechanismProperties.cs (.../StabilityStoneCoverFailureMechanismProperties.cs) (revision 8e07481708d93b49a718152976e3729819099c25) @@ -55,17 +55,14 @@ } Data = data; - + propertyIndexLookup = new Dictionary { { nameof(Name), constructionProperties.NamePropertyIndex }, { nameof(Code), constructionProperties.CodePropertyIndex - }, - { - nameof(Group), constructionProperties.GroupPropertyIndex } }; } @@ -77,7 +74,7 @@ return propertyIndex; } - + /// /// Class holding the various construction parameters for . /// @@ -95,11 +92,6 @@ /// public int CodePropertyIndex { get; set; } - /// - /// Gets or sets the property index for . - /// - public int GroupPropertyIndex { get; set; } - #endregion } @@ -129,18 +121,6 @@ } } - [DynamicPropertyOrder] - [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; - } - } - #endregion } } \ No newline at end of file Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailurePathProperties.cs =================================================================== diff -u -r2232ff8b2af8d6a7a9005b2f2e0566ebcba2b1e9 -r8e07481708d93b49a718152976e3729819099c25 --- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailurePathProperties.cs (.../StabilityStoneCoverFailurePathProperties.cs) (revision 2232ff8b2af8d6a7a9005b2f2e0566ebcba2b1e9) +++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverFailurePathProperties.cs (.../StabilityStoneCoverFailurePathProperties.cs) (revision 8e07481708d93b49a718152976e3729819099c25) @@ -48,22 +48,9 @@ public StabilityStoneCoverFailurePathProperties(StabilityStoneCoverFailureMechanism data) : base(data, new ConstructionProperties { NamePropertyIndex = namePropertyIndex, - CodePropertyIndex = codePropertyIndex, - GroupPropertyIndex = groupPropertyIndex + CodePropertyIndex = codePropertyIndex }) {} - - [DynamicVisibleValidationMethod] - public bool DynamicVisibleValidationMethod(string propertyName) - { - return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); - } - private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) - { - return nameof(Contribution).Equals(propertyName) - || nameof(N).Equals(propertyName); - } - #region Length effect parameters [DynamicVisible] @@ -86,8 +73,32 @@ #endregion + [DynamicVisibleValidationMethod] + public bool DynamicVisibleValidationMethod(string propertyName) + { + return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); + } + + private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) + { + return nameof(Contribution).Equals(propertyName) + || nameof(N).Equals(propertyName); + } + #region General + [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(inAssemblyPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_InAssembly_DisplayName))] @@ -99,7 +110,7 @@ return data.InAssembly; } } - + [DynamicVisible] [PropertyOrder(contributionPropertyIndex)] [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverHydraulicLoadsProperties.cs =================================================================== diff -u -r90eb97340563db766973cdf6ace5ce4cadfa2ccb -r8e07481708d93b49a718152976e3729819099c25 --- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverHydraulicLoadsProperties.cs (.../StabilityStoneCoverHydraulicLoadsProperties.cs) (revision 90eb97340563db766973cdf6ace5ce4cadfa2ccb) +++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverHydraulicLoadsProperties.cs (.../StabilityStoneCoverHydraulicLoadsProperties.cs) (revision 8e07481708d93b49a718152976e3729819099c25) @@ -37,22 +37,20 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int groupPropertyIndex = 3; - private const int blocksPropertyIndex = 4; - private const int columnsPropertyIndex = 5; + private const int blocksPropertyIndex = 3; + private const int columnsPropertyIndex = 4; /// /// Creates a new instance of . /// /// The instance to show the properties of. /// Thrown when is null. - public StabilityStoneCoverHydraulicLoadsProperties(StabilityStoneCoverFailureMechanism data) + public StabilityStoneCoverHydraulicLoadsProperties(StabilityStoneCoverFailureMechanism data) : base(data, new ConstructionProperties - { - NamePropertyIndex = namePropertyIndex, - CodePropertyIndex = codePropertyIndex, - GroupPropertyIndex = groupPropertyIndex - }) {} + { + NamePropertyIndex = namePropertyIndex, + CodePropertyIndex = codePropertyIndex + }) {} #region Model settings Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs =================================================================== diff -u -r29c590694571ca38e860be0e67f639d0a41523fb -r8e07481708d93b49a718152976e3729819099c25 --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs (.../StabilityStoneCoverFailureMechanismPropertiesTest.cs) (revision 29c590694571ca38e860be0e67f639d0a41523fb) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailureMechanismPropertiesTest.cs (.../StabilityStoneCoverFailureMechanismPropertiesTest.cs) (revision 8e07481708d93b49a718152976e3729819099c25) @@ -32,9 +32,8 @@ [TestFixture] public class StabilityStoneCoverFailureMechanismPropertiesTest { - private const int namePropertyIndex = 2; - private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 0; + private const int namePropertyIndex = 1; + private const int codePropertyIndex = 0; [Test] public void Constructor_DataNull_ThrowArgumentNullException() @@ -73,7 +72,6 @@ Assert.AreSame(failureMechanism, properties.Data); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); - Assert.AreEqual(failureMechanism.Group, properties.Group); } [Test] @@ -86,13 +84,12 @@ var properties = new StabilityStoneCoverFailureMechanismProperties(failureMechanism, new StabilityStoneCoverFailureMechanismProperties.ConstructionProperties { NamePropertyIndex = namePropertyIndex, - CodePropertyIndex = codePropertyIndex, - GroupPropertyIndex = groupPropertyIndex + CodePropertyIndex = codePropertyIndex }); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(3, dynamicProperties.Count); + Assert.AreEqual(2, dynamicProperties.Count); const string generalCategory = "Algemeen"; @@ -109,13 +106,6 @@ "Label", "Het label van het toetsspoor.", true); - - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); } } } \ No newline at end of file Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverHydraulicLoadsPropertiesTest.cs =================================================================== diff -u -r6151e5228a403b3476d0945c9b6797bd7874b086 -r8e07481708d93b49a718152976e3729819099c25 --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverHydraulicLoadsPropertiesTest.cs (.../StabilityStoneCoverHydraulicLoadsPropertiesTest.cs) (revision 6151e5228a403b3476d0945c9b6797bd7874b086) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverHydraulicLoadsPropertiesTest.cs (.../StabilityStoneCoverHydraulicLoadsPropertiesTest.cs) (revision 8e07481708d93b49a718152976e3729819099c25) @@ -33,9 +33,8 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int groupPropertyIndex = 2; - private const int blocksPropertyIndex = 3; - private const int columnsPropertyIndex = 4; + private const int blocksPropertyIndex = 2; + private const int columnsPropertyIndex = 3; [Test] public void Constructor_ExpectedValues() @@ -56,7 +55,6 @@ Assert.AreSame(failureMechanism, properties.Data); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); - Assert.AreEqual(failureMechanism.Group, properties.Group); GeneralStabilityStoneCoverWaveConditionsInput generalInput = failureMechanism.GeneralInput; Assert.AreSame(generalInput.GeneralBlocksWaveConditionsInput, properties.Blocks.Data); @@ -74,7 +72,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(5, dynamicProperties.Count); + Assert.AreEqual(4, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string modelSettingsCateogry = "Modelinstellingen"; @@ -93,13 +91,6 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor groupProperty = dynamicProperties[groupPropertyIndex]; - PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(groupProperty, - generalCategory, - "Groep", - "De groep waar het toetsspoor toe behoort.", - true); - PropertyDescriptor blocksProperty = dynamicProperties[blocksPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(blocksProperty, modelSettingsCateogry,