public static void IssueOnAddElement(FolderTreeElement element)
 {
     if (OnAddElement != null)
     {
         OnAddElement.Invoke(element);
     }
 }
Esempio n. 2
0
 private static void DeleteChildren(FolderManagerInputInfo inputInfo, FolderTreeElement element)
 {
     if (element.HasChildren)
     {
         foreach (var treeElement in element.Children)
         {
             var el = treeElement as FolderTreeElement;
             inputInfo.FolderTreeState.Cache.FolderTree.RemoveElement(el);
             DeleteChildren(inputInfo, el);
         }
     }
     else
     {
         inputInfo.FolderTreeState.Cache.FolderTree.RemoveElement(element);
     }
     FolderManagerCallbacks.IssueOnDeleteElement(element);
 }
Esempio n. 3
0
        private static void CreateContextCallback(object userData)
        {
            var inputInfo = userData as FolderManagerInputInfo;

            if (inputInfo != null)
            {
                var sortedList = inputInfo.FolderTreeState.Cache.FolderTree.TreeElements;
                sortedList.Sort((e1, e2) => e1.Id.CompareTo(e2.Id));
                var lastID = sortedList[sortedList.Count - 1].Id + 1;

                var element = new FolderTreeElement("Folder Name", 0, lastID);
                inputInfo.FolderTreeState.Cache.FolderTree.AddElement(element);

                FolderManagerCallbacks.IssueOnAddElement(element);
            }
            FolderManager.RepaintClients();
        }
Esempio n. 4
0
 public void RemoveElement(FolderTreeElement element)
 {
     TreeElements.Remove(element);
 }
Esempio n. 5
0
        public void AddElement(string name, int depth, int id)
        {
            var element = new FolderTreeElement(name, depth, id);

            TreeElements.Add(element);
        }
Esempio n. 6
0
 public void AddElement(FolderTreeElement element)
 {
     TreeElements.Add(element);
 }