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)
            {
                ITapChanger tapChangerCasted = item.As <ITapChanger>();

                if ((tapChangerCasted != null))
                {
                    this._parent.TapChanger.Add(tapChangerCasted);
                }
                if ((this._parent.Terminal == null))
                {
                    ITerminal terminalCasted = item.As <ITerminal>();
                    if ((terminalCasted != null))
                    {
                        this._parent.Terminal = terminalCasted;
                        return;
                    }
                }
                IRegulatingCondEq regulatingCondEqCasted = item.As <IRegulatingCondEq>();

                if ((regulatingCondEqCasted != null))
                {
                    this._parent.RegulatingCondEq.Add(regulatingCondEqCasted);
                }
                IRegulationSchedule regulationScheduleCasted = item.As <IRegulationSchedule>();

                if ((regulationScheduleCasted != null))
                {
                    this._parent.RegulationSchedule.Add(regulationScheduleCasted);
                }
            }
Example #2
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)
            {
                ITapChanger tapChangerItem = item.As <ITapChanger>();

                if (((tapChangerItem != null) &&
                     this._parent.TapChanger.Remove(tapChangerItem)))
                {
                    return(true);
                }
                if ((this._parent.Terminal == item))
                {
                    this._parent.Terminal = null;
                    return(true);
                }
                IRegulatingCondEq regulatingCondEqItem = item.As <IRegulatingCondEq>();

                if (((regulatingCondEqItem != null) &&
                     this._parent.RegulatingCondEq.Remove(regulatingCondEqItem)))
                {
                    return(true);
                }
                IRegulationSchedule regulationScheduleItem = item.As <IRegulationSchedule>();

                if (((regulationScheduleItem != null) &&
                     this._parent.RegulationSchedule.Remove(regulationScheduleItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #3
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.RegulationSchedule == null))
     {
         IRegulationSchedule regulationScheduleCasted = item.As <IRegulationSchedule>();
         if ((regulationScheduleCasted != null))
         {
             this._parent.RegulationSchedule = regulationScheduleCasted;
             return;
         }
     }
     if ((this._parent.BusbarSection == null))
     {
         IBusbarSection busbarSectionCasted = item.As <IBusbarSection>();
         if ((busbarSectionCasted != null))
         {
             this._parent.BusbarSection = busbarSectionCasted;
             return;
         }
     }
 }