public static JSON Parse <T>(Dictionary <string, T[]> dictionary) { JSON.Pair[] pairs = new JSON.Pair[dictionary.Count]; int i = 0; foreach (KeyValuePair <string, T[]> pair in dictionary) { pairs[i] = new JSON.Pair(pair.Key, JSON.Parse <T>(pair.Value)); i++; } return(new JSON(pairs)); }
public void Merge(JSON other) { int selfCount = this.count; int otherCount = other.count; int count = selfCount + otherCount; JSON.Pair[] pairs = new JSON.Pair[count]; int i = 0; foreach (JSON.Pair val in this) { pairs[i] = new JSON.Pair(val.name, val.value); i++; } foreach (JSON.Pair val in other) { pairs[i] = new JSON.Pair(val.name, val.value); i++; } }