// =========================================================================== // = Construction // =========================================================================== public GrouchDownloader(Settings inSettings) { _settings = inSettings; _clientFactory = () => new GrouchInternalUsenetClient( _settings.ServerHostName, _settings.ServerUserName, _settings.ServerPassword, _settings.ServerPort, _settings.ServerUseSsl); }
private void LoadSettings() { var serializer = new JsonSerializer(); var settingsPath = GetSettingsPath(); if (!File.Exists(settingsPath)) _settings = new Settings(); else using (var settingsFile = File.OpenRead(settingsPath)) { _settings = serializer.Deserialize<Settings>(new JsonTextReader(new StreamReader(settingsFile))); } }