Example #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.ControlArea == null))
                {
                    IControlArea controlAreaCasted = item.As <IControlArea>();
                    if ((controlAreaCasted != null))
                    {
                        this._parent.ControlArea = controlAreaCasted;
                        return;
                    }
                }
                IAltGeneratingUnitMeas altGeneratingUnitMeasCasted = item.As <IAltGeneratingUnitMeas>();

                if ((altGeneratingUnitMeasCasted != null))
                {
                    this._parent.AltGeneratingUnitMeas.Add(altGeneratingUnitMeasCasted);
                }
                if ((this._parent.GeneratingUnit == null))
                {
                    IGeneratingUnit generatingUnitCasted = item.As <IGeneratingUnit>();
                    if ((generatingUnitCasted != null))
                    {
                        this._parent.GeneratingUnit = generatingUnitCasted;
                        return;
                    }
                }
            }
Example #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)
            {
                IServicePoint servicePointItem = item.As <IServicePoint>();

                if (((servicePointItem != null) &&
                     this._parent.ServicePoint.Remove(servicePointItem)))
                {
                    return(true);
                }
                IGeneratingUnit generatingUnitItem = item.As <IGeneratingUnit>();

                if (((generatingUnitItem != null) &&
                     this._parent.GeneratingUnits.Remove(generatingUnitItem)))
                {
                    return(true);
                }
                IEnergyProduct energyProductItem = item.As <IEnergyProduct>();

                if (((energyProductItem != null) &&
                     this._parent.EnergyProducts.Remove(energyProductItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #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)
            {
                ITieLine tieLineItem = item.As <ITieLine>();

                if (((tieLineItem != null) &&
                     this._parent.SideA_TieLines.Remove(tieLineItem)))
                {
                    return(true);
                }
                IGeneratingUnit generatingUnitItem = item.As <IGeneratingUnit>();

                if (((generatingUnitItem != null) &&
                     this._parent.GeneratingUnits.Remove(generatingUnitItem)))
                {
                    return(true);
                }
                IEnergyTransaction energyTransactionItem = item.As <IEnergyTransaction>();

                if (((energyTransactionItem != null) &&
                     this._parent.Export_EnergyTransactions.Remove(energyTransactionItem)))
                {
                    return(true);
                }
                if (((energyTransactionItem != null) &&
                     this._parent.Import_EnergyTransactions.Remove(energyTransactionItem)))
                {
                    return(true);
                }
                if ((this._parent.HostControlArea == item))
                {
                    this._parent.HostControlArea = null;
                    return(true);
                }
                IServicePoint servicePointItem = item.As <IServicePoint>();

                if (((servicePointItem != null) &&
                     this._parent.PartOf.Remove(servicePointItem)))
                {
                    return(true);
                }
                IFlowgate flowgateItem = item.As <IFlowgate>();

                if (((flowgateItem != null) &&
                     this._parent.Flowgate.Remove(flowgateItem)))
                {
                    return(true);
                }
                if (((tieLineItem != null) &&
                     this._parent.SideB_TieLines.Remove(tieLineItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #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)
            {
                ITieLine sideA_TieLinesCasted = item.As <ITieLine>();

                if ((sideA_TieLinesCasted != null))
                {
                    this._parent.SideA_TieLines.Add(sideA_TieLinesCasted);
                }
                IGeneratingUnit generatingUnitsCasted = item.As <IGeneratingUnit>();

                if ((generatingUnitsCasted != null))
                {
                    this._parent.GeneratingUnits.Add(generatingUnitsCasted);
                }
                IEnergyTransaction export_EnergyTransactionsCasted = item.As <IEnergyTransaction>();

                if ((export_EnergyTransactionsCasted != null))
                {
                    this._parent.Export_EnergyTransactions.Add(export_EnergyTransactionsCasted);
                }
                IEnergyTransaction import_EnergyTransactionsCasted = item.As <IEnergyTransaction>();

                if ((import_EnergyTransactionsCasted != null))
                {
                    this._parent.Import_EnergyTransactions.Add(import_EnergyTransactionsCasted);
                }
                if ((this._parent.HostControlArea == null))
                {
                    IHostControlArea hostControlAreaCasted = item.As <IHostControlArea>();
                    if ((hostControlAreaCasted != null))
                    {
                        this._parent.HostControlArea = hostControlAreaCasted;
                        return;
                    }
                }
                IServicePoint partOfCasted = item.As <IServicePoint>();

                if ((partOfCasted != null))
                {
                    this._parent.PartOf.Add(partOfCasted);
                }
                IFlowgate flowgateCasted = item.As <IFlowgate>();

                if ((flowgateCasted != null))
                {
                    this._parent.Flowgate.Add(flowgateCasted);
                }
                ITieLine sideB_TieLinesCasted = item.As <ITieLine>();

                if ((sideB_TieLinesCasted != null))
                {
                    this._parent.SideB_TieLines.Add(sideB_TieLinesCasted);
                }
            }
Example #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)
 {
     if ((this._parent.GeneratingUnit == null))
     {
         IGeneratingUnit generatingUnitCasted = item.As <IGeneratingUnit>();
         if ((generatingUnitCasted != null))
         {
             this._parent.GeneratingUnit = generatingUnitCasted;
             return;
         }
     }
 }
Example #6
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IServicePoint servicePointCasted = item.As <IServicePoint>();

                if ((servicePointCasted != null))
                {
                    this._parent.ServicePoint.Add(servicePointCasted);
                }
                IGeneratingUnit generatingUnitsCasted = item.As <IGeneratingUnit>();

                if ((generatingUnitsCasted != null))
                {
                    this._parent.GeneratingUnits.Add(generatingUnitsCasted);
                }
                IEnergyProduct energyProductsCasted = item.As <IEnergyProduct>();

                if ((energyProductsCasted != null))
                {
                    this._parent.EnergyProducts.Add(energyProductsCasted);
                }
            }