Beispiel #1
0
        public void OnEntryRemoveNode(InventoryList ilist, TreeNodeAdv node)
        {
            InventoryEntry entry = node.GetEntry();

            Sorted.Remove(entry);
            RemoveFromTreeView(node, false);
        }
Beispiel #2
0
 public void OnSortModeChanged(InventoryList ilist, IComparer <InventoryEntry> comparer)
 {
     if (comparer == null)
     {
         NextSort();
     }
 }
Beispiel #3
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();
        }
Beispiel #4
0
        public void OnListReload(InventoryList ilist)
        {
            Sorted.Clear();
            ClearTreeView();

            Sorted.AddRange(Unsorted.Items.Values);
            SortByCustom();
        }
Beispiel #5
0
        public InventoryTreeList(WTTreeView tree, InventoryList ilist)
        {
            this.Unsorted         = ilist;
            this.Sorted           = new List <InventoryEntry>();
            this.Tree             = tree;
            this.NavigationLayers = 1;

            Unsorted.EntryAdd          += OnEntryAdd;
            Unsorted.EntryRemove       += OnEntryRemove;
            Unsorted.EntryRemoveNode   += OnEntryRemoveNode;
            Unsorted.ListReload        += OnListReload;
            Unsorted.NameFormatChanged += OnNameFormatChanged;
            Unsorted.TreeThemeChanged  += OnTreeThemeChanged;
            //Unsorted.NavigationDepthChanged += OnNavigationDepthChanged;
            //Unsorted.SortModeChanged += OnSortModeChanged;
        }
Beispiel #6
0
 public void OnTreeThemeChanged(InventoryList ilist, TreeViewTheme theme)
 {
     Tree.Theme = theme;
 }
Beispiel #7
0
 public void OnNavigationDepthChanged(InventoryList ilist, int depth)
 {
 }
Beispiel #8
0
 public void OnNameFormatChanged(InventoryList ilist)
 {
     UpdateNames();
 }
Beispiel #9
0
 public void OnEntryRemove(InventoryList ilist, InventoryEntry entry)
 {
     Sorted.Remove(entry);
     RemoveFromTreeView(entry, false);
 }
Beispiel #10
0
 public void OnEntryAdd(InventoryList ilist, InventoryEntry entry)
 {
     Sorted.Add(entry);
     AddToTreeView(entry);
 }