Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryDatabase.cs =================================================================== diff -u -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryDatabase.cs (.../HydraulicBoundaryDatabase.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryDatabase.cs (.../HydraulicBoundaryDatabase.cs) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e) @@ -19,8 +19,10 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Core.Common.Base; +using Resources = Ringtoets.Common.Data.Properties.Resources; namespace Ringtoets.Common.Data.Hydraulics { @@ -29,16 +31,34 @@ /// public class HydraulicBoundaryDatabase : Observable { + private bool usePreprocessor; + private string preprocessorDirectory; + /// - /// Creates a new instance of - /// and creates a with . + /// Creates a new instance of . /// + /// is set to false. public HydraulicBoundaryDatabase() { + CanUsePreprocessor = false; Locations = new List(); } /// + /// Creates a new instance of . + /// + /// A value indicating whether the Hydra-Ring preprocessor must be used. + /// The Hydra-Ring preprocessor directory. + /// is set to true. + public HydraulicBoundaryDatabase(bool usePreprocessor, string preprocessorDirectory) + { + CanUsePreprocessor = true; + Locations = new List(); + UsePreprocessor = usePreprocessor; + PreprocessorDirectory = preprocessorDirectory; + } + + /// /// The path to the hydraulic boundary database file. /// public string FilePath { get; set; } @@ -52,5 +72,58 @@ /// Gets the hydraulic boundary locations. /// public List Locations { get; } + + /// + /// Gets a value indicating whether the Hydra-Ring preprocessor can be used. + /// + public bool CanUsePreprocessor { get; } + + /// + /// Gets or sets a value indicating whether the Hydra-Ring preprocessor must be used. + /// + /// Thrown when set while is false. + public bool UsePreprocessor + { + get + { + return usePreprocessor; + } + set + { + if (!CanUsePreprocessor) + { + throw new InvalidOperationException($"{nameof(CanUsePreprocessor)} is false."); + } + + usePreprocessor = value; + } + } + + /// + /// Gets or sets the Hydra-Ring preprocessor directory. + /// + /// Thrown when set while is false. + /// Thrown when setting a value that matches . + public string PreprocessorDirectory + { + get + { + return preprocessorDirectory; + } + set + { + if (!CanUsePreprocessor) + { + throw new InvalidOperationException($"{nameof(CanUsePreprocessor)} is false."); + } + + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException(Resources.HydraulicBoundaryDatabase_PreprocessorDirectory_Path_must_have_a_value); + } + + preprocessorDirectory = value; + } + } } } \ No newline at end of file