Пример #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)
            {
                IElectricalInfo electricalInfosCasted = item.As <IElectricalInfo>();

                if ((electricalInfosCasted != null))
                {
                    this._parent.ElectricalInfos.Add(electricalInfosCasted);
                }
            }
Пример #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)
            {
                IElectricalInfo electricalInfoItem = item.As <IElectricalInfo>();

                if (((electricalInfoItem != null) &&
                     this._parent.ElectricalInfos.Remove(electricalInfoItem)))
                {
                    return(true);
                }
                return(false);
            }
Пример #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)
            {
                if ((this._parent.ConductingEquipment == item))
                {
                    this._parent.ConductingEquipment = null;
                    return(true);
                }
                IElectricalInfo electricalInfoItem = item.As <IElectricalInfo>();

                if (((electricalInfoItem != null) &&
                     this._parent.ElectricalInfos.Remove(electricalInfoItem)))
                {
                    return(true);
                }
                return(false);
            }
Пример #4
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.ConductingEquipment == null))
                {
                    IConductingEquipment conductingEquipmentCasted = item.As <IConductingEquipment>();
                    if ((conductingEquipmentCasted != null))
                    {
                        this._parent.ConductingEquipment = conductingEquipmentCasted;
                        return;
                    }
                }
                IElectricalInfo electricalInfosCasted = item.As <IElectricalInfo>();

                if ((electricalInfosCasted != null))
                {
                    this._parent.ElectricalInfos.Add(electricalInfosCasted);
                }
            }