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

                if ((baysCasted != null))
                {
                    this._parent.Bays.Add(baysCasted);
                }
                if ((this._parent.BaseVoltage == null))
                {
                    IBaseVoltage baseVoltageCasted = item.As <IBaseVoltage>();
                    if ((baseVoltageCasted != null))
                    {
                        this._parent.BaseVoltage = baseVoltageCasted;
                        return;
                    }
                }
                if ((this._parent.Substation == null))
                {
                    ISubstation substationCasted = item.As <ISubstation>();
                    if ((substationCasted != null))
                    {
                        this._parent.Substation = substationCasted;
                        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)
            {
                IProtectionEquipment protectionEquipmentsCasted = item.As <IProtectionEquipment>();

                if ((protectionEquipmentsCasted != null))
                {
                    this._parent.ProtectionEquipments.Add(protectionEquipmentsCasted);
                }
                IOutageStepPsrRole outageStepRolesCasted = item.As <IOutageStepPsrRole>();

                if ((outageStepRolesCasted != null))
                {
                    this._parent.OutageStepRoles.Add(outageStepRolesCasted);
                }
                if ((this._parent.BaseVoltage == null))
                {
                    IBaseVoltage baseVoltageCasted = item.As <IBaseVoltage>();
                    if ((baseVoltageCasted != null))
                    {
                        this._parent.BaseVoltage = baseVoltageCasted;
                        return;
                    }
                }
                IClearanceTag clearanceTagsCasted = item.As <IClearanceTag>();

                if ((clearanceTagsCasted != null))
                {
                    this._parent.ClearanceTags.Add(clearanceTagsCasted);
                }
                if ((this._parent.SvStatus == null))
                {
                    ISvStatus svStatusCasted = item.As <ISvStatus>();
                    if ((svStatusCasted != null))
                    {
                        this._parent.SvStatus = svStatusCasted;
                        return;
                    }
                }
                IElectricalAsset electricalAssetsCasted = item.As <IElectricalAsset>();

                if ((electricalAssetsCasted != null))
                {
                    this._parent.ElectricalAssets.Add(electricalAssetsCasted);
                }
                ITerminal terminalsCasted = item.As <ITerminal>();

                if ((terminalsCasted != null))
                {
                    this._parent.Terminals.Add(terminalsCasted);
                }
            }