//----------------------------------------------------------------------- // // Copyright (c) 2010 Deltares. All rights reserved. // // B.S.T. The // tom.the@deltares.nl // 04-11-2010 // n.a. //----------------------------------------------------------------------- using System.IO; using System.Xml.Linq; using Deltares.Dam.Data.Assemblers; namespace Deltares.Dam.Data { using System; using System.Collections.Generic; using System.Linq; using System.Text; public class CalculationModules { public bool Stability { get; set; } public bool StabilityOutside { get; set; } public bool PipingWti { get; set; } public bool PipingBligh { get; set; } public bool PipingSellmeijer { get; set; } public bool PipingSellmeijerProbabilistic { get; set; } public bool PipingIJkdijk { get; set; } public bool Overtopping { get; set; } } public class CalculationParameters { public string WorkingPath { get; set; } public string StabilityWorkingPath { get; set; } public string PipingWorkingPath { get; set; } public string StabilityExePath { get; set; } public bool CalculateAllAtOnce { get { return MStabParameters == null || MStabParameters.IsCalculateAllStabilityProjectsAtOnce; } set { MStabParameters.IsCalculateAllStabilityProjectsAtOnce = value; } } public static CalculationParameters LoadFromFile(FileInfo xmlFile) { return LoadFromFile(xmlFile.FullName); } public static CalculationParameters LoadFromFile(string xmlFileName) { if (string.IsNullOrWhiteSpace(xmlFileName)) throw new ArgumentException("xmlFileName"); XDocument calculationParametersFileDocument = XDocument.Load(xmlFileName); var assembler = new CalculationParametersAssembler(); return assembler.CreateDomainObject(calculationParametersFileDocument); } public CalculationModules CalculationModules { get; set; } public MStabParameters MStabParameters { get; set; } } }