Beispiel #1
0
        /// <summary>
        /// 新增参数
        /// </summary>
        private void toolbarNew_Click(object sender, EventArgs e)
        {
            foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection)
            {
                if (viewContent.TitleName == StringParser.Parse("${res:FanHai.Hemera.Addins.EDC.ParamViewContent}"))
                {
                    viewContent.WorkbenchWindow.SelectWindow();
                    if (viewContent == viewContent.WorkbenchWindow.ActiveViewContent)
                    {
                        ParamCtl ctrl = (ParamCtl)viewContent.Control.Controls.Find("ParamCtl", true)[0];
                        if (ctrl.txtParamName.Text.Trim() != "")
                        {
                            if (!MessageService.AskQuestion("${res:Global.ClearNoteMessage}", "${res:Global.SystemInfo}"))
                            {
                                return;
                            }
                        }
                        ctrl.CtrlState = ControlState.New;
                    }
                    return;
                }
            }

            ParamViewContent paramContent = new ParamViewContent(new Param());

            WorkbenchSingleton.Workbench.ShowView(paramContent);
        }
Beispiel #2
0
        /// <summary>
        /// 执行命令。
        /// </summary>
        public override void Run()
        {
            //遍历工作台中已经打开的视图对象。
            foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection)
            {
                //如果已打开该视图,则选中该视图显示,返回以结束该方法的运行。
                if (viewContent.TitleName == StringParser.Parse("${res:FanHai.Hemera.Addins.EDC.ParamViewContent}"))
                {
                    viewContent.WorkbenchWindow.SelectWindow();
                    return;
                }
            }
            //创建新的视图对象,并显示该视图界面。
            ParamViewContent view = new ParamViewContent(new Param());

            WorkbenchSingleton.Workbench.ShowView(view);
        }