Esempio n. 1
0
        public void Load(IBootContext b)
        {
            if (b.WaitDependency <LocalizeBootloader>())
            {
                return;
            }
            if (b.WaitDependency <LoginBootloader>())
            {
                return;
            }

            _info.Version = Assembly.GetEntryAssembly()?.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();

            MainWindow          = _mvvm.MainContext.GetView(ViewModel, MainViewMode).AsWindow();
            MainWindow.Closing += (sender, args) => System.Windows.Application.Current.Shutdown();

            _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.Show();

            return;
        }
Esempio n. 2
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");
        }
Esempio n. 3
0
        public void Load(IBootContext bootstrapper)
        {
            //if we can have localization and picture lets do it
            if (bootstrapper.WaitDependency("LocalizeBootloader", "IconBootloader"))
            {
                return;
            }

            //retrieve login window
            var loginWindow = _mvvm.MainContext.GetView(_getViewModel(), typeof(ViewModeDefault)).AsWindow();

            //loginWindow.SizeToContent = SizeToContent.WidthAndHeight;
            loginWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            loginWindow.ShowDialog();

            //if connection failed
            if (_acl.Connection is null)
            {
                Application.Current.Shutdown();
            }
        }