示例#1
0
        /// <summary>
        /// 添加一个方法对象到动作流中
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolStripMenuItem_Add_Click(object sender, EventArgs e)
        {
            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.Add(newMethod, bnd.GetName());

            if (isOK)
            {
                ToolStripMenuItem_Insert.Enabled = true;
                ShowTips("添加动作节点成功!");
                UpdateFlow2UI();
            }
            else
            {
                MessageBox.Show("添加动作节点失败,请检查动作名称是否已存在于流程中!");
                return;
            }
        }