Ejemplo n.º 1
0
        public void Remove(int productId)
        {
            var item = Items.SingleOrDefault(x => x.ProductId == productId);

            if (item == null)
            {
                return;
            }

            ItemsInternal.Remove(item);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Transfers the child node from current group node to another group node.
 /// </summary>
 /// <param name="targetGroup">The target group.</param>
 /// <param name="node">The node.</param>
 /// <returns></returns>
 public bool TransferChildNode(SceneNode node, GroupNodeBase targetGroup)
 {
     if (targetGroup == this || !itemHashSet.Remove(node.GUID))
     {
         return(false);
     }
     ItemsInternal.Remove(node);
     node.Parent = null;
     InvalidateSceneGraph();
     ChildNodeRemoved?.Invoke(this, new OnChildNodeChangedArgs(node, Operation.Remove));
     return(targetGroup.AddChildNode(node));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes the child node.
 /// </summary>
 /// <param name="node">The node.</param>
 /// <returns></returns>
 public virtual bool RemoveChildNode(SceneNode2D node)
 {
     if (itemHashSet.Remove(node.GUID))
     {
         node.Detach();
         ItemsInternal.Remove(node);
         node.Parent = null;
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Removes the child node.
 /// </summary>
 /// <param name="node">The node.</param>
 /// <returns></returns>
 public bool RemoveChildNode(SceneNode node)
 {
     if (node != null && itemHashSet.Remove(node.GUID))
     {
         node.Detach();
         ItemsInternal.Remove(node);
         node.Parent = null;
         ChildNodeRemoved?.Invoke(this, new OnChildNodeChangedArgs(node, Operation.Remove));
         return(true);
     }
     else
     {
         return(false);
     }
 }