Beispiel #1
0
        private void btnVisitJs_Click(object sender, EventArgs e)
        {
            try
            {
                int    charaNum = Convert.ToInt16(txtCharaNumber.Text.Trim());
                double initX    = Convert.ToDouble(txtInitX.Text.Trim());
                double initY    = Convert.ToDouble(txtInitY.Text.Trim());
                double endX     = Convert.ToDouble(txtEndX.Text.Trim());
                double endY     = Convert.ToDouble(txtEndY.Text.Trim());

                visitJs = new JSengin(txtFolderName.Text.Trim(), charaNum, new EndPoint(initX, initY), new EndPoint(endX, endY));

                FillTreeView(visitJs);
            }
            catch (Exception ex)
            {
                new ShowException(ex.Message);
            }
        }
Beispiel #2
0
        private void FillTreeView(JSengin JS)
        {
            this.treeView1.Nodes.Clear();
            int SumModelNum = 0;

            try
            {
                //将获取的JS模型灌入TreeView
                this.treeView1.LabelEdit        = true;
                this.treeView1.ShowNodeToolTips = true;
                foreach (string strPath in JS.SubJsPaths)
                {
                    TreeNode      node    = new TreeNode();
                    List <string> jsfiles = new List <string>();
                    jsfiles = JS.JsFiles[JS.SubJsPaths.IndexOf(strPath)];
                    List <Model> models = new List <Model>();
                    models = JS.ModelsSet[JS.SubJsPaths.IndexOf(strPath)];
                    //foreach (string strfile in jsfiles)
                    foreach (Model mo in models)
                    {
                        TreeNode nf = new TreeNode();
                        nf.Text        = mo.modelName;
                        nf.ToolTipText = mo.modelNotes;
                        node.Nodes.Add(nf);
                    }
                    node.Text        = Path.GetFileNameWithoutExtension(strPath);
                    node.ToolTipText = strPath + "\n共" + node.GetNodeCount(true).ToString() + "个模型";
                    this.treeView1.Nodes.Add(node);
                    SumModelNum += node.GetNodeCount(true);
                }
                this.lblSumModelNUM.Text = "按" + txtCharaNumber.Text + "个特征粒度,共成功导入" + SumModelNum.ToString() + "个模型";
            }
            catch (Exception ex)
            {
                new ShowException(ex.Message);
            }
        }