private void SaveSettings() { string savePath = GetAppDataPath(); SaveSettings(Path.Combine(savePath, AppSettingsFileName), _appSettings); SaveSettings(Path.Combine(savePath, QueueSettingsFileName), _queueSettings); SaveSettings(Path.Combine(savePath, ManagerSettingsFileName), _managerSettings); SaveSettings(Path.Combine(savePath, CookiesFileName), new List <Cookie>(_cookieService.GetAllCookies())); }
private void SaveSettings() { string savePath = environmentService.AppSettingsPath; if (appSettings.PortableMode) { savePath = AppDomain.CurrentDomain.BaseDirectory; } SaveSettings(Path.Combine(savePath, appSettingsFileName), appSettings); SaveSettings(Path.Combine(savePath, queueSettingsFileName), queueSettings); SaveSettings(Path.Combine(savePath, managerSettingsFileName), managerSettings); SaveSettings(Path.Combine(savePath, cookiesFileName), new List <Cookie>(cookieService.GetAllCookies())); }
public void Shutdown() { DetailsController.Shutdown(); QueueController.Shutdown(); ManagerController.Shutdown(); CrawlerController.Shutdown(); if (appSettings.PortableMode) { SaveSettings(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, appSettingsFileName), appSettings); SaveSettings(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, queueSettingsFileName), queueSettings); SaveSettings(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, managerSettingsFileName), managerSettings); SaveSettings(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, cookiesFileName), new List <Cookie>(cookieService.GetAllCookies())); } else { SaveSettings(Path.Combine(environmentService.AppSettingsPath, appSettingsFileName), appSettings); SaveSettings(Path.Combine(environmentService.AppSettingsPath, queueSettingsFileName), queueSettings); SaveSettings(Path.Combine(environmentService.AppSettingsPath, managerSettingsFileName), managerSettings); SaveSettings(Path.Combine(environmentService.AppSettingsPath, cookiesFileName), new List <Cookie>(cookieService.GetAllCookies())); } }
public void Shutdown() { DetailsController.Shutdown(); QueueController.Shutdown(); ManagerController.Shutdown(); CrawlerController.Shutdown(); string savePath = _environmentService.AppSettingsPath; if (_appSettings.PortableMode) { savePath = AppDomain.CurrentDomain.BaseDirectory; } SaveSettings(Path.Combine(savePath, AppSettingsFileName), _appSettings); SaveSettings(Path.Combine(savePath, QueueSettingsFileName), _queueSettings); SaveSettings(Path.Combine(savePath, ManagerSettingsFileName), _managerSettings); SaveSettings(Path.Combine(savePath, CookiesFileName), new List <Cookie>(_cookieService.GetAllCookies())); }