private void AddNode(JsonNode node) { var index = Values.Count; Values.Add(new JsonValue(node.Value.Segment, node.Value.ValueType, m_index)); var parent = new JsonNode(Values, index); if (node.Value.ValueType == JsonValueType.Array) { foreach (var value in node.ArrayItems) { parent.AddNode(value); } } else if (node.Value.ValueType == JsonValueType.Object) { foreach (var kv in node.ObjectItems) { parent.AddNode(kv.Key, kv.Value); } } }