/// <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.LimitSet == null)) { IAnalogLimitSet limitSetCasted = item.As <IAnalogLimitSet>(); if ((limitSetCasted != null)) { this._parent.LimitSet = limitSetCasted; 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) { IAnalogLimitSet analogLimitSetItem = item.As <IAnalogLimitSet>(); if (((analogLimitSetItem != null) && this._parent.LimitSets.Remove(analogLimitSetItem))) { return(true); } if ((this._parent.SetPoint == item)) { this._parent.SetPoint = null; return(true); } IAnalogValue analogValueItem = item.As <IAnalogValue>(); if (((analogValueItem != null) && this._parent.AnalogValues.Remove(analogValueItem))) { 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) { IAnalogLimitSet limitSetsCasted = item.As <IAnalogLimitSet>(); if ((limitSetsCasted != null)) { this._parent.LimitSets.Add(limitSetsCasted); } if ((this._parent.SetPoint == null)) { ISetPoint setPointCasted = item.As <ISetPoint>(); if ((setPointCasted != null)) { this._parent.SetPoint = setPointCasted; return; } } IAnalogValue analogValuesCasted = item.As <IAnalogValue>(); if ((analogValuesCasted != null)) { this._parent.AnalogValues.Add(analogValuesCasted); } }