Пример #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.LimitSet == null))
     {
         IAccumulatorLimitSet limitSetCasted = item.As <IAccumulatorLimitSet>();
         if ((limitSetCasted != null))
         {
             this._parent.LimitSet = limitSetCasted;
             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)
            {
                IAccumulatorValue accumulatorValuesCasted = item.As <IAccumulatorValue>();

                if ((accumulatorValuesCasted != null))
                {
                    this._parent.AccumulatorValues.Add(accumulatorValuesCasted);
                }
                IAccumulatorLimitSet limitSetsCasted = item.As <IAccumulatorLimitSet>();

                if ((limitSetsCasted != null))
                {
                    this._parent.LimitSets.Add(limitSetsCasted);
                }
            }
Пример #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)
            {
                IAccumulatorValue accumulatorValueItem = item.As <IAccumulatorValue>();

                if (((accumulatorValueItem != null) &&
                     this._parent.AccumulatorValues.Remove(accumulatorValueItem)))
                {
                    return(true);
                }
                IAccumulatorLimitSet accumulatorLimitSetItem = item.As <IAccumulatorLimitSet>();

                if (((accumulatorLimitSetItem != null) &&
                     this._parent.LimitSets.Remove(accumulatorLimitSetItem)))
                {
                    return(true);
                }
                return(false);
            }