Exemplo n.º 1
0
        /// <summary>
        /// 构造函数。
        /// </summary>
        /// <param name="param">表示参数管理信息的实体对象</param>
        public ParamViewContent(Param param)
            : base()
        {
            if (null != param && param.ParamName.Length > 0)
            {
                this.TitleName = StringParser.Parse("${res:FanHai.Hemera.Addins.EDC.ParamViewContent}") + "_" + param.ParamName;
            }
            else
            {
                this.TitleName = StringParser.Parse("${res:FanHai.Hemera.Addins.EDC.ParamViewContent}");
            }

            Panel panel = new Panel();

            //set panel dock style
            panel.Dock = DockStyle.Fill;
            //set panel BorderStyle
            panel.BorderStyle = BorderStyle.FixedSingle;

            paramCtl = new ParamCtl(param);

            paramCtl.Dock = DockStyle.Fill;

            //add control to panle
            panel.Controls.Add(paramCtl);
            //set panel to view content
            this.control = panel;
        }
Exemplo n.º 2
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);
        }