Exemplo n.º 1
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.HydroPowerPlant == null))
     {
         IHydroPowerPlant hydroPowerPlantCasted = item.As <IHydroPowerPlant>();
         if ((hydroPowerPlantCasted != null))
         {
             this._parent.HydroPowerPlant = hydroPowerPlantCasted;
             return;
         }
     }
     if ((this._parent.SynchronousMachine == null))
     {
         ISynchronousMachine synchronousMachineCasted = item.As <ISynchronousMachine>();
         if ((synchronousMachineCasted != null))
         {
             this._parent.SynchronousMachine = synchronousMachineCasted;
             return;
         }
     }
     if ((this._parent.HydroPumpOpSchedule == null))
     {
         IHydroPumpOpSchedule hydroPumpOpScheduleCasted = item.As <IHydroPumpOpSchedule>();
         if ((hydroPumpOpScheduleCasted != null))
         {
             this._parent.HydroPumpOpSchedule = hydroPumpOpScheduleCasted;
             return;
         }
     }
 }
Exemplo n.º 2
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                ITailbayLossCurve tailbayLossCurveCasted = item.As <ITailbayLossCurve>();

                if ((tailbayLossCurveCasted != null))
                {
                    this._parent.TailbayLossCurve.Add(tailbayLossCurveCasted);
                }
                if ((this._parent.HydroPowerPlant == null))
                {
                    IHydroPowerPlant hydroPowerPlantCasted = item.As <IHydroPowerPlant>();
                    if ((hydroPowerPlantCasted != null))
                    {
                        this._parent.HydroPowerPlant = hydroPowerPlantCasted;
                        return;
                    }
                }
                IHydroGeneratingEfficiencyCurve hydroGeneratingEfficiencyCurvesCasted = item.As <IHydroGeneratingEfficiencyCurve>();

                if ((hydroGeneratingEfficiencyCurvesCasted != null))
                {
                    this._parent.HydroGeneratingEfficiencyCurves.Add(hydroGeneratingEfficiencyCurvesCasted);
                }
                if ((this._parent.PenstockLossCurve == null))
                {
                    IPenstockLossCurve penstockLossCurveCasted = item.As <IPenstockLossCurve>();
                    if ((penstockLossCurveCasted != null))
                    {
                        this._parent.PenstockLossCurve = penstockLossCurveCasted;
                        return;
                    }
                }
            }