public EditorField(EditorSession session, FieldInformation field, JProperty json) { Session = session; Field = field; if (field.Type != "JObject") { FieldType = session.Manifest.GetTypeInformation(field.Type); if (FieldType == null) { throw new InvalidOperationException($"Failed to find type for {field.Type}"); } } else { string typeName = json.Parent["Type"].ToString(); FieldType = session.Manifest.GetTypeInformation(typeName); if (FieldType == null) { throw new InvalidOperationException($"Failed to find type for {typeName}"); } } this.json = json; features = new List <object>(); valueInternal = session.CreateValue(FieldType, field.Wrapper, json.Value); }
public EditorKeyValuePair(EditorSession session, TypeInformation valueType, JProperty json) { Session = session; ValueType = valueType; this.json = json; Value = session.CreateValue(valueType, null, json.Value); }
public EditorList(EditorSession session, TypeInformation elementType, JToken json) { Session = session; ElementType = elementType; this.json = json; Elements = new List <IEditorValue>(); foreach (var element in json) { Elements.Add(Session.CreateValue(elementType, null, element)); } }