Esempio n. 1
0
        public override void WritePropertyName(string name)
        {
            base.WritePropertyName(name);

            JavaScriptUtil.WriteEscapedJavaScriptString(fWriter, name, fQuoteChar, QuoteName);

            fWriter.Write(':');
        }
Esempio n. 2
0
 public override void WriteValue(string value)
 {
     base.WriteValue(value);
     if (value == null)
     {
         WriteValueInternal(JsonConvert.Null, JsonToken.Null);
     }
     else
     {
         JavaScriptUtil.WriteEscapedJavaScriptString(fWriter, value, fQuoteChar, true);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Converts the <see cref="String"/> to its JSON string representation.
 /// </summary>
 /// <param name="value">The value to convert.</param>
 /// <param name="delimter">The string delimiter character.</param>
 /// <returns>A JSON string representation of the <see cref="String"/>.</returns>
 public static string ToString(string value, char delimter)
 {
     return(JavaScriptUtil.ToEscapedJavaScriptString(value, delimter, true));
 }