Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelLocationsContext.cs
===================================================================
diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rc114776ae9eae9848dd5841211bbe2105ae57dc7
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelLocationsContext.cs (.../DesignWaterLevelLocationsContext.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelLocationsContext.cs (.../DesignWaterLevelLocationsContext.cs) (revision c114776ae9eae9848dd5841211bbe2105ae57dc7)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using Core.Common.Base;
using Core.Common.Controls.PresentationObjects;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.Hydraulics;
@@ -30,13 +31,28 @@
/// Presentation object for all data required to configure an enumeration of
/// with .
///
- public class DesignWaterLevelLocationsContext : ObservableWrappedObjectContextBase
+ public class DesignWaterLevelLocationsContext : ObservableWrappedObjectContextBase>
{
///
/// Creates a new instance of .
///
- /// The which the belongs to.
- /// Thrown when is null.
- public DesignWaterLevelLocationsContext(IAssessmentSection wrappedAssessmentSection) : base(wrappedAssessmentSection) {}
+ /// The locations that the belongs to.
+ /// The that the belongs to.
+ /// Thrown when any parameter is null.
+ public DesignWaterLevelLocationsContext(ObservableList wrappedData,
+ IAssessmentSection assessmentSection) : base(wrappedData)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ AssessmentSection = assessmentSection;
+ }
+
+ ///
+ /// Gets the assessment section that the context belongs to.
+ ///
+ public IAssessmentSection AssessmentSection { get; }
}
}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/HydraulicBoundaryDatabaseContext.cs
===================================================================
diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rc114776ae9eae9848dd5841211bbe2105ae57dc7
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/HydraulicBoundaryDatabaseContext.cs (.../HydraulicBoundaryDatabaseContext.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/HydraulicBoundaryDatabaseContext.cs (.../HydraulicBoundaryDatabaseContext.cs) (revision c114776ae9eae9848dd5841211bbe2105ae57dc7)
@@ -30,13 +30,27 @@
///
/// Presentation object for all data required to configure an instance of .
///
- public class HydraulicBoundaryDatabaseContext : ObservableWrappedObjectContextBase
+ public class HydraulicBoundaryDatabaseContext : ObservableWrappedObjectContextBase
{
///
/// Creates a new instance of .
///
- /// The which the belongs to.
- /// Thrown when is null.
- public HydraulicBoundaryDatabaseContext(AssessmentSection wrappedAssessmentSection) : base(wrappedAssessmentSection) {}
+ /// The that the belongs to.
+ /// The that the belongs to.
+ /// Thrown when any parameter is null.
+ public HydraulicBoundaryDatabaseContext(HydraulicBoundaryDatabase wrappedData,
+ AssessmentSection assessmentSection) : base(wrappedData)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+ AssessmentSection = assessmentSection;
+ }
+
+ ///
+ /// Gets the assessment section that the context belongs to.
+ ///
+ public AssessmentSection AssessmentSection { get; }
}
}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightLocationsContext.cs
===================================================================
diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rc114776ae9eae9848dd5841211bbe2105ae57dc7
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightLocationsContext.cs (.../WaveHeightLocationsContext.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightLocationsContext.cs (.../WaveHeightLocationsContext.cs) (revision c114776ae9eae9848dd5841211bbe2105ae57dc7)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using Core.Common.Base;
using Core.Common.Controls.PresentationObjects;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.Hydraulics;
@@ -30,13 +31,28 @@
/// Presentation object for all data required to configure an enumeration of
/// with .
///
- public class WaveHeightLocationsContext : ObservableWrappedObjectContextBase
+ public class WaveHeightLocationsContext : ObservableWrappedObjectContextBase>
{
///
/// Creates a new instance of .
///
- /// The which the belongs to.
- /// Thrown when is null.
- public WaveHeightLocationsContext(IAssessmentSection wrappedAssessmentSection) : base(wrappedAssessmentSection) {}
+ /// The locations that the belongs to.
+ /// The that the belongs to.
+ /// Thrown when any parameter is null.
+ public WaveHeightLocationsContext(ObservableList wrappedData,
+ IAssessmentSection assessmentSection) : base(wrappedData)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ AssessmentSection = assessmentSection;
+ }
+
+ ///
+ /// Gets the assessment section that the context belongs to.
+ ///
+ public IAssessmentSection AssessmentSection { get; }
}
}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryDatabaseProperties.cs
===================================================================
diff -u -r0d495f2706215f1b75da521c905eb6105f2f8a34 -rc114776ae9eae9848dd5841211bbe2105ae57dc7
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryDatabaseProperties.cs (.../HydraulicBoundaryDatabaseProperties.cs) (revision 0d495f2706215f1b75da521c905eb6105f2f8a34)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryDatabaseProperties.cs (.../HydraulicBoundaryDatabaseProperties.cs) (revision c114776ae9eae9848dd5841211bbe2105ae57dc7)
@@ -27,7 +27,6 @@
using Core.Common.Gui.PropertyBag;
using Core.Common.Util.Attributes;
using Ringtoets.Common.Data.Hydraulics;
-using Ringtoets.Integration.Forms.PresentationObjects;
using Ringtoets.Integration.Forms.Properties;
using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
@@ -36,22 +35,22 @@
///
/// ViewModel of for properties panel.
///
- public class HydraulicBoundaryDatabaseProperties : ObjectProperties
+ public class HydraulicBoundaryDatabaseProperties : ObjectProperties
{
///
/// Creates a new instance of .
///
- /// The context to show the properties for.
- /// Thrown when
+ /// The hydraulic boundary database to show the properties for.
+ /// Thrown when
/// is null.
- public HydraulicBoundaryDatabaseProperties(HydraulicBoundaryDatabaseContext hydraulicBoundaryDatabaseContext)
+ public HydraulicBoundaryDatabaseProperties(HydraulicBoundaryDatabase hydraulicBoundaryDatabase)
{
- if (hydraulicBoundaryDatabaseContext == null)
+ if (hydraulicBoundaryDatabase == null)
{
- throw new ArgumentNullException(nameof(hydraulicBoundaryDatabaseContext));
+ throw new ArgumentNullException(nameof(hydraulicBoundaryDatabase));
}
- Data = hydraulicBoundaryDatabaseContext;
+ Data = hydraulicBoundaryDatabase;
}
[PropertyOrder(1)]
@@ -62,7 +61,7 @@
{
get
{
- return data.WrappedData.HydraulicBoundaryDatabase.IsLinked() ? data.WrappedData.HydraulicBoundaryDatabase.FilePath : string.Empty;
+ return data.IsLinked() ? data.FilePath : string.Empty;
}
}
@@ -75,12 +74,12 @@
{
get
{
- return data.WrappedData.HydraulicBoundaryDatabase.UsePreprocessor;
+ return data.UsePreprocessor;
}
set
{
- data.WrappedData.HydraulicBoundaryDatabase.UsePreprocessor = value;
- data.WrappedData.NotifyObservers();
+ data.UsePreprocessor = value;
+ data.NotifyObservers();
}
}
@@ -94,11 +93,11 @@
{
get
{
- return data.WrappedData.HydraulicBoundaryDatabase.PreprocessorDirectory;
+ return data.PreprocessorDirectory;
}
set
{
- data.WrappedData.HydraulicBoundaryDatabase.PreprocessorDirectory = value;
+ data.PreprocessorDirectory = value;
}
}
@@ -111,14 +110,14 @@
{
get
{
- return data.WrappedData.HydraulicBoundaryDatabase.PreprocessorDirectory;
+ return data.PreprocessorDirectory;
}
}
[DynamicVisibleValidationMethod]
public bool DynamicVisibleValidationMethod(string propertyName)
{
- bool canUsePreprocessor = data.WrappedData.HydraulicBoundaryDatabase.CanUsePreprocessor;
+ bool canUsePreprocessor = data.CanUsePreprocessor;
if (propertyName.Equals(nameof(UsePreprocessor)) && !canUsePreprocessor)
{
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs
===================================================================
diff -u -r75d12c89224759df39acf21f187f309a3e4ae274 -rc114776ae9eae9848dd5841211bbe2105ae57dc7
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision c114776ae9eae9848dd5841211bbe2105ae57dc7)
@@ -294,7 +294,7 @@
};
yield return new PropertyInfo
{
- CreateInstance = context => new HydraulicBoundaryDatabaseProperties(context)
+ CreateInstance = context => new HydraulicBoundaryDatabaseProperties(context.WrappedData)
};
yield return new PropertyInfo
{
@@ -317,7 +317,7 @@
yield return new PropertyInfo
{
CreateInstance = context => new DesignWaterLevelLocationsProperties(
- context.WrappedData.HydraulicBoundaryDatabase.Locations)
+ context.WrappedData)
};
yield return new PropertyInfo
{
@@ -326,7 +326,7 @@
yield return new PropertyInfo
{
CreateInstance = context => new WaveHeightLocationsProperties(
- context.WrappedData.HydraulicBoundaryDatabase.Locations)
+ context.WrappedData)
};
yield return new PropertyInfo
{
@@ -379,20 +379,20 @@
yield return new ViewInfo, DesignWaterLevelLocationsView>
{
GetViewName = (view, context) => RingtoetsFormsResources.DesignWaterLevelLocationsContext_DisplayName,
- GetViewData = context => context.WrappedData.HydraulicBoundaryDatabase.Locations,
+ GetViewData = context => context.WrappedData,
Image = RingtoetsCommonFormsResources.GenericInputOutputIcon,
CloseForData = CloseHydraulicBoundaryLocationsViewForData,
- CreateInstance = context => new DesignWaterLevelLocationsView(context.WrappedData.HydraulicBoundaryDatabase.Locations, context.WrappedData),
+ CreateInstance = context => new DesignWaterLevelLocationsView(context.WrappedData, context.AssessmentSection),
AfterCreate = (view, context) => { view.CalculationGuiService = hydraulicBoundaryLocationCalculationGuiService; }
};
yield return new ViewInfo, WaveHeightLocationsView>
{
GetViewName = (view, context) => RingtoetsFormsResources.WaveHeightLocationsContext_DisplayName,
- GetViewData = context => context.WrappedData.HydraulicBoundaryDatabase.Locations,
+ GetViewData = context => context.WrappedData,
Image = RingtoetsCommonFormsResources.GenericInputOutputIcon,
CloseForData = CloseHydraulicBoundaryLocationsViewForData,
- CreateInstance = context => new WaveHeightLocationsView(context.WrappedData.HydraulicBoundaryDatabase.Locations, context.WrappedData),
+ CreateInstance = context => new WaveHeightLocationsView(context.WrappedData, context.AssessmentSection),
AfterCreate = (view, context) => { view.CalculationGuiService = hydraulicBoundaryLocationCalculationGuiService; }
};
@@ -521,9 +521,9 @@
{
Name = RingtoetsCommonDataResources.HydraulicBoundaryConditions_DisplayName,
CreateFileExporter = (context, filePath) => new HydraulicBoundaryLocationsExporter(
- context.WrappedData.HydraulicBoundaryDatabase.Locations, filePath,
+ context.WrappedData.Locations, filePath,
RingtoetsIntegrationPluginResources.DesignWaterLevel_Description, RingtoetsIntegrationPluginResources.WaveHeight_Description),
- IsEnabled = context => context.WrappedData.HydraulicBoundaryDatabase.IsLinked(),
+ IsEnabled = context => context.WrappedData.IsLinked(),
FileFilterGenerator = new FileFilterGenerator(RingtoetsCommonIOResources.Shape_file_filter_Extension,
RingtoetsCommonIOResources.Shape_file_filter_Description)
};
@@ -661,7 +661,7 @@
{
Text = hydraulicBoundaryDatabase => RingtoetsFormsResources.HydraulicBoundaryDatabase_DisplayName,
Image = hydraulicBoundaryDatabase => RingtoetsCommonFormsResources.GenericInputOutputIcon,
- ForeColor = context => context.WrappedData.HydraulicBoundaryDatabase.IsLinked()
+ ForeColor = context => context.WrappedData.IsLinked()
? Color.FromKnownColor(KnownColor.ControlText)
: Color.FromKnownColor(KnownColor.GrayText),
ChildNodeObjects = HydraulicBoundaryDatabaseChildNodeObjects,
@@ -930,9 +930,9 @@
if (assessmentSection != null)
{
return assessmentSection
- .GetFailureMechanisms()
- .OfType>()
- .Any(fm => ReferenceEquals(viewData, fm.SectionResults));
+ .GetFailureMechanisms()
+ .OfType>()
+ .Any(fm => ReferenceEquals(viewData, fm.SectionResults));
}
if (failureMechanismContext != null)
@@ -1127,7 +1127,7 @@
nodeData.BackgroundData,
new ReferenceLineContext(nodeData),
new FailureMechanismContributionContext(nodeData.FailureMechanismContribution, nodeData),
- new HydraulicBoundaryDatabaseContext(nodeData),
+ new HydraulicBoundaryDatabaseContext(nodeData.HydraulicBoundaryDatabase, nodeData),
nodeData.Comments
};
@@ -1140,11 +1140,11 @@
private static IEnumerable