Пример #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)
            {
                if ((this._parent.TransmissionRightOfWay == null))
                {
                    ITransmissionRightOfWay transmissionRightOfWayCasted = item.As <ITransmissionRightOfWay>();
                    if ((transmissionRightOfWayCasted != null))
                    {
                        this._parent.TransmissionRightOfWay = transmissionRightOfWayCasted;
                        return;
                    }
                }
                IFlowgate flowgatesCasted = item.As <IFlowgate>();

                if ((flowgatesCasted != null))
                {
                    this._parent.Flowgates.Add(flowgatesCasted);
                }
                if ((this._parent.Region == null))
                {
                    ISubGeographicalRegion regionCasted = item.As <ISubGeographicalRegion>();
                    if ((regionCasted != null))
                    {
                        this._parent.Region = regionCasted;
                        return;
                    }
                }
            }
Пример #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)
            {
                ISubGeographicalRegion regionsCasted = item.As <ISubGeographicalRegion>();

                if ((regionsCasted != null))
                {
                    this._parent.Regions.Add(regionsCasted);
                }
            }
Пример #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)
            {
                ISubGeographicalRegion subGeographicalRegionItem = item.As <ISubGeographicalRegion>();

                if (((subGeographicalRegionItem != null) &&
                     this._parent.Regions.Remove(subGeographicalRegionItem)))
                {
                    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)
            {
                IBay baysCasted = item.As <IBay>();

                if ((baysCasted != null))
                {
                    this._parent.Bays.Add(baysCasted);
                }
                if ((this._parent.Region == null))
                {
                    ISubGeographicalRegion regionCasted = item.As <ISubGeographicalRegion>();
                    if ((regionCasted != null))
                    {
                        this._parent.Region = regionCasted;
                        return;
                    }
                }
                IVoltageLevel voltageLevelsCasted = item.As <IVoltageLevel>();

                if ((voltageLevelsCasted != null))
                {
                    this._parent.VoltageLevels.Add(voltageLevelsCasted);
                }
            }