private static List<KeyValuePair<Utf8String, object>> Read(JsonReader json) { var jsonOutput = new List<KeyValuePair<Utf8String, object>>(); var property = new Utf8String(""); while (json.Read()) { object value; switch (json.TokenType) { case JsonReader.JsonTokenType.ObjectStart: json.ReadObjectStart(); value = null; break; case JsonReader.JsonTokenType.ObjectEnd: json.ReadObjectEnd(); property = new Utf8String(""); value = null; break; case JsonReader.JsonTokenType.ArrayStart: json.ReadArrayStart(); value = null; break; case JsonReader.JsonTokenType.ArrayEnd: json.ReadArrayEnd(); property = new Utf8String(""); value = null; break; case JsonReader.JsonTokenType.PropertyName: property = json.ReadPropertyAsString(); value = null; break; case JsonReader.JsonTokenType.PropertyValueAsString: value = json.ReadPropertyAsString(); break; case JsonReader.JsonTokenType.PropertyValueAsInt: value = json.ReadPropertyValueAsInt(); break; default: property = new Utf8String(""); value = null; break; } if (property != new Utf8String("") && value != null) { jsonOutput.Add(new KeyValuePair<Utf8String, object>(property, value)); } } return jsonOutput; }