private void parseRepositoryFile(JSONResponse jresponse, ref RRepositoryFileDetails fileDetails) { List<String> authors = new List<String>(); JObject jfile = jresponse.JSONMarkup; if (!(jfile == null)) { String category = JSONUtilities.trimXtraQuotes(jfile["category"].Value<string>()); String filename = JSONUtilities.trimXtraQuotes(jfile["filename"].Value<string>()); String author = JSONUtilities.trimXtraQuotes(jfile["author"].Value<string>()); int length = jfile["length"].Value<int>(); String type = JSONUtilities.trimXtraQuotes(jfile["type"].Value<string>()); String url = JSONUtilities.trimXtraQuotes(jfile["url"].Value<string>()); String latestby = JSONUtilities.trimXtraQuotes(jfile["latestby"].Value<string>()); String lastModified = JSONUtilities.trimXtraQuotes(jfile["lastModified"].Value<string>()); Boolean sharedUsers = jfile["shared"].Value<Boolean>(); Boolean published = jfile["published"].Value<Boolean>(); String restricted = JSONUtilities.trimXtraQuotes(jfile["restricted"].Value<string>()); String access = JSONUtilities.trimXtraQuotes(jfile["access"].Value<string>()); String directory = JSONUtilities.trimXtraQuotes(jfile["directory"].Value<string>()); String inputs = ""; if (!(jfile["inputs"] == null)) { inputs = JSONUtilities.trimXtraQuotes(jfile["inputs"].Value<string>()); } String outputs = ""; if (!(jfile["outputs"] == null)) { outputs = JSONUtilities.trimXtraQuotes(jfile["outputs"].Value<string>()); } String version = JSONUtilities.trimXtraQuotes(jfile["version"].Value<string>()); if (version == "null") { version = ""; } if (!(jfile["authors"] == null)) { JArray jvalues = jfile["authors"].Value<JArray>(); foreach (var j in jvalues) { if (j.Type != JTokenType.Null) { authors.Add(j.Value<string>()); } } } fileDetails = new RRepositoryFileDetails(category, filename, author, version, latestby, lastModified, length, type, url, sharedUsers, published, restricted, access, authors, inputs, outputs, directory); } }
private void parseRepositoryFile(JSONResponse jresponse, ref RRepositoryFileDetails fileDetails) { List <String> authors = new List <String>(); JObject jfile = jresponse.JSONMarkup; if (!(jfile == null)) { String category = JSONUtilities.trimXtraQuotes(jfile["category"].Value <string>()); String filename = JSONUtilities.trimXtraQuotes(jfile["filename"].Value <string>()); String author = JSONUtilities.trimXtraQuotes(jfile["author"].Value <string>()); int length = jfile["length"].Value <int>(); String type = JSONUtilities.trimXtraQuotes(jfile["type"].Value <string>()); String url = JSONUtilities.trimXtraQuotes(jfile["url"].Value <string>()); String latestby = JSONUtilities.trimXtraQuotes(jfile["latestby"].Value <string>()); String lastModified = JSONUtilities.trimXtraQuotes(jfile["lastModified"].Value <string>()); Boolean sharedUsers = jfile["shared"].Value <Boolean>(); Boolean published = jfile["published"].Value <Boolean>(); String restricted = JSONUtilities.trimXtraQuotes(jfile["restricted"].Value <string>()); String access = JSONUtilities.trimXtraQuotes(jfile["access"].Value <string>()); String directory = JSONUtilities.trimXtraQuotes(jfile["directory"].Value <string>()); String inputs = ""; if (!(jfile["inputs"] == null)) { inputs = JSONUtilities.trimXtraQuotes(jfile["inputs"].Value <string>()); } String outputs = ""; if (!(jfile["outputs"] == null)) { outputs = JSONUtilities.trimXtraQuotes(jfile["outputs"].Value <string>()); } String version = JSONUtilities.trimXtraQuotes(jfile["version"].Value <string>()); if (version == "null") { version = ""; } if (!(jfile["authors"] == null)) { JArray jvalues = jfile["authors"].Value <JArray>(); foreach (var j in jvalues) { if (j.Type != JTokenType.Null) { authors.Add(j.Value <string>()); } } } fileDetails = new RRepositoryFileDetails(category, filename, author, version, latestby, lastModified, length, type, url, sharedUsers, published, restricted, access, authors, inputs, outputs, directory); } }