/// <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) { IOperationalLimitSet operationalLimitSetItem = item.As <IOperationalLimitSet>(); if (((operationalLimitSetItem != null) && this._parent.OperationalLimitSet.Remove(operationalLimitSetItem))) { return(true); } IContingencyEquipment contingencyEquipmentItem = item.As <IContingencyEquipment>(); if (((contingencyEquipmentItem != null) && this._parent.ContingencyEquipment.Remove(contingencyEquipmentItem))) { return(true); } ICustomerAgreement customerAgreementItem = item.As <ICustomerAgreement>(); if (((customerAgreementItem != null) && this._parent.CustomerAgreements.Remove(customerAgreementItem))) { return(true); } if ((this._parent.EquipmentContainer == item)) { this._parent.EquipmentContainer = 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) { IOperationalLimitSet operationalLimitSetCasted = item.As <IOperationalLimitSet>(); if ((operationalLimitSetCasted != null)) { this._parent.OperationalLimitSet.Add(operationalLimitSetCasted); } IContingencyEquipment contingencyEquipmentCasted = item.As <IContingencyEquipment>(); if ((contingencyEquipmentCasted != null)) { this._parent.ContingencyEquipment.Add(contingencyEquipmentCasted); } ICustomerAgreement customerAgreementsCasted = item.As <ICustomerAgreement>(); if ((customerAgreementsCasted != null)) { this._parent.CustomerAgreements.Add(customerAgreementsCasted); } if ((this._parent.EquipmentContainer == null)) { IEquipmentContainer equipmentContainerCasted = item.As <IEquipmentContainer>(); if ((equipmentContainerCasted != null)) { this._parent.EquipmentContainer = equipmentContainerCasted; return; } } }
/// <summary> /// Creates a new observable property access proxy /// </summary> /// <param name="modelElement">The model instance element for which to create the property access proxy</param> public ContingentStatusProxy(IContingencyEquipment modelElement) : base(modelElement, "contingentStatus") { }