public static SiteConfigCredentials ParseJSON(JArray iJSON) { SiteConfigCredentials pACCCreds = new SiteConfigCredentials(); foreach (JObject curCredential in iJSON) { String pStrCredType = curCredential["CredentialType"].Value <String>(); switch (pStrCredType) { case "Amazon": { SiteConfigCredentialAmazon pACCAmazon = SiteConfigCredentialAmazon.ParseJSON(curCredential); pACCCreds.cOCnCredentials.Add(pACCAmazon); break; } default: { //Unknown credential type break; } } } return(pACCCreds); }
public static SiteConfig Parse(String iConfigJSON) { try { SiteConfig pACgParsed = new SiteConfig(); pACgParsed.cJOtConfig = JObject.Parse(iConfigJSON); pACgParsed.cACIInfo = SiteConfigInfo.ParseJSON(pACgParsed.cJOtConfig["Info"].Value <JObject>()); pACgParsed.cACCCredentials = SiteConfigCredentials.ParseJSON(pACgParsed.cJOtConfig["Credentials"].Value <JArray>()); return(pACgParsed); } catch (Exception ex) { throw new AppConfigParseException(ex); } }