示例#1
0
        public override void OnFrameworkInitializationCompleted()
        {
            if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime lifetime)
            {
                Updater.NewVersionFound += UpdaterOnNewVersionFound;
                lifetime.Exit           += LifetimeOnExit;

                var explorer = ExplorerViewModel.Instance;

                // Подключаемся к базе в отдельном потоке, чтобы не зависал UI.
                Task.Run(() => Client.Start(explorer.LoadingProcess));

                var args = Environment.GetCommandLineArgs();
                if (args.Contains("-m") || args.Contains("/min") || ConfigStorage.Instance.AppConfig.StartMinimizedToTray)
                {
                    // SaveSettingsCommand.ValidateMangaPaths();
                }
                else
                {
                    ShowMainWindowCommand.SetLifetime(explorer, lifetime);
                }
            }

            base.OnFrameworkInitializationCompleted();
        }
示例#2
0
 static void Main(string[] args)
 {
     Client.Init();
     Client.OtherAppRunning += ClientOnOtherAppRunning;
     BuildAvaloniaApp().StartWithClassicDesktopLifetime(args, ShutdownMode.OnMainWindowClose);
 }