コード例 #1
0
        private void Managed_OnLoadModuleCompleted(object sender, ViewModel.LoadModuleEventArgs e)
        {
            if (_mainMenu != null)
            {
                _mainMenu.Stop();
            }
            if (e.ModuleInstance != null)
            {
                FrameworkElement content = e.ModuleInstance as FrameworkElement;
                if (content != null)
                {
                    if (content.Parent == null)
                    {
                        WorkHost.Visibility    = Visibility.Visible;
                        WebPartHost.Visibility = Visibility.Collapsed;
                        WebPartHost.Stop();

                        WorkHost.Navigation(content, e.ModuleInfo.Description);
                        Common.AppContext.IsMenuOpen = _fromMenu;
                    }
                }
            }
            else
            {
                string message = string.Format("打开模块'{0}'失败,请联系管理员!", e.ModuleInfo.Description);
                AppContext.SystemMessage(message);
                AppContext.ShowSystemMessageText();
                MessageWindow.Show("提示", message, MessageIcon.Error, MessageWindowType.Default);
            }
        }
コード例 #2
0
ファイル: MVCMainPage.xaml.cs プロジェクト: jjg0519/OA
        public void NavigationWorkPanel(string tag)
        {
            try
            {
                WorkHost.PanelContent = null;
                if (!bMVCOpen)
                {
                    WorkHost.Visibility = Visibility.Visible;
                }
                //WebPartHost.Visibility = Visibility.Collapsed;
                //WebPartHost.Stop();

                UserControl workitem = null;
                string      titel    = "";
                switch (tag)
                {
                case "NewsManager": workitem = new WebParts.Views.NewsManager(); titel = "新闻管理"; break;

                case "SystemLog": workitem = new SMT.SAAS.Platform.Xamls.SystemLogger(); titel = " 系统日志"; break;

                case "CustomMenusSet":
                {
                    titel = "菜单列表";
                    if (_mainMenu == null)
                    {
                        _mainMenu = new Xamls.MainPagePart.CustomMenusSet();
                        _mainMenu.ShortCutClick += new EventHandler <OnShortCutClickEventArgs>(menu_ShortCutClick);
                        workitem = _mainMenu;
                    }
                    else
                    {
                        workitem = _mainMenu;
                    }
                    break;
                }

                default: break;
                }

                WorkHost.Navigation(workitem, titel);
                Common.AppContext.IsMenuOpen = _fromMenu;
            }
            catch (Exception ex)
            {
                string strmsg = "点击菜单时发生错误,原因:" + ex.ToString();
                SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(strmsg);
            }
            finally
            {
                hideLoadingBar();
                HtmlPage.Window.Invoke("loadCompletedSL", "Invoke");
            }
        }
コード例 #3
0
        public void NavigationWorkPanel(string tag)
        {
            try
            {
                WorkHost.PanelContent  = null;
                WorkHost.Visibility    = Visibility.Visible;
                WebPartHost.Visibility = Visibility.Collapsed;
                WebPartHost.Stop();

                UserControl workitem = null;
                string      titel    = "";
                switch (tag)
                {
                case "NewsManager": workitem = new WebParts.Views.NewsManager(); titel = "新闻管理"; break;

                case "SystemLog": workitem = new SMT.SAAS.Platform.Xamls.SystemLogger(); titel = " 系统日志"; break;

                case "CustomMenusSet":
                {
                    titel = "菜单列表";
                    if (_mainMenu == null)
                    {
                        _mainMenu = new Xamls.MainPagePart.CustomMenusSet();
                        _mainMenu.MenuItemMouseDown += new EventHandler <MouseButtonEventArgs>(menu_MenuItemMouseDown);
                        _mainMenu.ShortCutClick     += new EventHandler <OnShortCutClickEventArgs>(menu_ShortCutClick);
                        _mainMenu.MenuItemMouseMove += new EventHandler <MouseEventArgs>(menu_MenuItemMouseMove);
                        workitem = _mainMenu;
                    }
                    else
                    {
                        workitem = _mainMenu;
                    }
                    break;
                }

                default: break;
                }

                WorkHost.Navigation(workitem, titel);
                Common.AppContext.IsMenuOpen = _fromMenu;
            }
            catch (Exception ex)
            {
                string strmsg = "点击菜单时发生错误,原因:" + ex.ToString();
                SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(strmsg);
            }
        }
コード例 #4
0
ファイル: MVCCreateNewForm.cs プロジェクト: jjg0519/OA
        private void CheckeDepends(string moduleName)
        {
            var module = ViewModel.Context.Managed.Catalog.FirstOrDefault(item => item.ModuleName == moduleName);

            if (module != null)
            {
                ViewModel.Context.Managed.OnSystemLoadModuleCompleted += LoadTaskHandler = (o, e) =>
                {
                    ViewModel.Context.Managed.OnSystemLoadModuleCompleted -= LoadTaskHandler;
                    if (e.Error == null)
                    {
                        try
                        {
                            MVCCraeteNewForm content = new MVCCraeteNewForm();
                            content.info = _currentCreateNewModule;
                            if (content != null)
                            {
                                if (content.Parent == null)
                                {
                                    WorkHost.Visibility = Visibility.Visible;
                                    WorkHost.Navigation(content, e.ModuleInfo.Description);
                                    Common.AppContext.IsMenuOpen = _fromMenu;
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                        }
                        finally
                        {
                            hideLoadingBar();
                            HtmlPage.Window.Invoke("loadCompletedSL", "Invoke");
                        }
                    }
                };

                ViewModel.Context.Managed.LoadModule(moduleName);
            }
        }