Exemplo n.º 1
0
 private void LoadSettings()
 {
     // Check if ini file exists
     if (File.Exists(iniFilePath))
     {
         try {
             var iniFile = new INIClass(iniFilePath);
             radioButtonOverwriteOriginal.Checked = iniFile.ReadValue("", "OverwriteOriginal") == "True";
             radioButtonUseDirectory.Checked      = iniFile.ReadValue("", "OverwriteOriginal") != "True";
             textBoxOutputDirectory.Text          = iniFile.ReadValue("", "OutputDirectory");
             numUpDownNoOfPasses.Value            = decimal.Parse(iniFile.ReadValue("", "NoOfPasses"));
             numUpDownJpegQuality.Value           = decimal.Parse(iniFile.ReadValue("", "JpegQuality"));
             checkBoxUseHighMemory.Checked        = iniFile.ReadValue("", "UseHighMemory") == "True";
             checkBoxRemoveImgMetaData.Checked    = iniFile.ReadValue("", "RemoveImgMetaData") == "True";
         } catch {
             ResetDefaultSettings();
         }
     }
     // If not, then the application may be started for the first time
     else
     {
         ResetDefaultSettings();
         SaveSettings();
     }
 }