示例#1
0
        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);
        }
示例#2
0
        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);
        }