public static RFFTPFileSite ReadFromConfig(RFEnum siteKey, IRFUserConfig userConfig) { return(new RFFTPFileSite(siteKey, userConfig) { SiteKey = siteKey, SiteType = (RFFTPSiteType)Enum.Parse(typeof(RFFTPSiteType), userConfig.GetString(CONFIG_SECTION, siteKey, true, "SiteType"), true), Hostname = userConfig.GetString(CONFIG_SECTION, siteKey, true, "Hostname"), Port = userConfig.GetInt(CONFIG_SECTION, siteKey, false, null, "Port"), Username = userConfig.GetString(CONFIG_SECTION, siteKey, true, "Username"), Password = userConfig.GetString(CONFIG_SECTION, siteKey, false, "Password"), ConnectionKeyPath = userConfig.GetString(CONFIG_SECTION, siteKey, false, "ConnectionKeyPath"), ConnectionKeyPassword = userConfig.GetString(CONFIG_SECTION, siteKey, false, "ConnectionKeyPassword"), RootDirectory = userConfig.GetString(CONFIG_SECTION, siteKey, false, "RootDirectory") }); }
protected RFFileSite(RFEnum siteKey, string configSection, IRFUserConfig userConfig) { SiteKey = siteKey; Enabled = true; MaxAge = null; if (userConfig != null) { MaxAge = userConfig.GetDecimal(configSection, siteKey, false, null, "MaxAge"); Enabled = userConfig.GetBool(configSection, siteKey, false, true, "Enabled"); PGPSuffixes = userConfig.GetString(configSection, siteKey, false, "PGPSuffixes"); PGPKeyPath = userConfig.GetString(configSection, siteKey, false, "PGPKeyPath"); PGPKeyPassword = userConfig.GetString(configSection, siteKey, false, "PGPKeyPassword"); WriteCooldown = userConfig.GetInt(configSection, siteKey, false, null, "WriteCooldown"); ScanArchives = userConfig.GetBool(configSection, siteKey, false, false, "ScanArchives"); ArchivePath = userConfig.GetString(configSection, siteKey, false, "ArchivePath"); UseTemporaryName = userConfig.GetBool(configSection, siteKey, false, false, "UseTemporaryName"); } }