Exemplo n.º 1
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)
            {
                ITopologicalNode topologicalNodeItem = item.As <ITopologicalNode>();

                if (((topologicalNodeItem != null) &&
                     this._parent.TopologicalNode.Remove(topologicalNodeItem)))
                {
                    return(true);
                }
                IVoltageLevel voltageLevelItem = item.As <IVoltageLevel>();

                if (((voltageLevelItem != null) &&
                     this._parent.VoltageLevel.Remove(voltageLevelItem)))
                {
                    return(true);
                }
                IConductingEquipment conductingEquipmentItem = item.As <IConductingEquipment>();

                if (((conductingEquipmentItem != null) &&
                     this._parent.ConductingEquipment.Remove(conductingEquipmentItem)))
                {
                    return(true);
                }
                return(false);
            }
Exemplo 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)
 {
     if ((this._parent.VoltageLevel == null))
     {
         IVoltageLevel voltageLevelCasted = item.As <IVoltageLevel>();
         if ((voltageLevelCasted != null))
         {
             this._parent.VoltageLevel = voltageLevelCasted;
             return;
         }
     }
     if ((this._parent.Substation == null))
     {
         ISubstation substationCasted = item.As <ISubstation>();
         if ((substationCasted != null))
         {
             this._parent.Substation = substationCasted;
             return;
         }
     }
 }
Exemplo n.º 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)
            {
                ITopologicalNode topologicalNodeCasted = item.As <ITopologicalNode>();

                if ((topologicalNodeCasted != null))
                {
                    this._parent.TopologicalNode.Add(topologicalNodeCasted);
                }
                IVoltageLevel voltageLevelCasted = item.As <IVoltageLevel>();

                if ((voltageLevelCasted != null))
                {
                    this._parent.VoltageLevel.Add(voltageLevelCasted);
                }
                IConductingEquipment conductingEquipmentCasted = item.As <IConductingEquipment>();

                if ((conductingEquipmentCasted != null))
                {
                    this._parent.ConductingEquipment.Add(conductingEquipmentCasted);
                }
            }
Exemplo 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)
            {
                IBay bayItem = item.As <IBay>();

                if (((bayItem != null) &&
                     this._parent.Bays.Remove(bayItem)))
                {
                    return(true);
                }
                if ((this._parent.Region == item))
                {
                    this._parent.Region = null;
                    return(true);
                }
                IVoltageLevel voltageLevelItem = item.As <IVoltageLevel>();

                if (((voltageLevelItem != null) &&
                     this._parent.VoltageLevels.Remove(voltageLevelItem)))
                {
                    return(true);
                }
                return(false);
            }
Exemplo n.º 5
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);
                }
            }