Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsScenariosViewIntegrationTest.cs
===================================================================
diff -u -r9b642748438acbabb3f67559e289ec49525aaf4b -r65e9bbe5a99736fdc6e6dae703186816f07fa910
--- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsScenariosViewIntegrationTest.cs (.../GrassCoverErosionInwardsScenariosViewIntegrationTest.cs) (revision 9b642748438acbabb3f67559e289ec49525aaf4b)
+++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsScenariosViewIntegrationTest.cs (.../GrassCoverErosionInwardsScenariosViewIntegrationTest.cs) (revision 65e9bbe5a99736fdc6e6dae703186816f07fa910)
@@ -55,7 +55,7 @@
Path.Combine("DikeProfiles", "Voorlanden 6-3.shp"));
[Test]
- public void ScenariosView_ImportDikeSection_ChangesCorrectlyObservedAndSynced()
+ public void ScenariosView_ImportFailureMechanismSections_ChangesCorrectlyObservedAndSynced()
{
// Setup
using (var form = new Form())
Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenarioRow.cs
===================================================================
diff -u -r6b101883cf554150bd1454ba54784cf325a6e07c -r65e9bbe5a99736fdc6e6dae703186816f07fa910
--- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenarioRow.cs (.../HeightStructuresScenarioRow.cs) (revision 6b101883cf554150bd1454ba54784cf325a6e07c)
+++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenarioRow.cs (.../HeightStructuresScenarioRow.cs) (revision 65e9bbe5a99736fdc6e6dae703186816f07fa910)
@@ -32,7 +32,7 @@
/// Container of a ,
/// which takes care of the representation of properties in a grid.
///
- internal class HeightStructuresScenarioRow : ScenarioRow>
+ public class HeightStructuresScenarioRow : ScenarioRow>
{
private readonly HeightStructuresFailureMechanism failureMechanism;
private readonly IAssessmentSection assessmentSection;
Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.Designer.cs
===================================================================
diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r65e9bbe5a99736fdc6e6dae703186816f07fa910
--- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.Designer.cs (.../HeightStructuresScenariosView.Designer.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea)
+++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.Designer.cs (.../HeightStructuresScenariosView.Designer.cs) (revision 65e9bbe5a99736fdc6e6dae703186816f07fa910)
@@ -19,8 +19,6 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using Riskeer.Common.Forms;
-
namespace Riskeer.HeightStructures.Forms.Views
{
partial class HeightStructuresScenariosView
@@ -38,33 +36,8 @@
///
private void InitializeComponent()
{
- this.scenarioSelectionControl = new Riskeer.Common.Forms.ScenarioSelectionControl();
- this.SuspendLayout();
- //
- // scenarioSelectionControl
- //
- this.scenarioSelectionControl.AutoScroll = true;
- this.scenarioSelectionControl.Dock = System.Windows.Forms.DockStyle.Fill;
- this.scenarioSelectionControl.Location = new System.Drawing.Point(0, 0);
- this.scenarioSelectionControl.Name = "scenarioSelectionControl";
- this.scenarioSelectionControl.Size = new System.Drawing.Size(160, 160);
- this.scenarioSelectionControl.TabIndex = 0;
- //
- // HeightStructuresScenariosView
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.AutoScroll = true;
- this.Controls.Add(this.scenarioSelectionControl);
- this.MinimumSize = new System.Drawing.Size(160, 160);
- this.Name = "HeightStructuresScenariosView";
- this.Size = new System.Drawing.Size(160, 160);
- this.ResumeLayout(false);
-
}
#endregion
-
- private ScenarioSelectionControl scenarioSelectionControl;
}
}
Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs
===================================================================
diff -u -r6b101883cf554150bd1454ba54784cf325a6e07c -r65e9bbe5a99736fdc6e6dae703186816f07fa910
--- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs (.../HeightStructuresScenariosView.cs) (revision 6b101883cf554150bd1454ba54784cf325a6e07c)
+++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs (.../HeightStructuresScenariosView.cs) (revision 65e9bbe5a99736fdc6e6dae703186816f07fa910)
@@ -22,12 +22,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Windows.Forms;
-using Core.Common.Base;
-using Core.Common.Controls.Views;
+using Core.Common.Base.Geometry;
+using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.Calculation;
+using Riskeer.Common.Data.FailureMechanism;
using Riskeer.Common.Data.Structures;
-using Riskeer.Common.Util;
+using Riskeer.Common.Forms.Views;
using Riskeer.HeightStructures.Data;
namespace Riskeer.HeightStructures.Forms.Views
@@ -37,105 +37,43 @@
/// Shows a grid view where for each failure mechanism section, a calculation within the section
/// can be selected.
///
- public partial class HeightStructuresScenariosView : UserControl, IView
+ public partial class HeightStructuresScenariosView : ScenariosView, HeightStructuresInput, HeightStructuresScenarioRow, HeightStructuresFailureMechanism>
{
- private readonly RecursiveObserver calculationInputObserver;
- private readonly RecursiveObserver calculationGroupObserver;
- private readonly Observer failureMechanismObserver;
- private HeightStructuresFailureMechanism failureMechanism;
- private CalculationGroup data;
+ private readonly IAssessmentSection assessmentSection;
///
/// Creates a new instance of .
///
- public HeightStructuresScenariosView()
+ /// The data to show in this view.
+ /// The
+ /// the belongs to.
+ /// The assessment section the scenarios belong to.
+ /// Thrown when any parameter
+ /// is null.
+ public HeightStructuresScenariosView(CalculationGroup calculationGroup, HeightStructuresFailureMechanism failureMechanism, IAssessmentSection assessmentSection)
+ : base(calculationGroup, failureMechanism)
{
- InitializeComponent();
-
- failureMechanismObserver = new Observer(UpdateDataGridViewDataSource);
-
- // The concat is needed to observe the input of calculations in child groups.
- calculationInputObserver = new RecursiveObserver(
- UpdateDataGridViewDataSource, cg => cg.Children.Concat