Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/DamProjectCalculationSpecification.cs =================================================================== diff -u -r4000 -r4052 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/DamProjectCalculationSpecification.cs (.../DamProjectCalculationSpecification.cs) (revision 4000) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/DamProjectCalculationSpecification.cs (.../DamProjectCalculationSpecification.cs) (revision 4052) @@ -23,102 +23,101 @@ using Deltares.DamEngine.Data.Standard.Language; using Deltares.DamEngine.Data.Standard.Validation; -namespace Deltares.DamEngine.Data.General +namespace Deltares.DamEngine.Data.General; + +/// +/// Represents the calculation specifications at project level for DAM. +/// These are the main choices that specify the calculation +/// +public class DamProjectCalculationSpecification { + private DamFailureMechanismeCalculationSpecification currentSpecification; + /// - /// Represents the calculation specifications at project level for DAM. - /// These are the main choices that specify the calculation + /// Initializes a new instance of the class. /// - public class DamProjectCalculationSpecification + public DamProjectCalculationSpecification() { - private DamFailureMechanismeCalculationSpecification currentSpecification; + DamCalculationSpecifications = new List(); + //waterLevelTimeSeriesFileName = @"d:\src\delftgeosystems\trunk\data\Dam\RRD\Groot Salland\DAM UI Testdata\inputshortstart_dam.xml"; + } - /// - /// Initializes a new instance of the class. - /// - public DamProjectCalculationSpecification() + /// + /// Gets the dam calculation specifications. + /// + /// + /// The dam calculation specifications. + /// + [Validate] + public List DamCalculationSpecifications { get; } + + /// + /// Gets or sets the analysis type for serialization purpose only. + /// This "dummy" property is and must be only used for serialization/deserialization purposes as the real static property + /// SelectedAnalysisType is NOT serialized. This is way its name is deliberately strange. + /// + /// + /// The analysis type for serialization purpose only. + /// + public AnalysisType AnalysisTypeForSerializationPurposeOnly + { + get { - DamCalculationSpecifications = new List(); - //waterLevelTimeSeriesFileName = @"d:\src\delftgeosystems\trunk\data\Dam\RRD\Groot Salland\DAM UI Testdata\inputshortstart_dam.xml"; + return SelectedAnalysisType; } - - /// - /// Gets the dam calculation specifications. - /// - /// - /// The dam calculation specifications. - /// - [Validate] - public List DamCalculationSpecifications { get; } - - /// - /// Gets or sets the analysis type for serialization purpose only. - /// This "dummy" property is and must be only used for serialization/deserialization purposes as the real static property - /// SelectedAnalysisType is NOT serialized. This is way its name is deliberately strange. - /// - /// - /// The analysis type for serialization purpose only. - /// - public AnalysisType AnalysisTypeForSerializationPurposeOnly + set { - get - { - return SelectedAnalysisType; - } - set - { - SelectedAnalysisType = value; - } + SelectedAnalysisType = value; } + } - /// - /// Gets or sets the type of the selected analysis. - /// - /// - /// The type of the selected analysis. - /// - public static AnalysisType SelectedAnalysisType { get; set; } = AnalysisType.AdaptGeometry; + /// + /// Gets or sets the type of the selected analysis. + /// + /// + /// The type of the selected analysis. + /// + public static AnalysisType SelectedAnalysisType { get; set; } = AnalysisType.AdaptGeometry; - /// - /// Gets or sets the current specification. - /// - /// - /// The current specification. - /// - public DamFailureMechanismeCalculationSpecification CurrentSpecification + /// + /// Gets or sets the current specification. + /// + /// + /// The current specification. + /// + public DamFailureMechanismeCalculationSpecification CurrentSpecification + { + get { - get + if (currentSpecification == null && DamCalculationSpecifications.Count > 0) { - if (currentSpecification == null && DamCalculationSpecifications.Count > 0) - { - currentSpecification = DamCalculationSpecifications[0]; - } - - return currentSpecification; + currentSpecification = DamCalculationSpecifications[0]; } - set - { - currentSpecification = value; - } + + return currentSpecification; } + set + { + currentSpecification = value; + } + } - /// - /// Validates this instance. - /// - /// - [Validate] - public ValidationResult[] Validate() + /// + /// Validates this instance. + /// + /// + [Validate] + public ValidationResult[] Validate() + { + if (DamCalculationSpecifications.Count > 1) { - if (DamCalculationSpecifications.Count > 1) + return new[] { - return new[] - { - new ValidationResult(ValidationResultType.Error, LocalizationManager.GetTranslatedText(this, "MaxOneCalculationSpecification"), - this) - }; - } - - return new ValidationResult[0]; + new ValidationResult(ValidationResultType.Error, LocalizationManager.GetTranslatedText(this, "MaxOneCalculationSpecification"), + this) + }; } + + return new ValidationResult[0]; } } \ No newline at end of file