コード例 #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)
            {
                IAPC aPCCasted = item.As <IAPC>();

                if ((aPCCasted != null))
                {
                    this._parent.APC.Add(aPCCasted);
                }
                IC_PrimitiveCDC c_PrimitiveCDCCasted = item.As <IC_PrimitiveCDC>();

                if ((c_PrimitiveCDCCasted != null))
                {
                    this._parent.C_PrimitiveCDC.Add(c_PrimitiveCDCCasted);
                }
            }
コード例 #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.Loc == null))
     {
         ISPS locCasted = item.As <ISPS>();
         if ((locCasted != null))
         {
             this._parent.Loc = locCasted;
             return;
         }
     }
     if ((this._parent.OpTmh == null))
     {
         IINS opTmhCasted = item.As <IINS>();
         if ((opTmhCasted != null))
         {
             this._parent.OpTmh = opTmhCasted;
             return;
         }
     }
     if ((this._parent.ECA == null))
     {
         IMV eCACasted = item.As <IMV>();
         if ((eCACasted != null))
         {
             this._parent.ECA = eCACasted;
             return;
         }
     }
     if ((this._parent.ColTapPos == null))
     {
         IISC colTapPosCasted = item.As <IISC>();
         if ((colTapPosCasted != null))
         {
             this._parent.ColTapPos = colTapPosCasted;
             return;
         }
     }
     if ((this._parent.ColPos == null))
     {
         IAPC colPosCasted = item.As <IAPC>();
         if ((colPosCasted != null))
         {
             this._parent.ColPos = colPosCasted;
             return;
         }
     }
 }
コード例 #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)
            {
                IAPC aPCItem = item.As <IAPC>();

                if (((aPCItem != null) &&
                     this._parent.APC.Remove(aPCItem)))
                {
                    return(true);
                }
                IC_PrimitiveCDC c_PrimitiveCDCItem = item.As <IC_PrimitiveCDC>();

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