Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/Newtonsoft.Json.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Newton-King <james@newtonking.com>2012-03-05 10:30:14 +0400
committerJames Newton-King <james@newtonking.com>2012-03-05 10:30:14 +0400
commitf8a13d7aa3bdcf9b42e253962b377c1b989cf2a3 (patch)
tree2df4e634d2e083698b4b64ff64f42f1cfeaab2d2
parentfd760e33898cc6b3badaf4a8b77a466139b87fac (diff)
-Xml documentation
-rw-r--r--Src/Newtonsoft.Json/DateFormatHandling.cs9
-rw-r--r--Src/Newtonsoft.Json/JsonConvert.cs5
-rw-r--r--Src/Newtonsoft.Json/JsonReader.cs3
-rw-r--r--Src/Newtonsoft.Json/JsonSerializer.cs12
-rw-r--r--Src/Newtonsoft.Json/JsonSerializerSettings.cs12
-rw-r--r--Src/Newtonsoft.Json/JsonWriter.cs8
6 files changed, 46 insertions, 3 deletions
diff --git a/Src/Newtonsoft.Json/DateFormatHandling.cs b/Src/Newtonsoft.Json/DateFormatHandling.cs
index 55902c7..47efaf4 100644
--- a/Src/Newtonsoft.Json/DateFormatHandling.cs
+++ b/Src/Newtonsoft.Json/DateFormatHandling.cs
@@ -1,8 +1,17 @@
namespace Newtonsoft.Json
{
+ /// <summary>
+ /// Specifies how dates are formatted when writing JSON text.
+ /// </summary>
public enum DateFormatHandling
{
+ /// <summary>
+ /// Dates are written in the ISO 8061 format, e.g. "2012-03-21T05:40Z".
+ /// </summary>
IsoDateFormat,
+ /// <summary>
+ /// Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/".
+ /// </summary>
MicrosoftDateFormat
}
} \ No newline at end of file
diff --git a/Src/Newtonsoft.Json/JsonConvert.cs b/Src/Newtonsoft.Json/JsonConvert.cs
index 210db6c..5682f8e 100644
--- a/Src/Newtonsoft.Json/JsonConvert.cs
+++ b/Src/Newtonsoft.Json/JsonConvert.cs
@@ -93,10 +93,11 @@ namespace Newtonsoft.Json
/// </summary>
/// <param name="value">The value to convert.</param>
/// <param name="format">The format the date will be converted to.</param>
+ /// <param name="timeZoneHandling">The time zone handling when the date is converted to a string.</param>
/// <returns>A JSON string representation of the <see cref="DateTime"/>.</returns>
- public static string ToString(DateTime value, DateFormatHandling format, DateTimeZoneHandling timeZoneOption)
+ public static string ToString(DateTime value, DateFormatHandling format, DateTimeZoneHandling timeZoneHandling)
{
- DateTime updatedDateTime = EnsureDateTime(value, timeZoneOption);
+ DateTime updatedDateTime = EnsureDateTime(value, timeZoneHandling);
using (StringWriter writer = StringUtils.CreateStringWriter(64))
{
diff --git a/Src/Newtonsoft.Json/JsonReader.cs b/Src/Newtonsoft.Json/JsonReader.cs
index d982bd7..c7fb0aa 100644
--- a/Src/Newtonsoft.Json/JsonReader.cs
+++ b/Src/Newtonsoft.Json/JsonReader.cs
@@ -137,6 +137,9 @@ namespace Newtonsoft.Json
protected internal set { _quoteChar = value; }
}
+ /// <summary>
+ /// Get or set how <see cref="DateTime"/> time zones are handling when reading JSON.
+ /// </summary>
public DateTimeZoneHandling DateTimeZoneHandling
{
get { return _dateTimeZoneHandling; }
diff --git a/Src/Newtonsoft.Json/JsonSerializer.cs b/Src/Newtonsoft.Json/JsonSerializer.cs
index 4f01433..e50c838 100644
--- a/Src/Newtonsoft.Json/JsonSerializer.cs
+++ b/Src/Newtonsoft.Json/JsonSerializer.cs
@@ -285,24 +285,36 @@ namespace Newtonsoft.Json
set { _context = value; }
}
+ /// <summary>
+ /// Indicates how JSON text output is formatted.
+ /// </summary>
public virtual Formatting Formatting
{
get { return _formatting ?? JsonSerializerSettings.DefaultFormatting; }
set { _formatting = value; }
}
+ /// <summary>
+ /// Get or set how dates are written to JSON text.
+ /// </summary>
public virtual DateFormatHandling DateFormatHandling
{
get { return _dateFormatHandling ?? JsonSerializerSettings.DefaultDateFormatHandling; }
set { _dateFormatHandling = value; }
}
+ /// <summary>
+ /// Get or set how <see cref="DateTime"/> time zones are handling during serialization and deserialization.
+ /// </summary>
public virtual DateTimeZoneHandling DateTimeZoneHandling
{
get { return _dateTimeZoneHandling ?? JsonSerializerSettings.DefaultDateTimeZoneHandling; }
set { _dateTimeZoneHandling = value; }
}
+ /// <summary>
+ /// Gets or sets the culture used when reading JSON. Defaults to <see cref="CultureInfo.InvariantCulture"/>.
+ /// </summary>
public virtual CultureInfo Culture
{
get { return _culture ?? JsonSerializerSettings.DefaultCulture; }
diff --git a/Src/Newtonsoft.Json/JsonSerializerSettings.cs b/Src/Newtonsoft.Json/JsonSerializerSettings.cs
index 7ab24a3..729d58a 100644
--- a/Src/Newtonsoft.Json/JsonSerializerSettings.cs
+++ b/Src/Newtonsoft.Json/JsonSerializerSettings.cs
@@ -127,24 +127,36 @@ namespace Newtonsoft.Json
/// <value>The context.</value>
public StreamingContext Context { get; set; }
+ /// <summary>
+ /// Indicates how JSON text output is formatted.
+ /// </summary>
public Formatting Formatting
{
get { return _formatting ?? DefaultFormatting; }
set { _formatting = value; }
}
+ /// <summary>
+ /// Get or set how dates are written to JSON text.
+ /// </summary>
public DateFormatHandling DateFormatHandling
{
get { return _dateFormatHandling ?? DefaultDateFormatHandling; }
set { _dateFormatHandling = value; }
}
+ /// <summary>
+ /// Get or set how <see cref="DateTime"/> time zones are handling during serialization and deserialization.
+ /// </summary>
public DateTimeZoneHandling DateTimeZoneHandling
{
get { return _dateTimeZoneHandling ?? DefaultDateTimeZoneHandling; }
set { _dateTimeZoneHandling = value; }
}
+ /// <summary>
+ /// Gets or sets the culture used when reading JSON. Defaults to <see cref="CultureInfo.InvariantCulture"/>.
+ /// </summary>
public CultureInfo Culture
{
get { return _culture ?? DefaultCulture; }
diff --git a/Src/Newtonsoft.Json/JsonWriter.cs b/Src/Newtonsoft.Json/JsonWriter.cs
index 9d4e48b..6e7f62f 100644
--- a/Src/Newtonsoft.Json/JsonWriter.cs
+++ b/Src/Newtonsoft.Json/JsonWriter.cs
@@ -204,7 +204,7 @@ namespace Newtonsoft.Json
private DateTimeZoneHandling _dateTimeZoneHandling;
/// <summary>
- /// Indicates how the output is formatted.
+ /// Indicates how JSON text output is formatted.
/// </summary>
public Formatting Formatting
{
@@ -212,12 +212,18 @@ namespace Newtonsoft.Json
set { _formatting = value; }
}
+ /// <summary>
+ /// Get or set how dates are written to JSON text.
+ /// </summary>
public DateFormatHandling DateFormatHandling
{
get { return _dateFormatHandling; }
set { _dateFormatHandling = value; }
}
+ /// <summary>
+ /// Get or set how <see cref="DateTime"/> time zones are handling when writing JSON.
+ /// </summary>
public DateTimeZoneHandling DateTimeZoneHandling
{
get { return _dateTimeZoneHandling; }