Esempio n. 1
0
        public void Initialize()
        {
            try
            {
                SplashScreenManager.ShowForm(this, typeof(MainAppSplashScreen), true, true);
                SplashScreenManager.Default.SendCommand(null, "开始启动系统......");
                SplashScreenManager.Default.SendCommand(null, "开始初始化主窗体控件......");
                string systemType = SystemInfo.Instance.SystemType;
                if (systemType == "2D" || systemType == "3D")
                {
                    //先创建View再创建Pad
                    SplashScreenManager.Default.SendCommand(null, "开始初始化视图......");
                    UCService.AddViews(this, "/Workbench/View/" + systemType);
                    UCService.CreateViews(components, dockManager, tabbedView);

                    SplashScreenManager.Default.SendCommand(null, "开始初始化面板......");
                    UCService.AddPads(this, "/Workbench/Pad/" + systemType);
                    UCService.CreatePads(this, dockManager);

                    AutoStartCmds("/Workspace/Autostart/" + systemType);

                    SplashScreenManager.Default.SendCommand(null, "正在加载菜单......");
                    MenuService.AddItemsToMenu(this.ribbon.Pages, this, "/Workbench/MainMenu/" + systemType);
                    MenuService.AddItemsToMenu(this.ribbon.Pages, this, "/Workbench/MainMenu");
                    if (this.ribbon.Pages.Count > 0)
                    {
                        this.ribbon.SelectedPage = this.ribbon.Pages[0];
                    }
                    MenuService.AddQuickToolBar(this.ribbon.Items, this.ribbon.Toolbar.ItemLinks);
                    MenuService.AddApplicationMenu(this.appMenu.ItemLinks, this, "/Workbench/ApplicationMenu");
                }
                else
                {
                    //先创建View再创建Pad
                    SplashScreenManager.Default.SendCommand(null, "开始初始化视图......");
                    UCService.AddViews(this, "/Workbench/View/2D");
                    UCService.AddViews(this, "/Workbench/View/3D");
                    UCService.CreateViews(components, dockManager, tabbedView);

                    SplashScreenManager.Default.SendCommand(null, "开始初始化面板......");
                    UCService.AddPads(this, "/Workbench/Pad/2D");
                    UCService.AddPads(this, "/Workbench/Pad/3D");
                    UCService.CreatePads(this, dockManager);

                    AutoStartCmds("/Workspace/Autostart/2D");
                    AutoStartCmds("/Workspace/Autostart/3D");

                    SplashScreenManager.Default.SendCommand(null, "正在加载菜单......");
                    MenuService.AddItemsToMenu(this.ribbon.Pages, this, "/Workbench/MainMenu/2D");
                    MenuService.AddItemsToMenu(this.ribbon.Pages, this, "/Workbench/MainMenu/3D");
                    MenuService.AddItemsToMenu(this.ribbon.Pages, this, "/Workbench/MainMenu");
                    if (this.ribbon.Pages.Count > 0)
                    {
                        this.ribbon.SelectedPage = this.ribbon.Pages[0];
                    }
                    MenuService.AddQuickToolBar(this.ribbon.Items, this.ribbon.Toolbar.ItemLinks);
                    MenuService.AddApplicationMenu(this.appMenu.ItemLinks, this, "/Workbench/ApplicationMenu");
                }
                SplashScreenManager.CloseForm();
                //this.ribbon.Minimized = true;
            }
            catch (Exception ex)
            {
                LoggingService.Error(ex.Message + "\r\n" + ex.StackTrace);
            }
        }