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)
            {
                IEnumerationLiteral ownedLiteralCasted = item.As <IEnumerationLiteral>();

                if ((ownedLiteralCasted != null))
                {
                    this._parent.OwnedLiteral.Add(ownedLiteralCasted);
                }
            }
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)
            {
                IEnumerationLiteral enumerationLiteralItem = item.As <IEnumerationLiteral>();

                if (((enumerationLiteralItem != null) &&
                     this._parent.OwnedLiteral.Remove(enumerationLiteralItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #3
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.ReferredEnumLiteral == null))
     {
         IEnumerationLiteral referredEnumLiteralCasted = item.As <IEnumerationLiteral>();
         if ((referredEnumLiteralCasted != null))
         {
             this._parent.ReferredEnumLiteral = referredEnumLiteralCasted;
             return;
         }
     }
 }