Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The solution for this is as following. JavaScriptSerializer creates object ('o') from json string ('json'), than method BuildVariablesList traverse the object and populates dictionary ('additionalParameters') that contains results. </p> <pre><code> var jss = new JavaScriptSerializer(); var o = return new DynamicJsonObject(jss.Deserialize&lt;Dictionary&lt;string, object&gt;&gt;(json)); var additionalParameters = new Dictionary&lt;string, string&gt;(); BuildVariablesList(o.GetInternalDictionary(), "", additionalParameters); private static string AppendToPathString (string path, object part ) { return path.Trim().Length == 0 ? part.ToString() : path + '.' + part; } public static void BuildVariablesList(object obj, string path, Dictionary&lt;string, string&gt; result) { if ( obj is ArrayList) { var arrayObj = obj as ArrayList; for (var i = 0; i&lt;arrayObj.Count; i++ ) { BuildVariablesList(arrayObj[i], AppendToPathString(path,i), result); } }else if ( obj is Dictionary&lt;string, object&gt;) { var dictObject = obj as Dictionary&lt;string, object&gt;; foreach (var entry in dictObject) { if (entry.Value is String &amp;&amp; (path.Trim().Length &gt; 0 || !ReservedFieldNames.Contains( entry.Key.ToLower()))) { result.Add(AppendToPathString(path,entry.Key), entry.Value as String); } else if (entry.Value is Dictionary&lt;string, object&gt;) { BuildVariablesList(entry.Value as Dictionary&lt;string, object&gt;, AppendToPathString(path, entry.Key), result); } else if (entry.Value is ArrayList) { BuildVariablesList(entry.Value as ArrayList, AppendToPathString(path, entry.Key), result); } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload