示例#1
0
        public virtual void Load(IBootContext b)
        {
            if (b.WaitDependency("BootLoaderErpWpf"))
            {
                return;
            }

            if (_erp.Acl.Connection == null)
            {
                if (!_erp.Acl.Cancelled)
                {
                    b.Requeue();
                }
                return;
            }

            if (!_erp.Acl.IsGranted(AclRights.ManageUser))
            {
                return;
            }

            _erp.Menu.RegisterMenu("tools/ImportUsers", "{Import Users}",
                                   OpenCommand,
                                   "icons/tools/ImportUsers");
        }
示例#2
0
        public void Load(IBootContext b)
        {
            if (b.Contains("LocalizeBootloader"))
            {
                b.Requeue();
                return;
            }


            MainWindow = new DefaultWindow()
            {
                //WindowStartupLocation = WindowStartupLocation.CenterScreen,
                //WindowState =  WindowState.Maximized
            };

            MainWindow.Closing += (sender, args) => System.Windows.Application.Current.Shutdown();
            MainWindow.Show();

            _info.Version = Assembly.GetCallingAssembly().GetName().Version;

            InitializeCultures();

            if (Updater != null)
            {
                Updater.CheckVersion();

                if (Updater.NewVersionFound)
                {
                    var updaterView = new ApplicationUpdateView
                    {
                        DataContext = Updater
                    };
                    // TODO : updaterView.ShowDialog();

                    if (Updater.Updated)
                    {
                        System.Windows.Application.Current.Shutdown();
                        return;;
                    }
                }
            }


            ViewModel = _getVm();
            var w = _mvvm.MainContext.GetView(ViewModel, MainViewMode);


            _menu.RegisterMenu("file", "{File}", null, null);
            _menu.RegisterMenu("data", "{Data}", null, null);
            _menu.RegisterMenu("param", "{Parameters}", null, null);
            _menu.RegisterMenu("tools", "{Tools}", null, null);
            _menu.RegisterMenu("help", "{_?}", null, null);


            _menu.RegisterMenu("file/exit", "{Exit}", ViewModel.Exit, null);

            MainWindow.Content = w;

            return;
        }
示例#3
0
        public void Load(IBootContext b)
        {
            if (_data.ServiceState != ServiceState.Available)
            {
                b.Requeue(); return;
            }

            LoadAsync();
        }