public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.Value == null) { return((MinHtml)null); } // we assume the MinHtml is always clean when serialized MinHtml mHtml = Activator.CreateInstance(objectType, reader.Value as string, true) as MinHtml; return(mHtml); }
public SimpleSwitchable() { Text = new MinHtml(); Image = new Image(); Heading = new BbText(); }