//Constructors /// <summary> /// Creates an initialized instance. /// </summary> /// <param name="name">The name of the reservoir structure configuration.</param> /// <param name="poolsCfg">The configuration of the pools.</param> /// <param name="interPoolConnectionsCfg">The configuration of the inter-pool connections.</param> public ReservoirStructureSettings(string name, PoolsSettings poolsCfg, InterPoolConnsSettings interPoolConnectionsCfg = null ) { Name = name; PoolsCfg = (PoolsSettings)poolsCfg.DeepClone(); InterPoolConnectionsCfg = (InterPoolConnsSettings)interPoolConnectionsCfg?.DeepClone(); Check(); return; }
/// <summary> /// Creates an initialized instance. /// </summary> /// <param name="elem">A xml element containing the configuration data.</param> public ReservoirStructureSettings(XElement elem) { //Validation XElement reservoirSettingsElem = Validate(elem, XsdTypeName); //Parsing Name = reservoirSettingsElem.Attribute("name").Value; //Pool settings collection PoolsCfg = new PoolsSettings(reservoirSettingsElem.Elements("pools").First()); //Inter pool connections InterPoolConnectionsCfg = null; XElement interPoolConnectionsElem = reservoirSettingsElem.Elements("interPoolConnections").FirstOrDefault(); if (interPoolConnectionsElem != null) { InterPoolConnectionsCfg = new InterPoolConnsSettings(interPoolConnectionsElem); } Check(); return; }
/// <summary> /// The deep copy constructor /// </summary> /// <param name="source">Source instance</param> public InterPoolConnsSettings(InterPoolConnsSettings source) : this() { AddPools(source.InterPoolConnectionCfgCollection); return; }