Beispiel #1
0
        protected override async void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // Generate configuration.
            IConfigurationRoot configuration = new ConfigurationBuilder().Build();

            // Configure services.
            ConfigureServices(configuration);

            // Initialize database.
            _serviceProvider.GetService <Database>().Database.EnsureCreated();

            // Read cards.
            CardReader cardManager = _serviceProvider.GetService <CardReader>();

#pragma warning disable CA2007, RCS1090 // Cannot use .ConfigureAwait(false) here
            await cardManager.LoadCardsAsync();

#pragma warning restore CA2007, RCS1090

            // Initialize tray icon.
            _taskbarIcon = LoadTaskbarIcon();

            // Initialize overlay.
#if DEBUG
            Overlay overlay = _serviceProvider.GetService <Overlay>();
            overlay.Show();
#else
            ConfigureOverlay();
#endif
        }