protected void OnRemoved(ItemActionEventArgs e)
 {
     EventHandler<ItemActionEventArgs> handler = ItemRemoved;
     if (handler != null) handler(this, e);
 }
 protected void OnRemoving(ItemActionEventArgs e)
 {
     if (ItemRemoving != null)
     {
         ItemRemoving(this, e);
     }
 }
 public virtual void TryRemoveItem(EntityObject item)
 {
     var args = new ItemActionEventArgs(item);
     OnRemoving(args);
     if (!args.Cancel)
     {
         Items.Remove(item);
         OnRemoved(args);
     }
 }