コード例 #1
0
        private void ToolStripMenuItem_Insert_Click(object sender, EventArgs e)
        {
            int idx = toolStripComboBox_Index.SelectedIndex;

            if (idx < 0)
            {
                MessageBox.Show("请选择动作节点序号");
                return;
            }

            Type         methodType     = currNode.Tag as Type;
            string       dafaultNewName = _methodFlow.GetDefaultNameWillAddMethod(methodType);
            BenameDialog bnd            = new BenameDialog();

            bnd.Text = "新方法节点命名";
            bnd.SetName(dafaultNewName);
            if (DialogResult.OK != bnd.ShowDialog())
            {
                return;
            }
            IJFMethod newMethod = JFMethodFlow.CreateMethod(methodType.Name);
            bool      isOK      = _methodFlow.Insert(newMethod, idx, bnd.GetName());

            if (isOK)
            {
                ShowTips("插入动作节点成功!");
                UpdateFlow2UI();
            }
            else
            {
                MessageBox.Show("插入动作节点失败,请检查\n节点序号是否超限/动作名称是否已存在于流程中!");
                return;
            }
        }