Exemplo n.º 1
0
        /// <summary>
        /// 一键选择文件夹
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OneKey_Click(object sender, EventArgs e)
        {
            //弹出文件夹选择框
            FolderBrowserDialog fbd = new FolderBrowserDialog
            {
                Description         = @"选取Ros/Roi/Roc文件的父层文件夹",
                ShowNewFolderButton = false
            };

            if (fbd.ShowDialog() == DialogResult.OK || fbd.ShowDialog() == DialogResult.Yes)
            {
                ComArgs.GuiUsePath = new GuiUsePath
                {
                    RosPath = $"{fbd.SelectedPath}/Scripts",
                    RoiPath = $"{fbd.SelectedPath}/UIMaps",
                    RocPath = $"{fbd.SelectedPath}/Config"
                };
                GetAllRosFile getAllRosFile = new GetAllRosFile(ComArgs.GuiUsePath.RosPath);
                RosTree.Nodes.Add(getAllRosFile.RootNode);
                RosTree.ExpandAll();                                     //全展开
                CheckTreeView.CheckAllTreeNodes(getAllRosFile.RootNode); //默认全部勾选
            }
            else
            {
                MessageBox.Show(@"没有选择测试脚本文件", @"警告");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 选择文件
        /// ROS/ROC/ROI三类
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectFile_Click(object sender, EventArgs e)
        {
            ComArgs.RoLog.WriteLog(LogStatus.LInfo, "准备勾选ros/roi/roc文件夹...");
            SelectFiles selectFiles = new SelectFiles();

            selectFiles.ShowDialog(); //执行完毕后,再更新rostree
            if (ComArgs.GuiUsePath.RosPath != Empty)
            {
                GetAllRosFile getAllRosFile = new GetAllRosFile(ComArgs.GuiUsePath.RosPath);
                RosTree.Nodes.Add(getAllRosFile.RootNode);
                RosTree.ExpandAll();                                     //全展开
                CheckTreeView.CheckAllTreeNodes(getAllRosFile.RootNode); //默认全部勾选
            }
            else
            {
                MessageBox.Show(@"请选择正确的路径", @"警告");
            }
        }