Exemplo n.º 1
0
        private void OnAppStartup(object sender, StartupEventArgs e)
        {
            Exit          += (_, __) => IsShuttingDown = true;
            HasIdentity    = PackageHelper.CheckHasIdentity();
            PackageVersion = PackageHelper.GetVersion(HasIdentity);
            _settings      = new AppSettings();
            _errorReporter = new ErrorReporter();

            if (SingleInstanceAppMutex.TakeExclusivity())
            {
                Exit += (_, __) => SingleInstanceAppMutex.ReleaseExclusivity();

                try
                {
                    ContinueStartup();
                }
                catch (Exception ex) when(IsCriticalFontLoadFailure(ex))
                {
                    ErrorReporter.LogWarning(ex);
                    OnCriticalFontLoadFailure();
                }
            }
            else
            {
                Shutdown();
            }
        }
Exemplo n.º 2
0
        private void OnAppStartup(object sender, StartupEventArgs e)
        {
            Exit          += (_, __) => IsShuttingDown = true;
            _errorReporter = new ErrorReporter();

            if (SingleInstanceAppMutex.TakeExclusivity())
            {
                Exit += (_, __) => SingleInstanceAppMutex.ReleaseExclusivity();

                try
                {
                    ContinueStartup();
                }
                catch (Exception ex) when(ex.StackTrace.Contains(
                                              "MS.Internal.Text.TextInterface.FontFamily.GetFirstMatchingFont"))
                {
                    ErrorReporter.LogWarning(ex);
                    OnCriticalFontLoadFailure();
                }
            }
            else
            {
                Shutdown();
            }
        }
Exemplo n.º 3
0
        private void OnAppStartup(object sender, StartupEventArgs e)
        {
            Exit          += (_, __) => IsShuttingDown = true;
            _errorReporter = new ErrorReporter();

            if (SingleInstanceAppMutex.TakeExclusivity())
            {
                Exit += (_, __) => SingleInstanceAppMutex.ReleaseExclusivity();
                ContinueStartup();
            }
            else
            {
                Shutdown();
            }
        }
Exemplo n.º 4
0
        private void OnStartup(object sender, StartupEventArgs e)
        {
            if (SingleInstanceAppMutex.TakeExclusivity())
            {
                Exit += (_, __) => SingleInstanceAppMutex.ReleaseExclusivity();

                try
                {
                    ContinueStartup();
                }
                catch (Exception ex) when(IsCriticalFontLoadFailure(ex))
                {
                    Trace.WriteLine($"## Warning Notify ##: {ex}");
                    OnCriticalFontLoadFailure();
                }
            }
            else
            {
                Shutdown();
            }
        }
Exemplo n.º 5
0
        private void OnStartup(object sender, StartupEventArgs e)
        {
            if (SingleInstanceAppMutex.TakeExclusivity())
            {
                Exit += (_, __) => SingleInstanceAppMutex.ReleaseExclusivity();

                try
                {
                    ContinueStartup();
                }
                catch (Exception ex) when(IsCriticalFontLoadFailure(ex))
                {
                    Trace.WriteLine($"## Warning Notify ##: {ex}");
                    Log.Error(ex, "Stopped program because of exception");
                }
            }
            else
            {
                Log.CloseAndFlush();
                Shutdown();
            }
        }