private License[] RetrieveLicenses() { License[] licenses = null; var licensesHtml = m_dataProvider.GetAllLicenses(m_credentialsManager.GetCredentials()); if (licensesHtml != "") { licenses = m_licenseParser.Parse(licensesHtml); } return(licenses); }
public static Template Parse(string json) { var jObject = JObject.Parse(json); var result = new Template(); foreach (var item in jObject.Children <JProperty>()) { switch (item.Name.ToLower()) { case "id": result.Id = (int)item.Value; break; case "autolevels": result.AutoLevels = (bool)item.Value; break; case "category": result.Category = Category.Parse(item.Value); break; case "defaultlanguage": result.DefaultLanguage = Language.Parse(item.Value); break; case "description": result.Description = (string)item.Value; break; case "isembeddable": result.IsEmbeddable = (bool)item.Value; break; case "license": result.License = LicenseParser.Parse(item.Value); break; case "localvariables": result.LocalVars = ReadLocalVars(item.Value); break; case "name": result.Name = (string)item.Value; break; case "notifysubscribers": result.NotifySubscribers = (bool)item.Value; break; case "privacy": result.Privacy = PrivacyStatusParser.Parse(item.Value); break; case "publicstatsviewable": result.PublicStatsViewable = (bool)item.Value; break; case "publishtimes": result.PublishTimes = ReadPublishTimes(item.Value); break; case "shouldpublishat": result.ShouldPublishAt = (bool)item.Value; break; case "stabilize": result.Stabilize = (bool)item.Value; break; case "tags": result.Tags = (string)item.Value; break; case "thumbnailpath": result.ThumbnailPath = (string)item.Value; break; case "title": result.Title = (string)item.Value; break; default: break; } } return(result); }