Ejemplo 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)
            {
                ICircuit circuitItem = item.As <ICircuit>();

                if (((circuitItem != null) &&
                     this._parent.Circuits.Remove(circuitItem)))
                {
                    return(true);
                }
                INetworkDataSet networkDataSetItem = item.As <INetworkDataSet>();

                if (((networkDataSetItem != null) &&
                     this._parent.NetworkDataSets.Remove(networkDataSetItem)))
                {
                    return(true);
                }
                IPowerSystemResource powerSystemResourceItem = item.As <IPowerSystemResource>();

                if (((powerSystemResourceItem != null) &&
                     this._parent.PowerSystemResources.Remove(powerSystemResourceItem)))
                {
                    return(true);
                }
                IConductorAsset conductorAssetItem = item.As <IConductorAsset>();

                if (((conductorAssetItem != null) &&
                     this._parent.ConductorAssets.Remove(conductorAssetItem)))
                {
                    return(true);
                }
                return(false);
            }
Ejemplo n.º 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)
            {
                if ((this._parent.PhaseImpedance == item))
                {
                    this._parent.PhaseImpedance = null;
                    return(true);
                }
                IConductorAsset conductorAssetItem = item.As <IConductorAsset>();

                if (((conductorAssetItem != null) &&
                     this._parent.ConductorAssets.Remove(conductorAssetItem)))
                {
                    return(true);
                }
                if ((this._parent.SequenceImpedance == item))
                {
                    this._parent.SequenceImpedance = null;
                    return(true);
                }
                if ((this._parent.ConductorInfo == item))
                {
                    this._parent.ConductorInfo = null;
                    return(true);
                }
                return(false);
            }
Ejemplo 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)
            {
                ICircuit circuitsCasted = item.As <ICircuit>();

                if ((circuitsCasted != null))
                {
                    this._parent.Circuits.Add(circuitsCasted);
                }
                INetworkDataSet networkDataSetsCasted = item.As <INetworkDataSet>();

                if ((networkDataSetsCasted != null))
                {
                    this._parent.NetworkDataSets.Add(networkDataSetsCasted);
                }
                IPowerSystemResource powerSystemResourcesCasted = item.As <IPowerSystemResource>();

                if ((powerSystemResourcesCasted != null))
                {
                    this._parent.PowerSystemResources.Add(powerSystemResourcesCasted);
                }
                IConductorAsset conductorAssetsCasted = item.As <IConductorAsset>();

                if ((conductorAssetsCasted != null))
                {
                    this._parent.ConductorAssets.Add(conductorAssetsCasted);
                }
            }
Ejemplo n.º 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.PhaseImpedance == null))
                {
                    IPerLengthPhaseImpedance phaseImpedanceCasted = item.As <IPerLengthPhaseImpedance>();
                    if ((phaseImpedanceCasted != null))
                    {
                        this._parent.PhaseImpedance = phaseImpedanceCasted;
                        return;
                    }
                }
                IConductorAsset conductorAssetsCasted = item.As <IConductorAsset>();

                if ((conductorAssetsCasted != null))
                {
                    this._parent.ConductorAssets.Add(conductorAssetsCasted);
                }
                if ((this._parent.SequenceImpedance == null))
                {
                    IPerLengthSequenceImpedance sequenceImpedanceCasted = item.As <IPerLengthSequenceImpedance>();
                    if ((sequenceImpedanceCasted != null))
                    {
                        this._parent.SequenceImpedance = sequenceImpedanceCasted;
                        return;
                    }
                }
                if ((this._parent.ConductorInfo == null))
                {
                    IConductorInfo conductorInfoCasted = item.As <IConductorInfo>();
                    if ((conductorInfoCasted != null))
                    {
                        this._parent.ConductorInfo = conductorInfoCasted;
                        return;
                    }
                }
            }