private static void ResolveKey(ref string key, ref LooseDictionary dict) { string[] parts = key.Split('.'); LooseObject obj; for (int i = 0; i < parts.Length - 1; i++) { if (!dict.TryGetValue(parts[i], out obj)) throw new ArgumentException("key: Contains non-existant path."); dict = obj as LooseDictionary; if (dict == null) throw new ArgumentException("key: Contains non-dictionary in path."); } key = parts[parts.Length - 1]; }
private static void ResolveKey(ref string key, ref LooseDictionary dict) { string[] parts = key.Split('.'); LooseObject obj; for (int i = 0; i < parts.Length - 1; i++) { if (!dict.TryGetValue(parts[i], out obj)) { throw new ArgumentException("key: Contains non-existant path."); } dict = obj as LooseDictionary; if (dict == null) { throw new ArgumentException("key: Contains non-dictionary in path."); } } key = parts[parts.Length - 1]; }