/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { ITieFlow tieFlowCasted = item.As <ITieFlow>(); if ((tieFlowCasted != null)) { this._parent.TieFlow.Add(tieFlowCasted); } }
/// <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) { ITieFlow tieFlowItem = item.As <ITieFlow>(); if (((tieFlowItem != null) && this._parent.TieFlow.Remove(tieFlowItem))) { 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.AnalogValue == null)) { IAnalogValue analogValueCasted = item.As <IAnalogValue>(); if ((analogValueCasted != null)) { this._parent.AnalogValue = analogValueCasted; return; } } if ((this._parent.TieFlow == null)) { ITieFlow tieFlowCasted = item.As <ITieFlow>(); if ((tieFlowCasted != null)) { this._parent.TieFlow = tieFlowCasted; return; } } }
/// <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) { IControlAreaGeneratingUnit controlAreaGeneratingUnitItem = item.As <IControlAreaGeneratingUnit>(); if (((controlAreaGeneratingUnitItem != null) && this._parent.ControlAreaGeneratingUnit.Remove(controlAreaGeneratingUnitItem))) { return(true); } if ((this._parent.EnergyArea == item)) { this._parent.EnergyArea = null; return(true); } ITieFlow tieFlowItem = item.As <ITieFlow>(); if (((tieFlowItem != null) && this._parent.TieFlow.Remove(tieFlowItem))) { 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) { IControlAreaGeneratingUnit controlAreaGeneratingUnitCasted = item.As <IControlAreaGeneratingUnit>(); if ((controlAreaGeneratingUnitCasted != null)) { this._parent.ControlAreaGeneratingUnit.Add(controlAreaGeneratingUnitCasted); } if ((this._parent.EnergyArea == null)) { IEnergyArea energyAreaCasted = item.As <IEnergyArea>(); if ((energyAreaCasted != null)) { this._parent.EnergyArea = energyAreaCasted; return; } } ITieFlow tieFlowCasted = item.As <ITieFlow>(); if ((tieFlowCasted != null)) { this._parent.TieFlow.Add(tieFlowCasted); } }