public void RegisterObj(JsonReaderCreater obj) { if (Parent != null) { Parent.RegisterObj(obj); return; } Objects[obj.Type] = obj; }
public JsonReaderCreater(string name, JObject obj, JsonReaderCreater parent = null, string type = null, string prefix = null) { _prefix = prefix; Parent = parent; Type = Prefix + (type ?? name ?? "_unknown_"); if (parent != null) { parent.RegisterObj(this); } foreach (var keypair in obj) { if (Fields.TryGetValue(keypair.Key, out var val)) { if (val == null) { Fields[keypair.Key] = getToken(keypair.Key, keypair.Value); } } else { Fields[keypair.Key] = getToken(keypair.Key, keypair.Value); } } }