Пример #1
0
 /// <summary>
 /// Get this object serialized as JSON string.
 /// </summary>
 /// <returns>This object as JSON string.</returns>
 public string ToJson()
 {
     return(CustomJavaScriptSerializer.JsonSerialize(this));
 }
Пример #2
0
 /// <summary>
 /// Converts the specified JSON string to an object of type <typeparamref name="T"/>.
 /// </summary>
 /// <typeparam name="T">The type of the resulting object.</typeparam>
 /// <param name="input">The JSON string to be deserialized.</param>
 /// <returns>The deserialized object.</returns>
 public static T JsonDeserialize <T>(string input)
 {
     return((T)CustomJavaScriptSerializer.JsonDeserialize(input, typeof(T)));
 }