Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FaultTreeIllustrationPointProperties.cs =================================================================== diff -u -r71120734f3b9d5c38815221bb43be01eb2aa56b7 -r390c486bb4cd693ae2f2eaf82a30efcb51480048 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FaultTreeIllustrationPointProperties.cs (.../FaultTreeIllustrationPointProperties.cs) (revision 71120734f3b9d5c38815221bb43be01eb2aa56b7) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FaultTreeIllustrationPointProperties.cs (.../FaultTreeIllustrationPointProperties.cs) (revision 390c486bb4cd693ae2f2eaf82a30efcb51480048) @@ -36,6 +36,8 @@ [TypeConverter(typeof(ExpandableObjectConverter))] public class FaultTreeIllustrationPointProperties : IllustrationPointProperties { + private readonly FaultTreeIllustrationPoint faultTreeIllustrationPoint; + /// /// Creates a new instance of . /// @@ -44,14 +46,17 @@ /// String containing the name of the closing situation. If empty /// the property will not be visible. /// Thrown when any input parameter is null. - /// Thrown when the illustration point node is not of type . + /// Thrown when is not of type . public FaultTreeIllustrationPointProperties( IllustrationPointNode illustrationPointNode, string windDirection, string closingSituation) : base(illustrationPointNode, windDirection, closingSituation) { - if (!(data.Data is FaultTreeIllustrationPoint)) + var illustrationPoint = data.Data as FaultTreeIllustrationPoint; + if (illustrationPoint == null) { - throw new ArgumentException("illustrationPointNode type has to be FaultTreeIllustrationPoint"); + throw new ArgumentException($"{nameof(illustrationPointNode)} type has to be {nameof(FaultTreeIllustrationPoint)}"); } + + faultTreeIllustrationPoint = illustrationPoint; } [PropertyOrder(4)] @@ -64,7 +69,7 @@ { get { - return ((FaultTreeIllustrationPoint) data.Data).Stochasts.ToArray(); + return faultTreeIllustrationPoint.Stochasts.ToArray(); } } @@ -78,7 +83,7 @@ { get { - return ((FaultTreeIllustrationPoint) data.Data).Stochasts.ToArray(); + return faultTreeIllustrationPoint.Stochasts.ToArray(); } } }