/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IContingencyConstraintLimit contingencyConstraintLimitCasted = item.As <IContingencyConstraintLimit>(); if ((contingencyConstraintLimitCasted != null)) { this._parent.ContingencyConstraintLimit.Add(contingencyConstraintLimitCasted); } IContingencyElement contingencyElementCasted = item.As <IContingencyElement>(); if ((contingencyElementCasted != null)) { this._parent.ContingencyElement.Add(contingencyElementCasted); } }
/// <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) { IContingencyConstraintLimit contingencyConstraintLimitItem = item.As <IContingencyConstraintLimit>(); if (((contingencyConstraintLimitItem != null) && this._parent.ContingencyConstraintLimit.Remove(contingencyConstraintLimitItem))) { return(true); } IContingencyElement contingencyElementItem = item.As <IContingencyElement>(); if (((contingencyElementItem != null) && this._parent.ContingencyElement.Remove(contingencyElementItem))) { return(true); } return(false); }