Esempio n. 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.AnalogValue == null))
     {
         IAnalogValue analogValueCasted = item.As <IAnalogValue>();
         if ((analogValueCasted != null))
         {
             this._parent.AnalogValue = analogValueCasted;
             return;
         }
     }
     if ((this._parent.TieFlow == null))
     {
         ITieFlow tieFlowCasted = item.As <ITieFlow>();
         if ((tieFlowCasted != null))
         {
             this._parent.TieFlow = tieFlowCasted;
             return;
         }
     }
 }
Esempio 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.ControlAreaGeneratingUnit == null))
     {
         IControlAreaGeneratingUnit controlAreaGeneratingUnitCasted = item.As <IControlAreaGeneratingUnit>();
         if ((controlAreaGeneratingUnitCasted != null))
         {
             this._parent.ControlAreaGeneratingUnit = controlAreaGeneratingUnitCasted;
             return;
         }
     }
     if ((this._parent.AnalogValue == null))
     {
         IAnalogValue analogValueCasted = item.As <IAnalogValue>();
         if ((analogValueCasted != null))
         {
             this._parent.AnalogValue = analogValueCasted;
             return;
         }
     }
 }
Esempio n. 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)
            {
                IAnalogLimitSet analogLimitSetItem = item.As <IAnalogLimitSet>();

                if (((analogLimitSetItem != null) &&
                     this._parent.LimitSets.Remove(analogLimitSetItem)))
                {
                    return(true);
                }
                if ((this._parent.SetPoint == item))
                {
                    this._parent.SetPoint = null;
                    return(true);
                }
                IAnalogValue analogValueItem = item.As <IAnalogValue>();

                if (((analogValueItem != null) &&
                     this._parent.AnalogValues.Remove(analogValueItem)))
                {
                    return(true);
                }
                return(false);
            }
Esempio 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)
            {
                IAnalogLimitSet limitSetsCasted = item.As <IAnalogLimitSet>();

                if ((limitSetsCasted != null))
                {
                    this._parent.LimitSets.Add(limitSetsCasted);
                }
                if ((this._parent.SetPoint == null))
                {
                    ISetPoint setPointCasted = item.As <ISetPoint>();
                    if ((setPointCasted != null))
                    {
                        this._parent.SetPoint = setPointCasted;
                        return;
                    }
                }
                IAnalogValue analogValuesCasted = item.As <IAnalogValue>();

                if ((analogValuesCasted != null))
                {
                    this._parent.AnalogValues.Add(analogValuesCasted);
                }
            }