rawfilewizard

git clone https://git.clttr.info/rawfilewizard.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

Program.cs (1468B)


      1 using SilkypixFileMover.Properties;
      2 using System;
      3 using System.Configuration;
      4 using System.IO;
      5 using System.Reflection;
      6 using System.Windows.Forms;
      7 
      8 namespace SilkypixFileMover
      9 {
     10     static class Program
     11     {
     12         /// <summary>
     13         /// The main entry point for the application.
     14         /// </summary>
     15         [STAThread]
     16         static void Main()
     17         {
     18             try
     19             {
     20                 string currentVersion = Assembly.GetEntryAssembly().GetName().Version.ToString();
     21                 if ( !Settings.Default.appSettingsVersion.Equals(currentVersion))
     22                 {
     23                     Settings.Default.Upgrade();
     24                     Settings.Default.appSettingsVersion = currentVersion;
     25                     Settings.Default.Save();
     26                 }
     27             }
     28             catch ( Exception e )
     29             {
     30                 File.Delete(( ( ConfigurationException ) e.InnerException ).Filename);
     31                 MessageBox.Show( "Ihre Anwendungseinstellungen waren defekt und wurden auf die Standardwerte zurückgesetzt." 
     32                     + Environment.NewLine + "Bitte starten Sie die Anwendung neu.", 
     33                     "Fehler beim Starten", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
     34 
     35                 Application.Exit();
     36             }
     37 
     38             Application.EnableVisualStyles();
     39             Application.SetCompatibleTextRenderingDefault( false );
     40             Application.Run( new MainForm() );
     41         }
     42     }
     43 }