Ejemplo n.º 1
0
        /// 调用默认的主窗口
        /// </summary>
        /// <param name="systemName">命令执行控制器</param>
        /// <param name="commandExecutor"></param>
        /// <param name="treeNodes">功能模块树节点</param>
        public DefaultMdiMainForm(string systemName, UICommandExecutor commandExecutor, MB.Util.Model.ModuleTreeNodeInfo[] treeNodes)
        {
            InitializeComponent();

            _ModuleTreeNodes = treeNodes;
            _SystemName      = systemName;



            if (commandExecutor == null)
            {
                _CommandExecutor = new UICommandExecutor(this);
            }
            else
            {
                _CommandExecutor = commandExecutor;
            }

            _MenuManager         = new XtraMenuManager(_CommandExecutor, barManagerMain, barMainMenu, barTools);
            trvMainFunction.Dock = DockStyle.Fill;
            rxtMessage.Dock      = DockStyle.Fill;

            //测试代码
            rxtMessage.SelectionColor = Color.Red;
            rxtMessage.SelectionFont  = new Font(this.Font, FontStyle.Bold);
            double versionNum = MB.WinClientDefault.VersionAutoUpdate.VersionAutoUpdateHelper.GetClientVersionNumber();

            if (versionNum <= 0)
            {
                versionNum = 1.0;
            }
            // rxtMessage.AppendText(string.Format("欢迎使用{0}... 当前版本号  {1} \n",systemName,versionNum));
            // rxtMessage.SelectionColor = Color.Black;
            //  rxtMessage.AppendText("系统公告:");

            //rxtMessage.SelectionColor = Color.Blue;
            //Font old = rxtMessage.SelectionFont;

            //rxtMessage.SelectionFont = new Font(this.Font, FontStyle.Underline);
            //rxtMessage.AppendText("在使用本系统之前请详细阅读美邦国际信息安全条款!");
            //rxtMessage.SelectionColor = Color.Black;
            //rxtMessage.SelectionFont = old;

            this.Text = systemName;



            _CurrentUserName = "******";
            if (MB.WinBase.AppEnvironmentSetting.Instance.CurrentLoginUserInfo != null)
            {
                _CurrentUserName = MB.WinBase.AppEnvironmentSetting.Instance.CurrentLoginUserInfo.DISP_NAME;
            }

            barStaticItemUserName.Caption = string.Format("系统版本号: {0}     登录用户: {1}", versionNum, _CurrentUserName);
            _BeginDate        = System.DateTime.Now;
            timer1.Enabled    = true;
            this.SizeChanged += new EventHandler(DefaultMdiMainForm_SizeChanged);

            dockPanelOnlineMsg.Hide();
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="commandExecutor"></param>
        /// <param name="barManager"></param>
        /// <param name="mainMenu"></param>
        /// <param name="barTools"></param>
        public XtraMenuManager(UICommandExecutor commandExecutor, DevExpress.XtraBars.BarManager barManager,
                               DevExpress.XtraBars.Bar mainMenu, DevExpress.XtraBars.Bar barTools)
        {
            _BarManager      = barManager;
            _BarMainMenu     = mainMenu;
            _BarEdit         = barTools;
            _CommandExecutor = commandExecutor;

            _AllCreateButtonItems = new Dictionary <DevExpress.XtraBars.BarButtonItem, XMenuInfo>();
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        public RibbonMdiMainForm(string systemName, MB.Util.Model.ModuleTreeNodeInfo[] treeNodes)
        {
            InitializeComponent();

            _SystemName      = systemName;
            _ModuleTreeNodes = treeNodes;

            _CommandExecutor    = new UICommandExecutor(this);
            _RejectCommandItems = new Dictionary <DevExpress.XtraBars.BarButtonItem, bool>();

            _AllCreateMenuItems = new Dictionary <DevExpress.XtraBars.BarButtonItem, System.ComponentModel.Design.CommandID>();
        }
Ejemplo n.º 4
0
        /// <summary>
        ///  Ribbon 样式的系统操作主窗口。
        /// </summary>
        public XtraRibbonMdiMainForm()
        {
            InitializeComponent();

            if (MB.Util.General.IsInDesignMode())
            {
                return;
            }

            _CommandExecutor    = new UICommandExecutor(this);
            _RejectCommandItems = new Dictionary <DevExpress.XtraBars.BarButtonItem, bool>();

            _AllCreateMenuItems = new Dictionary <DevExpress.XtraBars.BarButtonItem, System.ComponentModel.Design.CommandID>();
            _ToopTip            = new ToolTip();
            _ToopTip.SetToolTip(butOpenModule, MODULE_TOOLTIP_MSG);

            Active_Mdi_Form = this;

            _ButtonValidatedCatch = new Util.MyDataCache <WinBase.IFace.IViewGridForm, Dictionary <DevExpress.XtraBars.BarButtonItem, bool> >();

            MB.WinBase.AppMessenger.DefaultMessenger.Subscribe(MSG_REQUIRE_REFRESH_BUTTONS, refreshToolsButton);
            MB.WinBase.AppMessenger.DefaultMessenger.Subscribe(DynamicGroupUIHelper.DYNAMIC_GROUP_ACTIVE_MSG_ID, refreshToolsButton);

            string icon = System.Configuration.ConfigurationManager.AppSettings[APPLICATION_ICON];

            if (!string.IsNullOrEmpty(icon))
            {
                bool isShow  = true;
                bool isValue = bool.TryParse(icon, out isShow);
                if (isValue && !isShow)
                {
                    this.ribbonControl1.ApplicationIcon = null;
                }
            }

            if (PersonalFavoritesEnable)
            {
                dockPanelPersonalFavorites.Show();
            }


            //else dockPanelPersonalFavorites.Close();
        }