Esempio n. 1
0
 public SaveProgramFinisherMouseClick(FilesTreeView ftv, TextBox textTypeName, TextBox textPrjName, CheckBox cb, Func <bool> isDir, Button btn)
 /*end hucheng 20160301*/
 {
     this.ftv          = ftv;
     this.textPrjName  = textPrjName;
     this.textTypeName = textTypeName;
     /*begin hucheng 20160301*/
     this.cb    = cb;
     this.isDir = isDir;
     this.btn   = btn;
     /*end hucheng 20160301*/
 }
Esempio n. 2
0
        /// <summary>
        /// 构造树
        /// </summary>
        /// <param name="dirpath"></param>
        /// <param name="trv"></param>
        /// <returns></returns>
        public int ShowTree(string dirpath, FilesTreeView trv, List <string> fileList = null, bool showSub = true)
        {
            if (!Directory.Exists(dirpath))
            {
                return(-1);
            }
            ///构造树,并添加到ZTreeView 中
            trv.ClearAll();
            if (dirpath.EndsWith("\\"))
            {
                dirpath = dirpath.Remove(dirpath.Length - 1);
            }
            TreeNode root = new TreeNode(dirpath);

            trv.BuildPrjTree(root, dirpath, ".txt", null, fileList, showSub);
            trv.AddNode(root);
            root.Expand();
            return(0);
        }
Esempio n. 3
0
        public int ShowTree(string dirpath, FilesTreeView trv, TextBox tb, TextBox tbs)
        {
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            dialog.ShowDialog();
            tb.Text = dialog.SelectedPath;
            if (!Directory.Exists(tb.Text))
            {
                return(-1);
            }
            ///构造树,并添加到ZTreeView 中
            trv.ClearAll();
            TreeNode root = new TreeNode(tb.Text);

            dialog.Dispose();
            trv.BuildPrjTree(root, tb.Text, ".txt", null);
            trv.AddNode(root);
            if (root.FirstNode == null) ///是个空目录
            {
                root.Nodes.Add("");
            }
            root.Expand();
            return(0);
        }