Пример #1
0
 //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;
 }
Пример #2
0
        /// <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;
        }
Пример #3
0
 /// <summary>
 /// The deep copy constructor.
 /// </summary>
 /// <param name="source">The source instance.</param>
 public PoolsSettings(PoolsSettings source)
     : this()
 {
     AddPools(source.PoolCfgCollection);
     return;
 }