Index: Application/Ringtoets/src/Application.Ringtoets/App.xaml.cs =================================================================== diff -u -r1ff2f27e84cbd5da25a9da66d478467a773cb573 -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 --- Application/Ringtoets/src/Application.Ringtoets/App.xaml.cs (.../App.xaml.cs) (revision 1ff2f27e84cbd5da25a9da66d478467a773cb573) +++ Application/Ringtoets/src/Application.Ringtoets/App.xaml.cs (.../App.xaml.cs) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -45,6 +45,7 @@ using log4net; using log4net.Appender; using Ringtoets.GrassCoverErosionInwards.Plugin; +using Ringtoets.GrassCoverErosionOutwards.Plugin; using Ringtoets.HeightStructures.Plugin; using Ringtoets.Integration.Data; using Ringtoets.Integration.Plugin; @@ -149,6 +150,7 @@ new CommonToolsPlugin(), new RingtoetsPlugin(), new GrassCoverErosionInwardsPlugin(), + new GrassCoverErosionOutwardsPlugin(), new PipingPlugin(), new HeightStructuresPlugin(), new StabilityStoneCoverPlugin(), Index: Application/Ringtoets/src/Application.Ringtoets/Application.Ringtoets.csproj =================================================================== diff -u -r2177c6d6b789144bf2a7fb4b492d8d3e23e134a7 -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 --- Application/Ringtoets/src/Application.Ringtoets/Application.Ringtoets.csproj (.../Application.Ringtoets.csproj) (revision 2177c6d6b789144bf2a7fb4b492d8d3e23e134a7) +++ Application/Ringtoets/src/Application.Ringtoets/Application.Ringtoets.csproj (.../Application.Ringtoets.csproj) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -164,6 +164,11 @@ Ringtoets.GrassCoverErosionInwards.Plugin False + + {9B3ED064-E29F-4D38-85E0-3A82B77BA702} + Ringtoets.GrassCoverErosionOutwards.Plugin + False + {9AF85B2B-8D78-43C5-9542-FBB3A14EAB36} Ringtoets.HeightStructures.Plugin Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContext.cs =================================================================== diff -u -rdd95a590c807772d742ebe1b7e28611fa4931863 -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContext.cs (.../GrassCoverErosionInwardsFailureMechanismContext.cs) (revision dd95a590c807772d742ebe1b7e28611fa4931863) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContext.cs (.../GrassCoverErosionInwardsFailureMechanismContext.cs) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -35,7 +35,7 @@ /// Initializes a new instance of the class. /// /// The instance wrapped by this context object. - /// The assessment section which the calculation belongs to. + /// The assessment section which the failure mechanism belongs to. /// When any input argument is null. public GrassCoverErosionInwardsFailureMechanismContext(GrassCoverErosionInwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(failureMechanism, assessmentSection) {} Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanism.cs =================================================================== diff -u -r5e0253e5d6a341d58a67e47830de4845e8699b0c -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanism.cs (.../GrassCoverErosionOutwardsFailureMechanism.cs) (revision 5e0253e5d6a341d58a67e47830de4845e8699b0c) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanism.cs (.../GrassCoverErosionOutwardsFailureMechanism.cs) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -31,7 +31,8 @@ /// Model containing input and output needed to perform different levels of the /// Grass Cover Erosion Outwards failure mechanism. /// - public class GrassCoverErosionOutwardsFailureMechanism : FailureMechanismBase, IHasSectionResults + public class GrassCoverErosionOutwardsFailureMechanism : FailureMechanismBase, + IHasSectionResults { private readonly IList sectionResults; Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Properties/Resources.Designer.cs =================================================================== diff -u -r5e0253e5d6a341d58a67e47830de4845e8699b0c -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5e0253e5d6a341d58a67e47830de4845e8699b0c) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -43,7 +43,7 @@ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { + public class Resources { private static global::System.Resources.ResourceManager resourceMan; @@ -57,7 +57,7 @@ /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ringtoets.GrassCoverErosionOutwards.Data.Properties.Resources", typeof(Resources).Assembly); @@ -72,7 +72,7 @@ /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -84,7 +84,7 @@ /// /// Looks up a localized string similar to GEBU. /// - internal static string GrassCoverErosionOutwardsFailureMechanism_Code { + public static string GrassCoverErosionOutwardsFailureMechanism_Code { get { return ResourceManager.GetString("GrassCoverErosionOutwardsFailureMechanism_Code", resourceCulture); } @@ -93,7 +93,7 @@ /// /// Looks up a localized string similar to Dijken en dammen - Grasbekleding erosie buitentalud. /// - internal static string GrassCoverErosionOutwardsFailureMechanism_DisplayName { + public static string GrassCoverErosionOutwardsFailureMechanism_DisplayName { get { return ResourceManager.GetString("GrassCoverErosionOutwardsFailureMechanism_DisplayName", resourceCulture); } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Ringtoets.GrassCoverErosionOutwards.Data.csproj =================================================================== diff -u -r8fecdfa8821b91dc919ce64a82ee6056822aab94 -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Ringtoets.GrassCoverErosionOutwards.Data.csproj (.../Ringtoets.GrassCoverErosionOutwards.Data.csproj) (revision 8fecdfa8821b91dc919ce64a82ee6056822aab94) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Ringtoets.GrassCoverErosionOutwards.Data.csproj (.../Ringtoets.GrassCoverErosionOutwards.Data.csproj) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -67,7 +67,7 @@ - ResXFileCodeGenerator + PublicResXFileCodeGenerator Resources.Designer.cs Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsFailureMechanismContext.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsFailureMechanismContext.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsFailureMechanismContext.cs (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -0,0 +1,46 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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. + +using System; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.GrassCoverErosionOutwards.Data; + +namespace Ringtoets.GrassCoverErosionOutwards.Forms.PresentationObjects +{ + /// + /// This class is a presentation object for an instance of . + /// + public class GrassCoverErosionOutwardsFailureMechanismContext + : FailureMechanismContext + { + /// + /// Initializes a new instance of the class. + /// + /// The + /// instance wrapped by this context object. + /// The assessment section which the failure mechanism belongs to. + /// Thrown when any input argument is null. + public GrassCoverErosionOutwardsFailureMechanismContext(GrassCoverErosionOutwardsFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + : base(failureMechanism, assessmentSection) {} + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj =================================================================== diff -u -r8fecdfa8821b91dc919ce64a82ee6056822aab94 -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.csproj) (revision 8fecdfa8821b91dc919ce64a82ee6056822aab94) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.csproj) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -40,11 +40,12 @@ Properties\GlobalAssembly.cs + - + UserControl - + @@ -77,11 +78,6 @@ Ringtoets.Common.Forms False - - {AD0CDC89-0A00-4068-AEEC-9838863C2FE8} - Ringtoets.Integration.Forms - False - {E7225477-577F-4A17-B7EC-6721158E1543} Ringtoets.GrassCoverErosionOutwards.Data Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismResultView.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismResultView.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismResultView.cs (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -0,0 +1,104 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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. + +using System; +using System.Linq; +using System.Windows.Forms; +using Core.Common.Utils; +using Core.Common.Utils.Reflection; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.Properties; +using Ringtoets.Common.Forms.Views; +using Ringtoets.GrassCoverErosionOutwards.Data; + +namespace Ringtoets.GrassCoverErosionOutwards.Forms.Views +{ + /// + /// The view for a collection of . + /// + public class GrassCoverErosionOutwardsFailureMechanismResultView : FailureMechanismResultView + { + private const int assessmentLayerOneColumnIndex = 1; + + /// + /// Creates a new instance of . + /// + public GrassCoverErosionOutwardsFailureMechanismResultView() + { + DataGridViewControl.AddCellFormattingHandler(OnCellFormatting); + + AddDataGridColumns(); + } + + protected override object CreateFailureMechanismSectionResultRow(GrassCoverErosionOutwardsFailureMechanismSectionResult sectionResult) + { + return new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(sectionResult); + } + + protected override void Dispose(bool disposing) + { + DataGridViewControl.RemoveCellFormattingHandler(OnCellFormatting); + + base.Dispose(disposing); + } + + private void OnCellFormatting(object sender, DataGridViewCellFormattingEventArgs eventArgs) + { + if (eventArgs.ColumnIndex > assessmentLayerOneColumnIndex) + { + if (HasPassedLevelOne(eventArgs.RowIndex)) + { + DataGridViewControl.DisableCell(eventArgs.RowIndex, eventArgs.ColumnIndex); + } + else + { + DataGridViewControl.RestoreCell(eventArgs.RowIndex, eventArgs.ColumnIndex); + } + } + } + + private void AddDataGridColumns() + { + EnumDisplayWrapper[] twoAResultDataSource = + Enum.GetValues(typeof(AssessmentLayerTwoAResult)) + .OfType() + .Select(el => new EnumDisplayWrapper(el)) + .ToArray(); + + DataGridViewControl.AddTextBoxColumn( + TypeUtils.GetMemberName(sr => sr.Name), + Resources.FailureMechanismResultView_InitializeDataGridView_Section_name, + true); + DataGridViewControl.AddCheckBoxColumn( + TypeUtils.GetMemberName(sr => sr.AssessmentLayerOne), + Resources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_one); + DataGridViewControl.AddComboBoxColumn( + TypeUtils.GetMemberName(sr => sr.AssessmentLayerTwoA), + Resources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_two_a, + twoAResultDataSource, + TypeUtils.GetMemberName>(edw => edw.Value), + TypeUtils.GetMemberName>(edw => edw.DisplayName)); + DataGridViewControl.AddTextBoxColumn( + TypeUtils.GetMemberName(sr => sr.AssessmentLayerThree), + Resources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_three); + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -0,0 +1,111 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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. + +using System; +using System.ComponentModel; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.GrassCoverErosionOutwards.Data; + +namespace Ringtoets.GrassCoverErosionOutwards.Forms.Views +{ + /// + /// Class for displaying as a row in a grid view. + /// + internal class GrassCoverErosionOutwardsFailureMechanismSectionResultRow + { + private readonly GrassCoverErosionOutwardsFailureMechanismSectionResult sectionResult; + + /// + /// Creates a new instance of . + /// + /// The to wrap + /// so that it can be displayed as a row. + /// Thrown when is null. + public GrassCoverErosionOutwardsFailureMechanismSectionResultRow(GrassCoverErosionOutwardsFailureMechanismSectionResult sectionResult) + { + if (sectionResult == null) + { + throw new ArgumentNullException("sectionResult"); + } + this.sectionResult = sectionResult; + } + + /// + /// Gets the name of the failure mechanism section. + /// + public string Name + { + get + { + return sectionResult.Section.Name; + } + } + + /// + //// Gets or sets the value representing whether the section passed the layer 0 assessment. + /// + public bool AssessmentLayerOne + { + get + { + return sectionResult.AssessmentLayerOne; + } + set + { + sectionResult.AssessmentLayerOne = value; + sectionResult.NotifyObservers(); + } + } + + /// + /// Gets or sets the value representing the result of the layer 2a assessment. + /// + public AssessmentLayerTwoAResult AssessmentLayerTwoA + { + get + { + return sectionResult.AssessmentLayerTwoA; + } + set + { + sectionResult.AssessmentLayerTwoA = value; + } + } + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return sectionResult.AssessmentLayerThree; + } + set + { + sectionResult.AssessmentLayerThree = value; + } + } + } +} \ No newline at end of file Fisheye: Tag 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsResultView.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsSectionResultRow.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -0,0 +1,173 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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. + +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using Core.Common.Controls.TreeView; +using Core.Common.Gui.Plugin; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.Common.Forms.TreeNodeInfos; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.GrassCoverErosionOutwards.Forms.PresentationObjects; +using Ringtoets.GrassCoverErosionOutwards.Forms.Views; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.GrassCoverErosionOutwards.Plugin +{ + /// + /// The plug-in for the . + /// + public class GrassCoverErosionOutwardsPlugin : PluginBase + { + public override IEnumerable GetViewInfos() + { + yield return new ViewInfo< + FailureMechanismSectionResultContext, + IEnumerable, + GrassCoverErosionOutwardsFailureMechanismResultView> + { + GetViewName = (v, o) => RingtoetsCommonDataResources.FailureMechanism_AssessmentResult_DisplayName, + Image = RingtoetsCommonFormsResources.FailureMechanismSectionResultIcon, + CloseForData = CloseFailureMechanismResultViewForData, + GetViewData = context => context.WrappedData, + AfterCreate = (view, context) => view.FailureMechanism = context.FailureMechanism + }; + } + + public override IEnumerable GetTreeNodeInfos() + { + yield return RingtoetsTreeNodeInfoFactory.CreateFailureMechanismContextTreeNodeInfo( + FailureMechanismEnabledChildNodeObjects, + FailureMechanismDisabledChildNodeObjects, + FailureMechanismEnabledContextMenuStrip, + FailureMechanismDisabledContextMenuStrip); + + yield return new TreeNodeInfo> + { + Text = context => RingtoetsCommonDataResources.FailureMechanism_AssessmentResult_DisplayName, + Image = context => RingtoetsCommonFormsResources.FailureMechanismSectionResultIcon, + ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl) + .AddOpenItem() + .Build() + }; + } + + #region ViewInfos + #region GrassCoverErosionOutwardsFailureMechanismResultView ViewInfo + + private static bool CloseFailureMechanismResultViewForData(GrassCoverErosionOutwardsFailureMechanismResultView view, object o) + { + var assessmentSection = o as IAssessmentSection; + var failureMechanism = o as GrassCoverErosionOutwardsFailureMechanism; + var failureMechanismContext = o as IFailureMechanismContext; + if (assessmentSection != null) + { + return assessmentSection + .GetFailureMechanisms() + .OfType() + .Any(fm => ReferenceEquals(view.Data, fm.SectionResults)); + } + if (failureMechanismContext != null) + { + failureMechanism = failureMechanismContext.WrappedData; + } + return failureMechanism != null && ReferenceEquals(view.Data, failureMechanism.SectionResults); + } + + #endregion + #endregion + + #region TreeNodeInfos + #region GrassCoverErosionOutwardsFailureMechanismContext TreeNodeInfo + + private object[] FailureMechanismEnabledChildNodeObjects(GrassCoverErosionOutwardsFailureMechanismContext failureMechanismContext) + { + GrassCoverErosionOutwardsFailureMechanism wrappedData = failureMechanismContext.WrappedData; + return new object[] + { + new CategoryTreeFolder(RingtoetsCommonFormsResources.FailureMechanism_Inputs_DisplayName, GetInputs(wrappedData, failureMechanismContext.Parent), TreeFolderCategory.Input), + new CategoryTreeFolder(RingtoetsCommonFormsResources.FailureMechanism_Outputs_DisplayName, GetOutputs(wrappedData), TreeFolderCategory.Output) + }; + } + + private object[] FailureMechanismDisabledChildNodeObjects(GrassCoverErosionOutwardsFailureMechanismContext failureMechanismContext) + { + return new object[] + { + new CommentContext(failureMechanismContext.WrappedData) + }; + } + + private static IList GetInputs(GrassCoverErosionOutwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) + { + return new ArrayList + { + new FailureMechanismSectionsContext(failureMechanism, assessmentSection), + new CommentContext(failureMechanism) + }; + } + + private static IList GetOutputs(GrassCoverErosionOutwardsFailureMechanism failureMechanism) + { + return new ArrayList + { + new FailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism) + }; + } + + private ContextMenuStrip FailureMechanismEnabledContextMenuStrip(GrassCoverErosionOutwardsFailureMechanismContext grassCoverErosionOutwardsFailureMechanismContext, object parentData, TreeViewControl treeViewControl) + { + var builder = new RingtoetsContextMenuBuilder(Gui.Get(grassCoverErosionOutwardsFailureMechanismContext, treeViewControl)); + + return builder.AddToggleRelevancyOfFailureMechanismItem(grassCoverErosionOutwardsFailureMechanismContext, RemoveAllViewsForItem) + .AddSeparator() + .AddExpandAllItem() + .AddCollapseAllItem() + .AddSeparator() + .AddPropertiesItem() + .Build(); + } + + private void RemoveAllViewsForItem(GrassCoverErosionOutwardsFailureMechanismContext failureMechanismContext) + { + Gui.ViewCommands.RemoveAllViewsForItem(failureMechanismContext); + } + + private ContextMenuStrip FailureMechanismDisabledContextMenuStrip(GrassCoverErosionOutwardsFailureMechanismContext grassCoverErosionOutwardsFailureMechanismContext, object parentData, TreeViewControl treeViewControl) + { + var builder = new RingtoetsContextMenuBuilder(Gui.Get(grassCoverErosionOutwardsFailureMechanismContext, treeViewControl)); + + return builder.AddToggleRelevancyOfFailureMechanismItem(grassCoverErosionOutwardsFailureMechanismContext, null) + .AddSeparator() + .AddExpandAllItem() + .AddCollapseAllItem() + .Build(); + } + + #endregion + #endregion + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Ringtoets.GrassCoverErosionOutwards.Plugin.csproj =================================================================== diff -u -r8fecdfa8821b91dc919ce64a82ee6056822aab94 -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Ringtoets.GrassCoverErosionOutwards.Plugin.csproj (.../Ringtoets.GrassCoverErosionOutwards.Plugin.csproj) (revision 8fecdfa8821b91dc919ce64a82ee6056822aab94) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Ringtoets.GrassCoverErosionOutwards.Plugin.csproj (.../Ringtoets.GrassCoverErosionOutwards.Plugin.csproj) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) @@ -34,11 +34,14 @@ + + Properties\GlobalAssembly.cs + @@ -47,16 +50,46 @@ + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + False + + + {1D27F91F-4E62-4EAF-A0A8-A32708B9A9B1} + Core.Common.Controls.TreeView + False + + + {9a2d67e6-26ac-4d17-b11a-2b4372f2f572} + Core.Common.Controls + False + {30E4C2AE-719E-4D70-9FA9-668A9767FBFA} Core.Common.Gui False + + {d4200f43-3f72-4f42-af0a-8ced416a38ec} + Ringtoets.Common.Data + False + + + {4d840673-3812-4338-a352-84854e32b8a0} + Ringtoets.Common.Forms + False + {E7225477-577F-4A17-B7EC-6721158E1543} Ringtoets.GrassCoverErosionOutwards.Data False + + {41B829C1-630F-40B0-8BEE-B1C4C94EC8C4} + Ringtoets.GrassCoverErosionOutwards.Forms + False +