예제 #1
0
 public void Save()
 {
     try
     {
         EngineSettings.Save();
     }
     catch (Exception ex)
     {
         CommonWorker.ShowError(ex);
     }
 }
예제 #2
0
 public void UpdateRootPath()
 {
     try
     {
         RegistryHandler.SaveEngineSettings(EngineSettingsType.RootPaths);
         RaiseRootPathListUpdatedEvent(EngineSettings.RootPaths);
     }
     catch (Exception ex)
     {
         CommonWorker.ShowError(ex);
     }
 }
예제 #3
0
 public void ToggleUseSpecificOutputFolder()
 {
     try
     {
         EngineSettings.UseSpecificOutputFolder = !EngineSettings.UseSpecificOutputFolder;
         RegistryHandler.SaveEngineSettings(EngineSettingsType.UseSpecificOutputFolder);
         RaiseUseSpecificOutputFolderUpdatedEvent(EngineSettings.UseSpecificOutputFolder);
     }
     catch (Exception ex)
     {
         CommonWorker.ShowError(ex);
     }
 }
예제 #4
0
 public void RemoveRootPath(params RootPath[] rootPaths)
 {
     try
     {
         foreach (RootPath rootPath in rootPaths)
         {
             EngineSettings.RemoveRootPath(rootPath);
         }
         RegistryHandler.SaveEngineSettings(EngineSettingsType.RootPaths);
         RaiseRootPathListUpdatedEvent(EngineSettings.RootPaths);
     }
     catch (Exception ex)
     {
         CommonWorker.ShowError(ex);
     }
 }
예제 #5
0
 public void Initialize()
 {
     try
     {
         EngineSettings.Load();
         RaiseApplicationDataFolderUpdatedEvent(EngineSettings.ApplicationDataFolder);
         RaiseSleepTimeUpdatedEvent(EngineSettings.SleepTime);
         RaiseUseSpecificOutputFolderUpdatedEvent(EngineSettings.UseSpecificOutputFolder);
         RaiseOutputFolderUpdatedEvent(EngineSettings.OutputFolder);
         RaiseRootPathListUpdatedEvent(EngineSettings.RootPaths);
         LastBrowsedRootPath = string.Empty;
     }
     catch (Exception ex)
     {
         CommonWorker.ShowError(ex);
     }
 }
예제 #6
0
 public void BrowseApplicationDataFolder()
 {
     try
     {
         FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
         folderBrowserDialog.Description  = "Please select an application data folder...";
         folderBrowserDialog.SelectedPath = EngineSettings.ApplicationDataFolderComplete;
         if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
         {
             EngineSettings.SetApplicationDataFolder(folderBrowserDialog.SelectedPath);
             RegistryHandler.SaveEngineSettings(EngineSettingsType.ApplicationDataFolder);
             RaiseApplicationDataFolderUpdatedEvent(EngineSettings.ApplicationDataFolder);
         }
     }
     catch (Exception ex)
     {
         CommonWorker.ShowError(ex);
     }
 }
예제 #7
0
 public bool SetSleepTime(string sleepTimeMinutes)
 {
     try
     {
         EngineSettings.SleepTime = TimeSpan.FromMinutes(double.Parse(sleepTimeMinutes));
         RegistryHandler.SaveEngineSettings(EngineSettingsType.SleepTime);
         RaiseSleepTimeUpdatedEvent(EngineSettings.SleepTime);
     }
     catch (FormatException)
     {
         CommonWorker.ShowError("Incorrect format of Sleep Time value.");
         return(false);
     }
     catch (Exception ex)
     {
         CommonWorker.ShowError(ex);
         return(false);
     }
     return(true);
 }
예제 #8
0
 public bool SetOutputFolder(string path)
 {
     try
     {
         if (FileHandler.DirectoryExists(EngineSettings.ReplacePathIdentifier(path)))
         {
             EngineSettings.SetOutputFolder(path);
             RegistryHandler.SaveEngineSettings(EngineSettingsType.OutputFolder);
             RaiseOutputFolderUpdatedEvent(EngineSettings.OutputFolder);
         }
         else
         {
             CommonWorker.ShowError("The specified Output Folder does not exist.");
             return(false);
         }
     }
     catch (Exception ex)
     {
         CommonWorker.ShowError(ex);
         return(false);
     }
     return(true);
 }