Index: Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/StandAlone/PipingStructureFailurePathProperties.cs =================================================================== diff -u -r4075241549b94454a6ad23fc355c69be49aecc17 -r75229fe1249a839986bf80c01755f18657135b71 --- Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/StandAlone/PipingStructureFailurePathProperties.cs (.../PipingStructureFailurePathProperties.cs) (revision 4075241549b94454a6ad23fc355c69be49aecc17) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/StandAlone/PipingStructureFailurePathProperties.cs (.../PipingStructureFailurePathProperties.cs) (revision 75229fe1249a839986bf80c01755f18657135b71) @@ -40,6 +40,7 @@ private const int contributionPropertyIndex = 4; private const int inAssemblyPropertyIndex = 5; private const int nPropertyIndex = 6; + private const int applyLengthEffectInSectionPropertyIndex = 7; /// /// Creates a new instance of . @@ -56,6 +57,19 @@ Data = data; } + [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) + || nameof(ApplyLengthEffectInSection).Equals(propertyName); + } + #region Length effect parameters [DynamicVisible] @@ -76,18 +90,20 @@ } } - #endregion - - [DynamicVisibleValidationMethod] - public bool DynamicVisibleValidationMethod(string propertyName) + [DynamicVisible] + [PropertyOrder(applyLengthEffectInSectionPropertyIndex)] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_LengthEffect))] + [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Apply_LengthEffect_In_Section_DisplayName))] + [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.FailurePath_Apply_LengthEffect_In_Section_Description))] + public bool ApplyLengthEffectInSection { - return data.InAssembly || !ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(propertyName); + get + { + return false; + } } - private static bool ShouldHidePropertyWhenFailureMechanismNotPartOfAssembly(string propertyName) - { - return nameof(Contribution).Equals(propertyName) || nameof(N).Equals(propertyName); - } + #endregion #region General Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/StandAlone/PipingStructureFailurePathPropertiesTest.cs =================================================================== diff -u -rfdfcebfac58179f6b1d1e19d376342f82eaaffcd -r75229fe1249a839986bf80c01755f18657135b71 --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/StandAlone/PipingStructureFailurePathPropertiesTest.cs (.../PipingStructureFailurePathPropertiesTest.cs) (revision fdfcebfac58179f6b1d1e19d376342f82eaaffcd) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/StandAlone/PipingStructureFailurePathPropertiesTest.cs (.../PipingStructureFailurePathPropertiesTest.cs) (revision 75229fe1249a839986bf80c01755f18657135b71) @@ -42,6 +42,7 @@ private const int contributionPropertyIndex = 3; private const int inAssemblyPropertyIndex = 4; private const int nPropertyIndex = 5; + private const int applySectionLengthInSectionPropertyIndex = 6; [Test] public void Constructor_DataIsNull_ThrowArgumentNullException() @@ -79,6 +80,7 @@ Assert.AreEqual(failureMechanism.N, properties.N, properties.N.GetAccuracy()); + Assert.IsFalse(properties.ApplyLengthEffectInSection); } [Test] @@ -95,7 +97,7 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(6, dynamicProperties.Count); + Assert.AreEqual(7, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; @@ -140,6 +142,13 @@ lengthEffectCategory, "N [-]", "De parameter 'N' die gebruikt wordt om het lengte-effect mee te nemen in de beoordeling."); + + PropertyDescriptor applySectionLengthInSectionProperty = dynamicProperties[applySectionLengthInSectionPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(applySectionLengthInSectionProperty, + lengthEffectCategory, + "Toepassen lengte-effect binnen vak", + "Geeft aan of het lengte-effect binnen een vak toegepast wordt.", + true); } [Test] @@ -259,6 +268,7 @@ Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.Contribution))); Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.N))); + Assert.AreEqual(inAssembly, properties.DynamicVisibleValidationMethod(nameof(properties.ApplyLengthEffectInSection))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); }