Esempio n. 1
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        /// <param name="objForm"></param>
        public void InitLayout(MDIParent1 objMainForm)
        {
            if (objMainForm == null)
            {
                return;
            }
            this._MainForm = objMainForm;

            //this._MainForm.ima
            //2.快捷菜单
            _ToolMenu = new Model.Menu("root", "根节点")
            {
                ChildList = new List <Model.Menu>()
            };
            this._ToolMenu.ChildList.Add(new CardManage.Model.Menu("Card_Manage", "卡片管理", "CardManageForm", false, null, 1, null, this._MainForm.imageList1.Images[0]));
            if (!(RunVariable.CurrentUserInfo == null || !RunVariable.CurrentUserInfo.Flag.Equals(0)))
            {
                this._ToolMenu.ChildList.Add(new CardManage.Model.Menu("Card_View", "发卡读卡", "CardViewForm", true, (RunVariable.IfDebug ? new WindowSize(801, 596) : new WindowSize(801, 371)), 0, new Flag(CardManage.Forms.FormBase.EAction.Create), this._MainForm.imageList1.Images["CreateCard"]));
            }
            this._ToolMenu.ChildList.Add(new CardManage.Model.Menu("CardLog_Manage", "刷卡日志", "CardLogManageForm", false, null, 1, null, this._MainForm.imageList1.Images[1]));
            //this._ToolMenu.ChildList.Add(new CardManage.Model.Menu("CommLog_Manage", "通讯日志", "CommLogManageForm", false, null, 1, null, this._MainForm.imageList1.Images[2]));
            this._ToolMenu.ChildList.Add(new CardManage.Model.Menu("SP3", "-"));
            this._ToolMenu.ChildList.Add(new CardManage.Model.Menu("System_Quit", "退出", "", false, null, 1, null, this._MainForm.imageList1.Images[3]));

            //创建快捷菜单
            if (this._ToolStrip == null)
            {
                this._MainForm.Controls.Add(CreateToolStrip());
            }
            //创建菜单
            if (this._MenuStrip == null)
            {
                this._MainForm.Controls.Add(CreateMenu());
            }
            //创建状态栏
            if (this._StatusStrip == null)
            {
                this._MainForm.Controls.Add(CreateStatusStrip());
            }
        }