private static bool TryWriteTypeInfo(TextWriter writer, object obj) { if (obj == null || ShouldSkipType()) { return(false); } Serializer.WriteRawString(writer, JsConfig.TypeAttr); writer.Write(JsWriter.MapKeySeperator); Serializer.WriteRawString(writer, JsConfig.TypeWriter(obj.GetType())); return(true); }
private static bool TryWriteSelfType(TextWriter writer) { if (ShouldSkipType()) { return(false); } Serializer.WriteRawString(writer, JsConfig.TypeAttr); writer.Write(JsWriter.MapKeySeperator); Serializer.WriteRawString(writer, JsConfig.TypeWriter(typeof(T))); return(true); }