Exemplo n.º 1
0
        /// <summary>
        /// Method executed on application startup
        /// </summary>
        /// <param name="e">Application arguments</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            string     locale = HandleStartupLocale();
            MainWindow window = new MediaExtractor.MainWindow();

            window.RestoreSettings();
            I18n.MatchLocale(window.CurrentModel, locale);
            window.CurrentLocale = locale;
            window.Show();
        }
 /// <summary>
 /// Handles the window closing event
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="CancelEventArgs"/> instance containing the event data.</param>
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     StoreSettings();
     if (!string.IsNullOrEmpty(this.CurrentLocale) && HandleLocaleChange)
     {
         string locale = this.CurrentLocale;
         Thread.CurrentThread.CurrentUICulture = new CultureInfo(locale);
         MainWindow window = new MainWindow();
         window.CurrentLocale = locale;
         window.Show();
         window.Left        = this.Left;
         window.Top         = this.Top;
         window.WindowState = this.WindowState;
         I18n.MatchLocale(window.CurrentModel, locale);
         window.RestoreSettings();
     }
     else
     {
         App.Current.Shutdown();
     }
 }