Ejemplo n.º 1
0
#pragma warning disable AvoidAsyncVoid // Avoid async void
        protected override async void OnStartup(StartupEventArgs e)
#pragma warning restore AvoidAsyncVoid // Avoid async void
        {
#if DEBUG
            LogManager.AddDebugListener(true);
#endif

            SquirrelHelper.HandleSquirrelAutomatically();

            var serviceLocator = ServiceLocator.Default;
            var shellService   = serviceLocator.ResolveType <IShellService>();
            await shellService.CreateWithSplashAsync <ShellWindow>();

            Log.Info("Elapsed startup stopwatch time: {0}", _stopwatch.Elapsed);
        }
Ejemplo n.º 2
0
        protected override async void OnStartup(StartupEventArgs e)
        {
#if DEBUG
            LogManager.AddDebugListener(true);
#endif

            SquirrelHelper.HandleSquirrelAutomatically();

            var serviceLocator = ServiceLocator.Default;
            var shellService   = serviceLocator.ResolveType <IShellService>();
            await shellService.CreateWithSplash <ShellWindow>();

            var googleAnalyticsService = serviceLocator.ResolveType <IGoogleAnalyticsService>();

            _end = DateTime.Now;
            _stopwatch.Stop();

#pragma warning disable 4014
            googleAnalyticsService.SendTiming(_stopwatch.Elapsed, Analytics.Application.Name, Analytics.Application.StartupTime);
#pragma warning restore 4014

            Log.Info("Elapsed startup stopwatch time: {0}", _stopwatch.Elapsed);
            Log.Info("Elapsed startup time: {0}", _end - _start);
        }