Example #1
0
        // 0 references
        //public void CopyTo(InventoryList dest, IEnumerable<TreeNodeAdv> nodesToCopy, int entryType)
        //{
        //    TreeNodeAdv[] nodes = nodesToCopy.ToArray();

        //    foreach (TreeNodeAdv node in nodes)
        //    {
        //        InventoryEntry old = node.GetEntry();
        //        // If the entry is null it is because the tag isn't an inventory
        //        // entry object.  That means it is a category node so don't duplicate
        //        // it.
        //        if (old == null)
        //            continue;

        //        InventoryEntry entry = new InventoryEntry(old);
        //        if (entry.Type == entryType || entryType == InventoryType.Any)
        //            dest.Add(entry);
        //    }
        //}
        // 0 references
        //public void Copy(IEnumerable<TreeNodeAdv> nodesToCopy, InventoryList dest)
        //{
        //    TreeNodeAdv[] nodes = nodesToCopy.ToArray();

        //    foreach (TreeNodeAdv node in nodes)
        //    {
        //        InventoryEntry old = node.GetEntry();
        //        // If the entry is null it is because the tag isn't an inventory
        //        // entry object.  That means it is a category node so don't duplicate
        //        // it.
        //        if (old == null)
        //            continue;

        //        InventoryEntry entry = new InventoryEntry(old);
        //        dest.Add(entry);
        //    }
        //}

        public void CopySelected(InventoryList dest, bool deleteSource)
        {
            TreeNodeAdv[] nodes = Tree.SelectedNodes.ToArray();

            Tree.BeginUpdate();
            foreach (TreeNodeAdv node in nodes)
            {
                InventoryEntry old = node.GetEntry();
                // If the entry is null it is because the tag isn't an inventory
                // entry object.  That means it is a category node so don't duplicate
                // it.
                if (old == null)
                {
                    continue;
                }

                InventoryEntry entry = new InventoryEntry(old);
                if (deleteSource == true)
                {
                    Remove(node, false);
                }
                dest.Add(entry);
            }
            Tree.EndUpdate();
        }
Example #2
0
 public void Add(InventoryEntry entry)
 {
     Unsorted.Add(entry);
     // Implicit event call to OnEntryAdd occurs here
 }