Beispiel #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)
 {
     BikeShop.BicycleChallenge.IComponent componentsCasted = item.As <BikeShop.BicycleChallenge.IComponent>();
     if ((componentsCasted != null))
     {
         this._parent.Components.Add(componentsCasted);
     }
 }
Beispiel #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)
 {
     BikeShop.BicycleChallenge.IComponent componentItem = item.As <BikeShop.BicycleChallenge.IComponent>();
     if (((componentItem != null) &&
          this._parent.Components.Remove(componentItem)))
     {
         return(true);
     }
     return(false);
 }