예제 #1
0
        private AdminCmd GetCmd()
        {
            // 执行
            TreeNode node = adminTreeView.SelectedNode;

            if (node == null)
            {
                return(null);
            }
            AdminCmd cmd = (AdminCmd)node.Tag;

            if (cmd == null)
            {
                WriteLog("请先选中一条指令");
                return(null);
            }

            // 回填数据
            for (int i = 0; i < argsPanel.Controls.Count; ++i)
            {
                ArgBox box = (ArgBox)argsPanel.Controls[i];
                if (!box.Visible)
                {
                    break;
                }
                AdminArg arg = (AdminArg)box.Tag;
                arg.Data = box.ArgData;
                if (arg.AddItem(arg.Data))
                {
                    m_mgr.MarkDirty();
                }
            }

            return(cmd);
        }