/// <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.RTO == null)) { IRTO rTOCasted = item.As <IRTO>(); if ((rTOCasted != null)) { this._parent.RTO = rTOCasted; 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.ResourceGroup == item)) { this._parent.ResourceGroup = null; return(true); } IRTO rTOItem = item.As <IRTO>(); if (((rTOItem != null) && this._parent.RTOs.Remove(rTOItem))) { 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.ResourceGroup == null)) { IResourceGroup resourceGroupCasted = item.As <IResourceGroup>(); if ((resourceGroupCasted != null)) { this._parent.ResourceGroup = resourceGroupCasted; return; } } IRTO rTOsCasted = item.As <IRTO>(); if ((rTOsCasted != null)) { this._parent.RTOs.Add(rTOsCasted); } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IContingencyConstraintLimit contingencyConstraintLimitsCasted = item.As <IContingencyConstraintLimit>(); if ((contingencyConstraintLimitsCasted != null)) { this._parent.ContingencyConstraintLimits.Add(contingencyConstraintLimitsCasted); } if ((this._parent.DefaultConstraintLimit == null)) { IDefaultConstraintLimit defaultConstraintLimitCasted = item.As <IDefaultConstraintLimit>(); if ((defaultConstraintLimitCasted != null)) { this._parent.DefaultConstraintLimit = defaultConstraintLimitCasted; return; } } if ((this._parent.BaseCaseConstraintLimit == null)) { IBaseCaseConstraintLimit baseCaseConstraintLimitCasted = item.As <IBaseCaseConstraintLimit>(); if ((baseCaseConstraintLimitCasted != null)) { this._parent.BaseCaseConstraintLimit = baseCaseConstraintLimitCasted; return; } } IConstraintTerm constraintTermsCasted = item.As <IConstraintTerm>(); if ((constraintTermsCasted != null)) { this._parent.ConstraintTerms.Add(constraintTermsCasted); } if ((this._parent.RTO == null)) { IRTO rTOCasted = item.As <IRTO>(); if ((rTOCasted != null)) { this._parent.RTO = rTOCasted; return; } } }