/// <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.ControlArea == null)) { IControlArea controlAreaCasted = item.As <IControlArea>(); if ((controlAreaCasted != null)) { this._parent.ControlArea = controlAreaCasted; return; } } IAltGeneratingUnitMeas altGeneratingUnitMeasCasted = item.As <IAltGeneratingUnitMeas>(); if ((altGeneratingUnitMeasCasted != null)) { this._parent.AltGeneratingUnitMeas.Add(altGeneratingUnitMeasCasted); } if ((this._parent.GeneratingUnit == null)) { IGeneratingUnit generatingUnitCasted = item.As <IGeneratingUnit>(); if ((generatingUnitCasted != null)) { this._parent.GeneratingUnit = generatingUnitCasted; 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) { if ((this._parent.ControlArea == item)) { this._parent.ControlArea = null; return(true); } IAltGeneratingUnitMeas altGeneratingUnitMeasItem = item.As <IAltGeneratingUnitMeas>(); if (((altGeneratingUnitMeasItem != null) && this._parent.AltGeneratingUnitMeas.Remove(altGeneratingUnitMeasItem))) { return(true); } if ((this._parent.GeneratingUnit == item)) { this._parent.GeneratingUnit = null; return(true); } return(false); }
/// <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) { IAltGeneratingUnitMeas altGeneratingUnitMeasItem = item.As <IAltGeneratingUnitMeas>(); if (((altGeneratingUnitMeasItem != null) && this._parent.AltGeneratingUnit.Remove(altGeneratingUnitMeasItem))) { return(true); } IAltTieMeas altTieMeasItem = item.As <IAltTieMeas>(); if (((altTieMeasItem != null) && this._parent.AltTieMeas.Remove(altTieMeasItem))) { return(true); } if ((this._parent.Analog == item)) { this._parent.Analog = null; 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) { IAltGeneratingUnitMeas altGeneratingUnitCasted = item.As <IAltGeneratingUnitMeas>(); if ((altGeneratingUnitCasted != null)) { this._parent.AltGeneratingUnit.Add(altGeneratingUnitCasted); } IAltTieMeas altTieMeasCasted = item.As <IAltTieMeas>(); if ((altTieMeasCasted != null)) { this._parent.AltTieMeas.Add(altTieMeasCasted); } if ((this._parent.Analog == null)) { IAnalog analogCasted = item.As <IAnalog>(); if ((analogCasted != null)) { this._parent.Analog = analogCasted; return; } } }