private void OnSelectedLocaleChanged(object sender, EventArgs e) { try { var locale = _action.SelectedLocale; InstalledLocales.Instance.Selected = locale; Platform.Log(LogLevel.Debug, @"Locale changed to {0}", locale.Culture); if (Application.CurrentUICulture != locale.GetCultureInfo() && ConfirmLanguageChangeRestart(Context.DesktopWindow, locale)) { Platform.Log(LogLevel.Debug, @"Restarting application from {0}", Assembly.GetEntryAssembly().Location); Process.Start(Assembly.GetEntryAssembly().Location); Application.Shutdown(); } } catch (Exception ex) { ExceptionHandler.Report(ex, Context.DesktopWindow); } }
/// <summary> /// Moves to the page at the specified index. /// </summary> protected virtual void MoveTo(int index) { if (index > -1 && index < _pages.Count) { _current = index; try { EnsureStarted(_pages[_current]); } catch (Exception e) { ExceptionHandler.Report(e, this.Host.DesktopWindow); } finally { // inform view that page has changed EventsHelper.Fire(_currentPageChanged, this, new EventArgs()); } } }
void Launch() { if (_workspace == null) { try { DesktopMonitorComponent component = new DesktopMonitorComponent(); _workspace = ApplicationComponent.LaunchAsWorkspace( this.Context.DesktopWindow, component, "Desktop Monitor"); _workspace.Closed += delegate { _workspace = null; }; } catch (Exception e) { ExceptionHandler.Report(e, this.Context.DesktopWindow); } } else { _workspace.Activate(); } }