Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rbf06bd5c42db48d0551ab19a5c957f732a913b3a -r950c2bc06cda222b149f4663db732cf1c4554dbe --- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bf06bd5c42db48d0551ab19a5c957f732a913b3a) +++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 950c2bc06cda222b149f4663db732cf1c4554dbe) @@ -1,4 +1,25 @@ -//------------------------------------------------------------------------------ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationRow.cs =================================================================== diff -u -r6c041cc09388a1435dfc52f610e74fea864c143c -r950c2bc06cda222b149f4663db732cf1c4554dbe --- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationRow.cs (.../GrassCoverErosionInwardsCalculationRow.cs) (revision 6c041cc09388a1435dfc52f610e74fea864c143c) +++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationRow.cs (.../GrassCoverErosionInwardsCalculationRow.cs) (revision 950c2bc06cda222b149f4663db732cf1c4554dbe) @@ -47,28 +47,28 @@ /// /// Creates a new instance of . /// - /// The this row contains. + /// The this row contains. /// The handler responsible for handling effects of a property change. /// Thrown when any parameter is null. - public GrassCoverErosionInwardsCalculationRow(GrassCoverErosionInwardsCalculationScenario grassCoverErosionInwardsCalculationScenario, + public GrassCoverErosionInwardsCalculationRow(GrassCoverErosionInwardsCalculationScenario calculationScenario, IObservablePropertyChangeHandler handler) { - if (grassCoverErosionInwardsCalculationScenario == null) + if (calculationScenario == null) { - throw new ArgumentNullException(nameof(grassCoverErosionInwardsCalculationScenario)); + throw new ArgumentNullException(nameof(calculationScenario)); } if (handler == null) { throw new ArgumentNullException(nameof(handler)); } - GrassCoverErosionInwardsCalculationScenario = grassCoverErosionInwardsCalculationScenario; + GrassCoverErosionInwardsCalculationScenario = calculationScenario; propertyChangeHandler = handler; ColumnStateDefinitions = new Dictionary(); CreateColumnStateDefinitions(); UpdateUseBreakWaterColumnStateDefinitions(); - UpdateUseUseForeshoreColumnStateDefinitions(); + UpdateUseForeshoreColumnStateDefinitions(); } /// @@ -81,10 +81,7 @@ /// public string Name { - get - { - return GrassCoverErosionInwardsCalculationScenario.Name; - } + get => GrassCoverErosionInwardsCalculationScenario.Name; set { GrassCoverErosionInwardsCalculationScenario.Name = value; @@ -123,10 +120,7 @@ /// public DataGridViewComboBoxItemWrapper DikeProfile { - get - { - return new DataGridViewComboBoxItemWrapper(GrassCoverErosionInwardsCalculationScenario.InputParameters.DikeProfile); - } + get => new DataGridViewComboBoxItemWrapper(GrassCoverErosionInwardsCalculationScenario.InputParameters.DikeProfile); set { DikeProfile valueToSet = value?.WrappedObject; @@ -142,10 +136,7 @@ /// public bool UseBreakWater { - get - { - return GrassCoverErosionInwardsCalculationScenario.InputParameters.UseBreakWater; - } + get => GrassCoverErosionInwardsCalculationScenario.InputParameters.UseBreakWater; set { if (!GrassCoverErosionInwardsCalculationScenario.InputParameters.UseBreakWater.Equals(value)) @@ -161,10 +152,7 @@ /// public BreakWaterType BreakWaterType { - get - { - return GrassCoverErosionInwardsCalculationScenario.InputParameters.BreakWater.Type; - } + get => GrassCoverErosionInwardsCalculationScenario.InputParameters.BreakWater.Type; set { if (!GrassCoverErosionInwardsCalculationScenario.InputParameters.BreakWater.Type.Equals(value)) @@ -179,10 +167,7 @@ /// public RoundedDouble BreakWaterHeight { - get - { - return GrassCoverErosionInwardsCalculationScenario.InputParameters.BreakWater.Height; - } + get => GrassCoverErosionInwardsCalculationScenario.InputParameters.BreakWater.Height; set { if (!GrassCoverErosionInwardsCalculationScenario.InputParameters.BreakWater.Height.Equals(value)) @@ -197,16 +182,13 @@ /// public bool UseForeShoreGeometry { - get - { - return GrassCoverErosionInwardsCalculationScenario.InputParameters.UseForeshore; - } + get => GrassCoverErosionInwardsCalculationScenario.InputParameters.UseForeshore; set { if (!GrassCoverErosionInwardsCalculationScenario.InputParameters.UseForeshore.Equals(value)) { PropertyChangeHelper.ChangePropertyAndNotify(() => GrassCoverErosionInwardsCalculationScenario.InputParameters.UseForeshore = value, propertyChangeHandler); - UpdateUseUseForeshoreColumnStateDefinitions(); + UpdateUseForeshoreColumnStateDefinitions(); } } } @@ -216,10 +198,7 @@ /// public RoundedDouble DikeHeight { - get - { - return GrassCoverErosionInwardsCalculationScenario.InputParameters.DikeHeight; - } + get => GrassCoverErosionInwardsCalculationScenario.InputParameters.DikeHeight; set { if (!GrassCoverErosionInwardsCalculationScenario.InputParameters.DikeHeight.Equals(value)) @@ -234,10 +213,7 @@ /// public RoundedDouble MeanCriticalFlowRate { - get - { - return GrassCoverErosionInwardsCalculationScenario.InputParameters.CriticalFlowRate.Mean; - } + get => GrassCoverErosionInwardsCalculationScenario.InputParameters.CriticalFlowRate.Mean; set { if (!GrassCoverErosionInwardsCalculationScenario.InputParameters.CriticalFlowRate.Mean.Equals(value)) @@ -252,10 +228,7 @@ /// public RoundedDouble StandardDeviationCriticalFlowRate { - get - { - return GrassCoverErosionInwardsCalculationScenario.InputParameters.CriticalFlowRate.StandardDeviation; - } + get => GrassCoverErosionInwardsCalculationScenario.InputParameters.CriticalFlowRate.StandardDeviation; set { if (!GrassCoverErosionInwardsCalculationScenario.InputParameters.CriticalFlowRate.StandardDeviation.Equals(value)) @@ -288,7 +261,7 @@ } } - private void UpdateUseUseForeshoreColumnStateDefinitions() + private void UpdateUseForeshoreColumnStateDefinitions() { DikeProfile dikeProfileForeshoreGeometry = GrassCoverErosionInwardsCalculationScenario.InputParameters.DikeProfile; if (dikeProfileForeshoreGeometry == null || !dikeProfileForeshoreGeometry.ForeshoreGeometry.Any()) Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.Designer.cs =================================================================== diff -u -r9535d4151770fb6394fe00e56745d7b9ad0fe459 -r950c2bc06cda222b149f4663db732cf1c4554dbe --- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.Designer.cs (.../GrassCoverErosionInwardsCalculationsView.Designer.cs) (revision 9535d4151770fb6394fe00e56745d7b9ad0fe459) +++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.Designer.cs (.../GrassCoverErosionInwardsCalculationsView.Designer.cs) (revision 950c2bc06cda222b149f4663db732cf1c4554dbe) @@ -38,7 +38,7 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GrassCoverErosionInwardsCalculationsView)); this.tableLayoutPanelUserControl = new System.Windows.Forms.TableLayoutPanel(); - this.label1 = new System.Windows.Forms.Label(); + this.warningMessageLabel = new System.Windows.Forms.Label(); this.splitContainer = new System.Windows.Forms.SplitContainer(); this.tableLayoutPanelListBox = new System.Windows.Forms.TableLayoutPanel(); this.listBox = new System.Windows.Forms.ListBox(); @@ -59,15 +59,14 @@ // tableLayoutPanelUserControl // resources.ApplyResources(this.tableLayoutPanelUserControl, "tableLayoutPanelUserControl"); - this.tableLayoutPanelUserControl.Controls.Add(this.label1, 0, 2); this.tableLayoutPanelUserControl.Controls.Add(this.splitContainer, 0, 0); this.tableLayoutPanelUserControl.Controls.Add(this.buttonGenerateCalculations, 0, 1); this.tableLayoutPanelUserControl.Name = "tableLayoutPanelUserControl"; // - // label1 + // warningMessageLabel // - resources.ApplyResources(this.label1, "label1"); - this.label1.Name = "label1"; + resources.ApplyResources(this.warningMessageLabel, "warningMessageLabel"); + this.warningMessageLabel.Name = "warningMessageLabel"; // // splitContainer // @@ -104,6 +103,7 @@ // tableLayoutPanelDataGrid // resources.ApplyResources(this.tableLayoutPanelDataGrid, "tableLayoutPanelDataGrid"); + this.tableLayoutPanelDataGrid.Controls.Add(this.warningMessageLabel, 0, 2); this.tableLayoutPanelDataGrid.Controls.Add(this.labelCalculations, 0, 0); this.tableLayoutPanelDataGrid.Controls.Add(this.dataGridViewControl, 0, 1); this.tableLayoutPanelDataGrid.Name = "tableLayoutPanelDataGrid"; @@ -158,6 +158,6 @@ private System.Windows.Forms.Label labelCalculations; private Core.Common.Controls.DataGrid.DataGridViewControl dataGridViewControl; private System.Windows.Forms.Button buttonGenerateCalculations; - private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label warningMessageLabel; } } Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.cs =================================================================== diff -u -rba2bd8d63764da61fc0df342947616ee2c1c2af8 -r950c2bc06cda222b149f4663db732cf1c4554dbe --- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.cs (.../GrassCoverErosionInwardsCalculationsView.cs) (revision ba2bd8d63764da61fc0df342947616ee2c1c2af8) +++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.cs (.../GrassCoverErosionInwardsCalculationsView.cs) (revision 950c2bc06cda222b149f4663db732cf1c4554dbe) @@ -50,16 +50,16 @@ { private const int selectableHydraulicBoundaryLocationColumnIndex = 1; private const int selectableDikeProfileColumnIndex = 2; - private readonly Observer grassCoverErosionInwardsFailureMechanismObserver; + private readonly Observer failureMechanismObserver; private readonly Observer hydraulicBoundaryLocationsObserver; private readonly Observer dikeProfilesObserver; - private readonly RecursiveObserver grassCoverErosionInwardsInputObserver; - private readonly RecursiveObserver grassCoverErosionInwardsCalculationScenarioObserver; - private readonly RecursiveObserver grassCoverErosionInwardsCalculationGroupObserver; + private readonly RecursiveObserver inputObserver; + private readonly RecursiveObserver calculationScenarioObserver; + private readonly RecursiveObserver calculationGroupObserver; private CalculationGroup calculationGroup; private IAssessmentSection assessmentSection; - private GrassCoverErosionInwardsFailureMechanism grassCoverErosionInwardsFailureMechanism; + private GrassCoverErosionInwardsFailureMechanism failureMechanism; public event EventHandler SelectionChanged; @@ -72,29 +72,26 @@ InitializeDataGridView(); InitializeListBox(); - grassCoverErosionInwardsFailureMechanismObserver = new Observer(OnGrassCoverErosionInwardsFailureMechanismUpdate); + failureMechanismObserver = new Observer(OnFailureMechanismUpdate); hydraulicBoundaryLocationsObserver = new Observer(UpdateSelectableHydraulicBoundaryLocationsColumn); dikeProfilesObserver = new Observer(UpdateDikeProfilesColumn); // The concat is needed to observe the input of calculations in child groups. - grassCoverErosionInwardsInputObserver = new RecursiveObserver(UpdateDataGridViewDataSource, pcg => pcg.Children.Concat(pcg.Children.OfType().Select(pc => pc.InputParameters))); - grassCoverErosionInwardsCalculationScenarioObserver = new RecursiveObserver(() => dataGridViewControl.RefreshDataGridView(), pcg => pcg.Children); - grassCoverErosionInwardsCalculationGroupObserver = new RecursiveObserver(UpdateDataGridViewDataSource, pcg => pcg.Children); + inputObserver = new RecursiveObserver(UpdateDataGridViewDataSource, pcg => pcg.Children.Concat(pcg.Children.OfType().Select(pc => pc.InputParameters))); + calculationScenarioObserver = new RecursiveObserver(() => dataGridViewControl.RefreshDataGridView(), pcg => pcg.Children); + calculationGroupObserver = new RecursiveObserver(UpdateDataGridViewDataSource, pcg => pcg.Children); } /// /// Gets or sets the grass cover erosion inwards failure mechanism. /// - public GrassCoverErosionInwardsFailureMechanism GrassCoverErosionInwardsFailureMechanism + public GrassCoverErosionInwardsFailureMechanism FailureMechanism { - get - { - return grassCoverErosionInwardsFailureMechanism; - } + get => failureMechanism; set { - grassCoverErosionInwardsFailureMechanism = value; - grassCoverErosionInwardsFailureMechanismObserver.Observable = grassCoverErosionInwardsFailureMechanism; + failureMechanism = value; + failureMechanismObserver.Observable = failureMechanism; UpdateSelectableHydraulicBoundaryLocationsColumn(); UpdateDikeProfilesColumn(); @@ -108,10 +105,7 @@ /// public IAssessmentSection AssessmentSection { - get - { - return assessmentSection; - } + get => assessmentSection; set { assessmentSection = value; @@ -122,37 +116,28 @@ } } - public object Selection - { - get - { - return CreateSelectedItemFromCurrentRow(); - } - } + public object Selection => CreateSelectedItemFromCurrentRow(); public object Data { - get - { - return calculationGroup; - } + get => calculationGroup; set { calculationGroup = value as CalculationGroup; if (calculationGroup != null) { UpdateDataGridViewDataSource(); - grassCoverErosionInwardsInputObserver.Observable = calculationGroup; - grassCoverErosionInwardsCalculationScenarioObserver.Observable = calculationGroup; - grassCoverErosionInwardsCalculationGroupObserver.Observable = calculationGroup; + inputObserver.Observable = calculationGroup; + calculationScenarioObserver.Observable = calculationGroup; + calculationGroupObserver.Observable = calculationGroup; } else { dataGridViewControl.SetDataSource(null); - grassCoverErosionInwardsInputObserver.Observable = null; - grassCoverErosionInwardsCalculationScenarioObserver.Observable = null; - grassCoverErosionInwardsCalculationGroupObserver.Observable = null; + inputObserver.Observable = null; + calculationScenarioObserver.Observable = null; + calculationGroupObserver.Observable = null; } } } @@ -166,21 +151,16 @@ dataGridViewControl.CellFormatting += HandleCellStyling; } - private void HandleCellStyling(object sender, DataGridViewCellFormattingEventArgs e) - { - dataGridViewControl.FormatCellWithColumnStateDefinition(e.RowIndex, e.ColumnIndex); - } - protected override void Dispose(bool disposing) { if (disposing) { dataGridViewControl.CurrentRowChanged -= DataGridViewOnCurrentRowChangedHandler; - grassCoverErosionInwardsFailureMechanismObserver.Dispose(); + failureMechanismObserver.Dispose(); - grassCoverErosionInwardsInputObserver.Dispose(); - grassCoverErosionInwardsCalculationScenarioObserver.Dispose(); - grassCoverErosionInwardsCalculationGroupObserver.Dispose(); + inputObserver.Dispose(); + calculationScenarioObserver.Dispose(); + calculationGroupObserver.Dispose(); hydraulicBoundaryLocationsObserver.Dispose(); dikeProfilesObserver.Dispose(); @@ -191,6 +171,11 @@ base.Dispose(disposing); } + private void HandleCellStyling(object sender, DataGridViewCellFormattingEventArgs e) + { + dataGridViewControl.FormatCellWithColumnStateDefinition(e.RowIndex, e.ColumnIndex); + } + private void InitializeDataGridView() { dataGridViewControl.CurrentRowChanged += DataGridViewOnCurrentRowChangedHandler; @@ -255,22 +240,22 @@ private void UpdateGenerateCalculationsButtonState() { - buttonGenerateCalculations.Enabled = grassCoverErosionInwardsFailureMechanism != null; + buttonGenerateCalculations.Enabled = failureMechanism != null; } private GrassCoverErosionInwardsInputContext CreateSelectedItemFromCurrentRow() { DataGridViewRow currentRow = dataGridViewControl.CurrentRow; - var grassCoverErosionInwardsCalculationRow = (GrassCoverErosionInwardsCalculationRow) currentRow?.DataBoundItem; + var calculationRow = (GrassCoverErosionInwardsCalculationRow) currentRow?.DataBoundItem; GrassCoverErosionInwardsInputContext selection = null; - if (grassCoverErosionInwardsCalculationRow != null) + if (calculationRow != null) { selection = new GrassCoverErosionInwardsInputContext( - grassCoverErosionInwardsCalculationRow.GrassCoverErosionInwardsCalculationScenario.InputParameters, - grassCoverErosionInwardsCalculationRow.GrassCoverErosionInwardsCalculationScenario, - grassCoverErosionInwardsFailureMechanism, + calculationRow.GrassCoverErosionInwardsCalculationScenario.InputParameters, + calculationRow.GrassCoverErosionInwardsCalculationScenario, + failureMechanism, assessmentSection); } @@ -317,14 +302,14 @@ } IEnumerable lineSegments = Math2D.ConvertPointsToLineSegments(failureMechanismSection.Points); - IEnumerable grassCoverErosionInwardsCalculationScenarios = calculationGroup - .GetCalculations() - .OfType() - .Where(cs => cs.IsDikeProfileIntersectionWithReferenceLineInSection(lineSegments)); + IEnumerable calculationScenarios = calculationGroup + .GetCalculations() + .OfType() + .Where(cs => cs.IsDikeProfileIntersectionWithReferenceLineInSection(lineSegments)); PrefillComboBoxListItemsAtColumnLevel(); - List dataSource = grassCoverErosionInwardsCalculationScenarios.Select(cs => new GrassCoverErosionInwardsCalculationRow(cs, new ObservablePropertyChangeHandler(cs, cs.InputParameters))).ToList(); + List dataSource = calculationScenarios.Select(cs => new GrassCoverErosionInwardsCalculationRow(cs, new ObservablePropertyChangeHandler(cs, cs.InputParameters))).ToList(); dataGridViewControl.SetDataSource(dataSource); dataGridViewControl.ClearCurrentCell(); @@ -361,10 +346,10 @@ SetItemsOnObjectCollection(cell.Items, dataGridViewComboBoxItemWrappers); } - private IEnumerable GetSelectableHydraulicBoundaryLocationsForCalculation(GrassCoverErosionInwardsCalculationScenario grassCoverErosionInwardsCalculationScenario) + private IEnumerable GetSelectableHydraulicBoundaryLocationsForCalculation(GrassCoverErosionInwardsCalculationScenario calculationScenario) { return GetSelectableHydraulicBoundaryLocations(assessmentSection?.HydraulicBoundaryDatabase.Locations, - grassCoverErosionInwardsCalculationScenario.InputParameters.DikeProfile); + calculationScenario.InputParameters.DikeProfile); } private static IEnumerable GetSelectableHydraulicBoundaryLocations( @@ -395,7 +380,7 @@ private void FillAvailableDikeProfilesList(DataGridViewRow dataGridViewRow) { var cell = (DataGridViewComboBoxCell) dataGridViewRow.Cells[selectableDikeProfileColumnIndex]; - DataGridViewComboBoxItemWrapper[] dataGridViewComboBoxItemWrappers = GetSelectableDikeProfileDataSource(grassCoverErosionInwardsFailureMechanism.DikeProfiles).ToArray(); + DataGridViewComboBoxItemWrapper[] dataGridViewComboBoxItemWrappers = GetSelectableDikeProfileDataSource(failureMechanism.DikeProfiles).ToArray(); SetItemsOnObjectCollection(cell.Items, dataGridViewComboBoxItemWrappers); } @@ -419,7 +404,7 @@ #endregion #region Prefill combo box list items - + private void PrefillComboBoxListItemsAtColumnLevel() { var selectableHydraulicBoundaryLocationColumn = (DataGridViewComboBoxColumn) dataGridViewControl.GetColumnFromIndex(selectableHydraulicBoundaryLocationColumnIndex); @@ -438,7 +423,7 @@ using (new SuspendDataGridViewColumnResizes(selectableDikeProfileColumn)) { SetItemsOnObjectCollection(selectableDikeProfileColumn.Items, - GetSelectableDikeProfileDataSource(grassCoverErosionInwardsFailureMechanism.DikeProfiles).ToArray()); + GetSelectableDikeProfileDataSource(failureMechanism.DikeProfiles).ToArray()); } } @@ -455,7 +440,7 @@ { return null; } - + List hydraulicBoundaryLocations = assessmentSection.HydraulicBoundaryDatabase.Locations; return hydraulicBoundaryLocations.Select(hbl => new SelectableHydraulicBoundaryLocation(hbl, null)).ToList(); @@ -482,7 +467,7 @@ return; } - using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(Parent, grassCoverErosionInwardsFailureMechanism.DikeProfiles)) + using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(Parent, failureMechanism.DikeProfiles)) { dialog.ShowDialog(); GenerateCalculations(calculationGroup, dialog.SelectedItems); @@ -507,7 +492,7 @@ } } - private void OnGrassCoverErosionInwardsFailureMechanismUpdate() + private void OnFailureMechanismUpdate() { UpdateSectionsListBox(); } @@ -516,10 +501,10 @@ { listBox.Items.Clear(); - if (grassCoverErosionInwardsFailureMechanism != null && grassCoverErosionInwardsFailureMechanism.Sections.Any()) + if (failureMechanism != null && failureMechanism.Sections.Any()) { - listBox.Items.AddRange(grassCoverErosionInwardsFailureMechanism.Sections.Cast().ToArray()); - listBox.SelectedItem = grassCoverErosionInwardsFailureMechanism.Sections.First(); + listBox.Items.AddRange(failureMechanism.Sections.Cast().ToArray()); + listBox.SelectedItem = failureMechanism.Sections.First(); } } Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.resx =================================================================== diff -u -r9535d4151770fb6394fe00e56745d7b9ad0fe459 -r950c2bc06cda222b149f4663db732cf1c4554dbe --- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.resx (.../GrassCoverErosionInwardsCalculationsView.resx) (revision 9535d4151770fb6394fe00e56745d7b9ad0fe459) +++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsCalculationsView.resx (.../GrassCoverErosionInwardsCalculationsView.resx) (revision 950c2bc06cda222b149f4663db732cf1c4554dbe) @@ -121,44 +121,11 @@ 1 - - True - - - NoControl - - - - 4, 288 - - - 4, 0, 4, 0 - - - 643, 20 - - - 2 - - - Let op: als u het dijkprofiel van een berekening wijzigt kan de berekening in een ander vak komen te liggen. - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelUserControl - - - 0 - Fill + 4, 4 @@ -184,7 +151,7 @@ 4, 0, 4, 0 - 203, 214 + 203, 234 1 @@ -244,7 +211,7 @@ 2 - 211, 239 + 211, 259 0 @@ -282,6 +249,39 @@ 1 + + True + + + NoControl + + + 4, 239 + + + 4, 0, 4, 0 + + + 396, 20 + + + 2 + + + Let op: als u het dijkprofiel van een berekening wijzigt kan de berekening in een ander vak komen te liggen. + + + warningMessageLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanelDataGrid + + + 0 + True @@ -310,7 +310,7 @@ tableLayoutPanelDataGrid - 0 + 1 Top, Bottom, Left, Right @@ -322,7 +322,7 @@ 5, 5, 5, 5 - 433, 184 + 433, 204 1 @@ -337,7 +337,7 @@ tableLayoutPanelDataGrid - 1 + 2 Fill @@ -352,7 +352,7 @@ 3 - 443, 239 + 443, 259 1 @@ -370,7 +370,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelCalculations" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dataGridViewControl" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Absolute,25,Percent,100,Absolute,20" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="warningMessageLabel" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelCalculations" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dataGridViewControl" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Absolute,25,Percent,100,Absolute,20" /></TableLayoutSettings> splitContainer.Panel2 @@ -388,7 +388,7 @@ 0 - 659, 239 + 659, 259 211 @@ -409,7 +409,7 @@ tableLayoutPanelUserControl - 1 + 0 True @@ -424,7 +424,7 @@ NoControl - 4, 251 + 4, 271 4, 4, 4, 4 @@ -448,7 +448,7 @@ tableLayoutPanelUserControl - 2 + 1 Fill @@ -460,7 +460,7 @@ 4, 4, 4, 4 - 3 + 2 667, 308 @@ -481,7 +481,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="splitContainer" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonGenerateCalculations" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Percent,100,AutoSize,0,Absolute,20,Absolute,25" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="splitContainer" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonGenerateCalculations" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Percent,100,AutoSize,0,Absolute,25" /></TableLayoutSettings> True Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs =================================================================== diff -u -ra44c29c03d4d800f123a54fdd43f73a026b7df8e -r950c2bc06cda222b149f4663db732cf1c4554dbe --- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision a44c29c03d4d800f123a54fdd43f73a026b7df8e) +++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 950c2bc06cda222b149f4663db732cf1c4554dbe) @@ -259,7 +259,7 @@ AfterCreate = (view, context) => { view.AssessmentSection = context.AssessmentSection; - view.GrassCoverErosionInwardsFailureMechanism = context.FailureMechanism; + view.FailureMechanism = context.FailureMechanism; } }; } Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsCalculationsViewTest.cs =================================================================== diff -u -r158bd9ec02ccf975b4250b464ed12d591d114820 -r950c2bc06cda222b149f4663db732cf1c4554dbe --- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsCalculationsViewTest.cs (.../GrassCoverErosionInwardsCalculationsViewTest.cs) (revision 158bd9ec02ccf975b4250b464ed12d591d114820) +++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsCalculationsViewTest.cs (.../GrassCoverErosionInwardsCalculationsViewTest.cs) (revision 950c2bc06cda222b149f4663db732cf1c4554dbe) @@ -178,7 +178,7 @@ using (GrassCoverErosionInwardsCalculationsView grassCoverErosionInwardsCalculationsView = ShowGrassCoverErosionInwardsCalculationsView()) { // Call - grassCoverErosionInwardsCalculationsView.GrassCoverErosionInwardsFailureMechanism = failureMechanism; + grassCoverErosionInwardsCalculationsView.FailureMechanism = failureMechanism; // Assert var listBox = (ListBox) new ControlTester("listBox").TheObject; @@ -250,7 +250,7 @@ using (GrassCoverErosionInwardsCalculationsView grassCoverErosionInwardsCalculationsView = ShowGrassCoverErosionInwardsCalculationsView()) { - grassCoverErosionInwardsCalculationsView.GrassCoverErosionInwardsFailureMechanism = grassCoverErosionInwardsFailureMechanism; + grassCoverErosionInwardsCalculationsView.FailureMechanism = grassCoverErosionInwardsFailureMechanism; var button = (Button) grassCoverErosionInwardsCalculationsView.Controls.Find("buttonGenerateCalculations", true)[0]; // Call @@ -269,7 +269,7 @@ using (GrassCoverErosionInwardsCalculationsView grassCoverErosionInwardsCalculationsView = ShowGrassCoverErosionInwardsCalculationsView()) { - grassCoverErosionInwardsCalculationsView.GrassCoverErosionInwardsFailureMechanism = grassCoverErosionInwardsFailureMechanism; + grassCoverErosionInwardsCalculationsView.FailureMechanism = grassCoverErosionInwardsFailureMechanism; var button = (Button) grassCoverErosionInwardsCalculationsView.Controls.Find("buttonGenerateCalculations", true)[0]; // Call @@ -311,7 +311,7 @@ using (GrassCoverErosionInwardsCalculationsView grassCoverErosionInwardsCalculationsView = ShowGrassCoverErosionInwardsCalculationsView()) { // Call - grassCoverErosionInwardsCalculationsView.GrassCoverErosionInwardsFailureMechanism = failureMechanism; + grassCoverErosionInwardsCalculationsView.FailureMechanism = failureMechanism; // Assert var listBox = (ListBox) new ControlTester("listBox").TheObject; @@ -373,7 +373,7 @@ using (var calculationsView = new GrassCoverErosionInwardsCalculationsView { AssessmentSection = assessmentSection, - GrassCoverErosionInwardsFailureMechanism = failureMechanism, + FailureMechanism = failureMechanism, Data = ConfigureCalculationGroup(assessmentSection, failureMechanism) }) { @@ -529,7 +529,7 @@ using (GrassCoverErosionInwardsCalculationsView grassCoverErosionInwardsCalculationsView = ShowGrassCoverErosionInwardsCalculationsView()) { - grassCoverErosionInwardsCalculationsView.GrassCoverErosionInwardsFailureMechanism = failureMechanism; + grassCoverErosionInwardsCalculationsView.FailureMechanism = failureMechanism; var listBox = (ListBox) new ControlTester("listBox").TheObject; @@ -837,7 +837,7 @@ GrassCoverErosionInwardsCalculationsView view = ShowGrassCoverErosionInwardsCalculationsView(); view.Data = calculationGroup; view.AssessmentSection = assessmentSection; - view.GrassCoverErosionInwardsFailureMechanism = failureMechanism; + view.FailureMechanism = failureMechanism; return view; } Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismCalculationViewInfoTest.cs =================================================================== diff -u -r911648ccba516f30ff8f4c348def33725304986d -r950c2bc06cda222b149f4663db732cf1c4554dbe --- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismCalculationViewInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismCalculationViewInfoTest.cs) (revision 911648ccba516f30ff8f4c348def33725304986d) +++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismCalculationViewInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismCalculationViewInfoTest.cs) (revision 950c2bc06cda222b149f4663db732cf1c4554dbe) @@ -319,7 +319,7 @@ grassCoverErosionInwardsFailureMechanism, assessmentSection); view.Expect(v => v.AssessmentSection = assessmentSection); - view.Expect(v => v.GrassCoverErosionInwardsFailureMechanism = grassCoverErosionInwardsFailureMechanism); + view.Expect(v => v.FailureMechanism = grassCoverErosionInwardsFailureMechanism); mocks.ReplayAll();