Example #1
0
 private void tlDirectory_VirtualTreeGetChildNodes(object sender, DevExpress.XtraTreeList.VirtualTreeGetChildNodesInfo e)
 {
     if (!loadDrives)
     { // create drives
         //string[] root = Directory.GetLogicalDrives();
         string[] root = { pathDrive };
         e.Children = root;
         loadDrives = true;
     }
     else
     {
         try
         {
             string path = (string)e.Node;
             if (Directory.Exists(path))
             {
                 string[] dirs  = Directory.GetDirectories(path);
                 string[] files = Directory.GetFiles(path, "*.exe");
                 string[] arr   = new string[dirs.Length + files.Length];
                 dirs.CopyTo(arr, 0);
                 files.CopyTo(arr, dirs.Length);
                 e.Children = arr;
             }
             else
             {
                 e.Children = new object[] { }
             };
         }
         catch { e.Children = new object[] { }; }
     }
 }
Example #2
0
        private void treeListpaper_VirtualTreeGetChildNodes(object sender, DevExpress.XtraTreeList.VirtualTreeGetChildNodesInfo e)
        {
            Cursor current = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;
            if (!loadDrives)
            {
                if (Connect(serverFilePath))
                {
                    string[] roots;
                    if (txtpapermaterialcode.Text.Trim() == "")
                    {
                        roots = new string[1] {
                            "\\\\192.168.0.204\\FilePath$\\图纸归档库 "
                        };                                                                   //////  \制程异常处理报告\18045079-W
                    }
                    else
                    {
                        roots = new string[1] {
                            "\\\\192.168.0.204\\FilePath$\\图纸归档库\\" + txtpapermaterialcode.Text
                        };
                    }

                    e.Children      = roots;
                    loadDrives      = true;
                    lblmessage.Text = "";
                }
                else
                {
                    //MessageBox.Show("无法连接到服务器的共享目录");
                    lblmessage.Text = "无法连接到服务器的共享目录";
                }
            }
            else
            {
                try
                {
                    string path = (string)e.Node;
                    if (Directory.Exists(path))
                    {
                        string[] dirs  = Directory.GetDirectories(path);
                        string[] files = Directory.GetFiles(path);
                        string[] arr   = new string[dirs.Length + files.Length];
                        dirs.CopyTo(arr, 0);
                        files.CopyTo(arr, dirs.Length);
                        e.Children = arr;
                    }
                    else
                    {
                        e.Children = new object[] { }
                    };
                }
                catch
                {
                    e.Children = new object[] { };
                }
            }
            Cursor.Current = current;
        }
Example #3
0
 private void trlCRTree_VirtualTreeGetChildNodes(object sender, DevExpress.XtraTreeList.VirtualTreeGetChildNodesInfo e)
 {
     if (e.Node is QChangeRequest)
     {
         e.Children = ((QChangeRequest)e.Node).Children;
     }
     else if (e.Node is object)
     {
         e.Children = docCR.CRTree;
     }
 }
Example #4
0
 private void treeList1_VirtualTreeGetChildNodes(object sender,
                                                 DevExpress.XtraTreeList.VirtualTreeGetChildNodesInfo e)
 {
     if (e.Node.GetType() == typeof(Topology))
     {
         e.Children = ((Topology)e.Node).Components;
     }
     else if (e.Node.GetType() == typeof(Component))
     {
         e.Children = ((Component)e.Node).Sub_components;
     }
 }
Example #5
0
        private void treeList1_VirtualTreeGetChildNodes(object sender, DevExpress.XtraTreeList.VirtualTreeGetChildNodesInfo e)
        {
            Cursor current = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;
            if (!loadDrives)
            {
                string[] roots = Directory.GetLogicalDrives();
                e.Children = roots;
                loadDrives = true;
            }
            else
            {
                try
                {
                    string path = startupDrive;
                    if (e.Node is string node)
                    {
                        path = node;
                    }

                    if (Directory.Exists(path))
                    {
                        string[] dirs  = Directory.GetDirectories(path);
                        string[] files = Directory.GetFiles(path);
                        string[] arr   = new string[dirs.Length + files.Length];
                        dirs.CopyTo(arr, 0);
                        files.CopyTo(arr, dirs.Length);
                        e.Children = arr;
                    }
                    else
                    {
                        e.Children = new object[] { };
                    }
                }
                catch { e.Children = new object[] { }; }
            }
            Cursor.Current = current;
        }
Example #6
0
        public void VirtualTreeGetChildNodes(DevExpress.XtraTreeList.VirtualTreeGetChildNodesInfo info)
        {
            NovelChapter nc = info.Node as NovelChapter;

            info.Children = nc.NovelChapters;
        }