public void Save() { try { EngineSettings.Save(); } catch (Exception ex) { CommonWorker.ShowError(ex); } }
public void UpdateRootPath() { try { RegistryHandler.SaveEngineSettings(EngineSettingsType.RootPaths); RaiseRootPathListUpdatedEvent(EngineSettings.RootPaths); } catch (Exception ex) { CommonWorker.ShowError(ex); } }
public void ToggleUseSpecificOutputFolder() { try { EngineSettings.UseSpecificOutputFolder = !EngineSettings.UseSpecificOutputFolder; RegistryHandler.SaveEngineSettings(EngineSettingsType.UseSpecificOutputFolder); RaiseUseSpecificOutputFolderUpdatedEvent(EngineSettings.UseSpecificOutputFolder); } catch (Exception ex) { CommonWorker.ShowError(ex); } }
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); } }
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); } }
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); } }
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); }
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); }