Exemplo n.º 1
0
        public void InitFolderTree()
        {
            tvwLibraryFolders.BeginInit();
            tvwLibraryFolders.Items.Clear();
            tabMain.Cursor = Cursors.Wait;
            string[] vfs = Directory.GetFiles(ApplicationPaths.AppInitialDirPath,"*.vf");
            foreach (string vfName in vfs)
            {
                TreeViewItem dummyNode = new TreeViewItem();
                dummyNode.Header = new DummyTreeItem();

                TreeViewItem aNode = new TreeViewItem();
                LibraryFolder aFolder = new LibraryFolder(vfName);
                aNode.Header = aFolder;
                aNode.Items.Add(dummyNode);

                tvwLibraryFolders.Items.Add(aNode);
            }
            tvwLibraryFolders.EndInit();
            tabMain.Cursor = Cursors.Arrow;
        }
Exemplo n.º 2
0
        TreeViewItem addLibraryFolderNode(TreeViewItem parent, string dir)
        {
            if (parent.Dispatcher.CheckAccess()) {

                TreeViewItem aNode = new TreeViewItem();
                LibraryFolder aFolder = new LibraryFolder(dir);
                aNode.Header = aFolder;

                parent.Items.Add(aNode);

                return aNode;
            }
            else {
                parent.Dispatcher.Invoke(new AddLibraryFolderCB(this.addLibraryFolderNode), parent, dir);
                return null;
            }
        }