private void parseRepositoryScript(JSONResponse jresponse, ref RRepositoryScriptDetails scriptDetails) { List <Dictionary <String, String> > inputs = new List <Dictionary <String, String> >(); List <Dictionary <String, String> > outputs = new List <Dictionary <String, String> >(); Dictionary <String, String> dic = new Dictionary <String, String>(); JObject jscript = jresponse.JSONMarkup; if (!(jscript == null)) { String name = JSONUtilities.trimXtraQuotes(jscript["name"].Value <string>()); String descr = JSONUtilities.trimXtraQuotes(jscript["descr"].Value <string>()); if (!(jscript["inputs"] == null)) { JArray jvalues = jscript["inputs"].Value <JArray>(); foreach (var j in jvalues) { if (j.Type != JTokenType.Null) { dic = new Dictionary <String, String>(); dic.Add("name", JSONUtilities.trimXtraQuotes(j["name"].Value <String>())); dic.Add("rclass", JSONUtilities.trimXtraQuotes(j["rclass"].Value <String>())); dic.Add("descr", JSONUtilities.trimXtraQuotes(j["descr"].Value <String>())); dic.Add("type", JSONUtilities.trimXtraQuotes(j["type"].Value <String>())); inputs.Add(dic); } } } if (!(jscript["outputs"] == null)) { JArray jvalues = jscript["outputs"].Value <JArray>(); foreach (var j in jvalues) { if (j.Type != JTokenType.Null) { dic = new Dictionary <String, String>(); dic.Add("name", JSONUtilities.trimXtraQuotes(j["name"].Value <String>())); dic.Add("rclass", JSONUtilities.trimXtraQuotes(j["rclass"].Value <String>())); dic.Add("descr", JSONUtilities.trimXtraQuotes(j["descr"].Value <String>())); dic.Add("type", JSONUtilities.trimXtraQuotes(j["type"].Value <String>())); outputs.Add(dic); } } } scriptDetails = new RRepositoryScriptDetails(descr, inputs, name, outputs); } }
private void parseRepositoryScript(JSONResponse jresponse, ref RRepositoryScriptDetails scriptDetails) { List<Dictionary<String, String>> inputs = new List<Dictionary<String, String>>(); List<Dictionary<String, String>> outputs = new List<Dictionary<String, String>>(); Dictionary<String, String> dic = new Dictionary<String, String>(); JObject jscript = jresponse.JSONMarkup; if (!(jscript == null)) { String name = JSONUtilities.trimXtraQuotes(jscript["name"].Value<string>()); String descr = JSONUtilities.trimXtraQuotes(jscript["descr"].Value<string>()); if (!(jscript["inputs"] == null)) { JArray jvalues = jscript["inputs"].Value<JArray>(); foreach (var j in jvalues) { if (j.Type != JTokenType.Null) { dic = new Dictionary<String, String>(); dic.Add("name", JSONUtilities.trimXtraQuotes(j["name"].Value<String>())); dic.Add("rclass", JSONUtilities.trimXtraQuotes(j["rclass"].Value<String>())); dic.Add("descr", JSONUtilities.trimXtraQuotes(j["descr"].Value<String>())); dic.Add("type", JSONUtilities.trimXtraQuotes(j["type"].Value<String>())); inputs.Add(dic); } } } if (!(jscript["outputs"] == null)) { JArray jvalues = jscript["outputs"].Value<JArray>(); foreach (var j in jvalues) { if (j.Type != JTokenType.Null) { dic = new Dictionary<String, String>(); dic.Add("name", JSONUtilities.trimXtraQuotes(j["name"].Value<String>())); dic.Add("rclass", JSONUtilities.trimXtraQuotes(j["rclass"].Value<String>())); dic.Add("descr", JSONUtilities.trimXtraQuotes(j["descr"].Value<String>())); dic.Add("type", JSONUtilities.trimXtraQuotes(j["type"].Value<String>())); outputs.Add(dic); } } } scriptDetails = new RRepositoryScriptDetails(descr, inputs, name, outputs); } }