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