Example #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;
         }
     }
 }
Example #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)
            {
                ISynchronousMachine synchronousMachinesCasted = item.As <ISynchronousMachine>();

                if ((synchronousMachinesCasted != null))
                {
                    this._parent.SynchronousMachines.Add(synchronousMachinesCasted);
                }
            }
Example #3
0
            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                ISynchronousMachine synchronousMachineItem = item.As <ISynchronousMachine>();

                if (((synchronousMachineItem != null) &&
                     this._parent.SynchronousMachines.Remove(synchronousMachineItem)))
                {
                    return(true);
                }
                return(false);
            }