Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/StructuresCalculationContext.cs =================================================================== diff -u -r9fe25ebfb1f70f00d66564ef2a89f6e22c27dce4 -r3a9daab3a208eb7bb29a44ad6d5646fe7cf85e11 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/StructuresCalculationContext.cs (.../StructuresCalculationContext.cs) (revision 9fe25ebfb1f70f00d66564ef2a89f6e22c27dce4) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/StructuresCalculationContext.cs (.../StructuresCalculationContext.cs) (revision 3a9daab3a208eb7bb29a44ad6d5646fe7cf85e11) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Controls.PresentationObjects; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; @@ -44,10 +45,10 @@ /// The failure mechanism which the context belongs to. /// The assessment section which the calculation belongs to. /// Thrown when any input argument is null. - public StructuresCalculationContext(StructuresCalculation calculation, - CalculationGroup parent, - TFailureMechanism failureMechanism, - IAssessmentSection assessmentSection) + protected StructuresCalculationContext(StructuresCalculation calculation, + CalculationGroup parent, + TFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) : base(calculation, failureMechanism, assessmentSection) { if (parent == null) @@ -59,5 +60,22 @@ } public CalculationGroup Parent { get; } + + public override bool Equals(WrappedObjectContextBase> other) + { + return base.Equals(other) + && other is StructuresCalculationContext + && ReferenceEquals(Parent, ((StructuresCalculationContext) other).Parent); + } + + public override bool Equals(object obj) + { + return Equals(obj as StructuresCalculationContext); + } + + public override int GetHashCode() + { + return base.GetHashCode() ^ Parent.GetHashCode(); + } } } \ No newline at end of file