private void btnEdit_Click(object sender, EventArgs e)
        {
            CoreEnvelopeArithmeticOperForm form = new CoreEnvelopeArithmeticOperForm("edit", selNode);

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            WeightParameter.GetWeightParameterList()[10].Clear();
        }
        private void btnJYNew_Click(object sender, EventArgs e)
        {
            CoreEnvelopeArithmeticOperForm form = new CoreEnvelopeArithmeticOperForm("jynew", selNode);

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            TreeNode node = treeViewArithmeticList.Nodes[0];

            string key = "CenterofGravityEnvelopeMethod\\" + form.strCoreEnvelopeArithmeticFileName + ".mcem";

            if (!node.Nodes.ContainsKey(key))
            {
                node.Nodes.Add(key, form.strCoreEnvelopeArithmeticFileName, 4, 5);
            }
            if (node.IsExpanded == false)
            {
                node.Expand();
            }

            WeightParameter.GetWeightParameterList()[10].Clear();
        }
        private void btnImport_Click(object sender, EventArgs e)
        {
            try
            {
                System.Windows.Forms.OpenFileDialog dlg = new OpenFileDialog();
                dlg.RestoreDirectory = true;
                dlg.Filter           = "Mcem files (*.mcem)|*.mcem";
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                CoreEnvelopeArithmetic cea = CoreEnvelopeArithmetic.ReadArithmeticData(dlg.FileName);;
                if (cea == null)
                {
                    return;
                }

                bool boverwrite = false;

                TreeNode node = treeViewArithmeticList.Nodes[0];

                while (true)
                {
                    bool binclude = false;
                    foreach (TreeNode subnode in node.Nodes)
                    {
                        if (subnode.Text == cea.Name)
                        {
                            binclude = true;
                            break;
                        }
                    }
                    if (binclude)
                    {
                        DialogResult dr = MessageBox.Show("已有该算法,是否重命名?\r\n选\"否\"的话将覆盖现有算法。\r\n选\"取消\"则停止导入。", "该算法已存在", MessageBoxButtons.YesNoCancel);
                        if (dr == DialogResult.Yes)
                        {
                            string sortname = Microsoft.VisualBasic.Interaction.InputBox("请输入新的算法名称:", "输入新的算法名称", cea.Name, -1, -1);
                            sortname = sortname.Trim();
                            if (sortname == "")
                            {
                                return;
                            }

                            cea.Name = sortname;
                        }
                        else if (dr == DialogResult.Cancel)
                        {
                            return;
                        }
                        else
                        {
                            boverwrite = true;
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }


                if (CoreEnvelopeArithmeticOperForm.WriteArithmeticFile(cea, false))
                {
                    if (!boverwrite)
                    {
                        node.Nodes.Add("CenterofGravityEnvelopeMethod\\" + cea.Name + ".mcem", cea.Name, 4, 5);
                    }
                }

                XCommon.XLog.Write("成功导入算法\"" + cea.Name + "\"!");
            }
            catch (Exception ex)
            {
                XCommon.XLog.Write("导入重心包线算法文件错误." + ex.Message);
            }
        }
        private void btnNew_Click(object sender, EventArgs e)
        {
            CoreEnvelopeArithmeticOperForm form = new CoreEnvelopeArithmeticOperForm("new", selNode);
            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            TreeNode node = treeViewArithmeticList.Nodes[0];

            string key = "CenterofGravityEnvelopeMethod\\" + form.strCoreEnvelopeArithmeticFileName + ".mcem";
            if (!node.Nodes.ContainsKey(key))
            {
                node.Nodes.Add(key, form.strCoreEnvelopeArithmeticFileName, 4, 5);
            }
            if (node.IsExpanded == false)
            {
                node.Expand();
            }

            ParaData.GetWeightParameterList()[10].Clear();
        }
 private void btnEdit_Click(object sender, EventArgs e)
 {
     CoreEnvelopeArithmeticOperForm form = new CoreEnvelopeArithmeticOperForm("edit", selNode);
     if (form.ShowDialog() != DialogResult.OK)
     {
         return;
     }
     ParaData.GetWeightParameterList()[10].Clear();
 }