Ejemplo n.º 1
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(NMF.Models.IModelElement item)
 {
     NMF.Models.Meta.IEvent eventsCasted = item.As <NMF.Models.Meta.IEvent>();
     if ((eventsCasted != null))
     {
         this._parent.Events.Add(eventsCasted);
     }
     NMF.Models.Meta.IReference referencesCasted = item.As <NMF.Models.Meta.IReference>();
     if ((referencesCasted != null))
     {
         this._parent.References.Add(referencesCasted);
     }
 }
Ejemplo n.º 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(NMF.Models.IModelElement item)
 {
     NMF.Models.Meta.IEvent eventItem = item.As <NMF.Models.Meta.IEvent>();
     if (((eventItem != null) &&
          this._parent.Events.Remove(eventItem)))
     {
         return(true);
     }
     NMF.Models.Meta.IReference referenceItem = item.As <NMF.Models.Meta.IReference>();
     if (((referenceItem != null) &&
          this._parent.References.Remove(referenceItem)))
     {
         return(true);
     }
     return(false);
 }