Пример #1
0
        /// <summary>
        /// Tool Bar New Click
        /// </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.EDCManageViewContent}"))
                {
                    viewContent.WorkbenchWindow.SelectWindow();
                    EDCManageCtl ctrl = (EDCManageCtl)viewContent.Control.Controls.Find("EDCManageCtl", true)[0];
                    if (ctrl.txtEdcName.Text.Trim() != "")
                    {
                        if (MessageBox.Show(StringParser.Parse("${res:Global.ClearNoteMessage}"),
                                            StringParser.Parse("${res:Global.SystemInfo}"), MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                        {
                            return;
                        }
                    }

                    ctrl.CtrlState = ControlState.New;
                    return;
                }
            }

            EDCManageViewContent edcManageContent = new EDCManageViewContent(new EdcManage());

            WorkbenchSingleton.Workbench.ShowView(edcManageContent);
            btnAdd.Enabled    = true;
            btnDelete.Enabled = true;
        }
Пример #2
0
        /// <summary>
        /// 构造函数。
        /// </summary>
        /// <param name="edc">表示参数组管理的实体对象。</param>
        public EDCManageViewContent(EdcManage edc)
            : base()
        {
            if (null != edc && edc.EdcName.Length > 0)
            {
                this.TitleName = StringParser.Parse("${res:FanHai.Hemera.Addins.EDC.EDCManageViewContent}") + "_" + edc.EdcName;
            }
            else
            {
                this.TitleName = StringParser.Parse("${res:FanHai.Hemera.Addins.EDC.EDCManageViewContent}");
            }

            Panel panel = new Panel();

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

            edcManageCtl = new EDCManageCtl(edc);

            edcManageCtl.Dock = DockStyle.Fill;

            //add control to panle
            panel.Controls.Add(edcManageCtl);
            //set panel to view content
            this.control = panel;
        }