Beispiel #1
0
            /// <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;
                    }
                }
            }
Beispiel #2
0
            /// <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);
            }
Beispiel #3
0
 /// <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.OperationalLimitSet == null))
     {
         IOperationalLimitSet operationalLimitSetCasted = item.As <IOperationalLimitSet>();
         if ((operationalLimitSetCasted != null))
         {
             this._parent.OperationalLimitSet = operationalLimitSetCasted;
             return;
         }
     }
     if ((this._parent.OperationalLimitType == null))
     {
         IOperationalLimitType operationalLimitTypeCasted = item.As <IOperationalLimitType>();
         if ((operationalLimitTypeCasted != null))
         {
             this._parent.OperationalLimitType = operationalLimitTypeCasted;
             return;
         }
     }
 }