예제 #1
0
 internal JsonSerializationContext(JsonPropertyWriter visitor, JsonAdapterCollection.Enumerator adapters, TValue value, bool isRoot)
 {
     m_Visitor  = visitor;
     m_Adapters = adapters;
     m_Value    = value;
     m_IsRoot   = isRoot;
 }
예제 #2
0
        /// <summary>
        /// Gets the shared <see cref="JsonPropertyWriter"/>.
        /// </summary>
        /// <returns>The <see cref="JsonPropertyWriter"/>.</returns>
        internal JsonPropertyWriter GetJsonPropertyWriter()
        {
            if (null != m_JsonPropertyWriter)
            {
                return(m_JsonPropertyWriter.IsLocked ? new JsonPropertyWriter() : m_JsonPropertyWriter);
            }

            m_JsonPropertyWriter = new JsonPropertyWriter();
            return(m_JsonPropertyWriter);
        }
            public WriteSerializedContainerMetadataScope(JsonPropertyWriter writer, ref TContainer container, SerializedContainerMetadata metadata)
            {
                m_Writer   = writer;
                m_Metadata = metadata;

                if (m_Metadata.Exists)
                {
                    m_Writer.m_Writer.Write("{\n");
                    m_Writer.Indent++;

                    writer.WriteSerializedContainerMetadata(ref container, m_Metadata);

                    m_Writer.m_Writer.Write(",\n");
                    m_Writer.m_Writer.Write(' ', Style.Space * m_Writer.Indent);
                    m_Writer.m_Writer.Write("\"");
                    m_Writer.m_Writer.Write(k_SerializedElementsKey);
                    m_Writer.m_Writer.Write("\": ");
                }
            }