Beispiel #1
0
        /// <summary>
        /// Writes a text representation of the specified <paramref name="propertyValue"/> into a text writer.
        /// </summary>
        /// <param name="propertyValue">The JSON value to write.</param>
        private void WriteProperty(JsonProperty propertyValue)
        {
            var nameTextAnnotation = propertyValue.GetAnnotation <JsonPropertyNameTextAnnotation>()
                                     ?? JsonPropertyNameTextAnnotation.GetDefault(propertyValue.Name);
            var nameValueSeparatorTextAnnotation = propertyValue.GetAnnotation <JsonPropertyNameValueSeparatorTextAnnotation>()
                                                   ?? JsonPropertyNameValueSeparatorTextAnnotation.GetDefault();

            this.writer.Write(nameTextAnnotation.Text);
            this.writer.Write(nameValueSeparatorTextAnnotation.Text);
            this.WriteValue(propertyValue.Value);
        }
        /// <summary>
        /// Writes a text representation of the specified <paramref name="propertyValue"/> into a text writer.
        /// </summary>
        /// <param name="propertyValue">The JSON value to write.</param>
        private void WriteProperty(JsonProperty propertyValue)
        {
            var nameTextAnnotation = propertyValue.GetAnnotation<JsonPropertyNameTextAnnotation>() 
                ?? JsonPropertyNameTextAnnotation.GetDefault(propertyValue.Name);
            var nameValueSeparatorTextAnnotation = propertyValue.GetAnnotation<JsonPropertyNameValueSeparatorTextAnnotation>()
                ?? JsonPropertyNameValueSeparatorTextAnnotation.GetDefault();

            this.writer.Write(nameTextAnnotation.Text);
            this.writer.Write(nameValueSeparatorTextAnnotation.Text);
            this.WriteValue(propertyValue.Value);
        }