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(); } }
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(); } }
private void OnAppStartup(object sender, StartupEventArgs e) { Exit += (_, __) => IsShuttingDown = true; _errorReporter = new ErrorReporter(); if (SingleInstanceAppMutex.TakeExclusivity()) { Exit += (_, __) => SingleInstanceAppMutex.ReleaseExclusivity(); ContinueStartup(); } else { Shutdown(); } }
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(); } }
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(); } }