/// <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); } }
/// <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); }
/// <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.RegulatingCondEq == null)) { IRegulatingCondEq regulatingCondEqCasted = item.As <IRegulatingCondEq>(); if ((regulatingCondEqCasted != null)) { this._parent.RegulatingCondEq = regulatingCondEqCasted; return; } } if ((this._parent.ControlType == null)) { IControlType controlTypeCasted = item.As <IControlType>(); if ((controlTypeCasted != null)) { this._parent.ControlType = controlTypeCasted; return; } } if ((this._parent.Unit == null)) { IUnit unitCasted = item.As <IUnit>(); if ((unitCasted != null)) { this._parent.Unit = unitCasted; return; } } if ((this._parent.RemoteControl == null)) { IRemoteControl remoteControlCasted = item.As <IRemoteControl>(); if ((remoteControlCasted != null)) { this._parent.RemoteControl = remoteControlCasted; return; } } }