Esempio n. 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)
            {
                IOperationalLimit operationalLimitValueCasted = item.As <IOperationalLimit>();

                if ((operationalLimitValueCasted != null))
                {
                    this._parent.OperationalLimitValue.Add(operationalLimitValueCasted);
                }
                if ((this._parent.Terminal == null))
                {
                    ITerminal terminalCasted = item.As <ITerminal>();
                    if ((terminalCasted != null))
                    {
                        this._parent.Terminal = terminalCasted;
                        return;
                    }
                }
                if ((this._parent.Equipment == null))
                {
                    IEquipment equipmentCasted = item.As <IEquipment>();
                    if ((equipmentCasted != null))
                    {
                        this._parent.Equipment = equipmentCasted;
                        return;
                    }
                }
            }
Esempio n. 2
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IOperationalLimit operationalLimitCasted = item.As <IOperationalLimit>();

                if ((operationalLimitCasted != null))
                {
                    this._parent.OperationalLimit.Add(operationalLimitCasted);
                }
            }
Esempio n. 3
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)
            {
                IOperationalLimit operationalLimitItem = item.As <IOperationalLimit>();

                if (((operationalLimitItem != null) &&
                     this._parent.OperationalLimit.Remove(operationalLimitItem)))
                {
                    return(true);
                }
                return(false);
            }
Esempio n. 4
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)
            {
                IOperationalLimit operationalLimitItem = item.As <IOperationalLimit>();

                if (((operationalLimitItem != null) &&
                     this._parent.OperationalLimitValue.Remove(operationalLimitItem)))
                {
                    return(true);
                }
                if ((this._parent.Terminal == item))
                {
                    this._parent.Terminal = null;
                    return(true);
                }
                if ((this._parent.Equipment == item))
                {
                    this._parent.Equipment = null;
                    return(true);
                }
                return(false);
            }