From 11ef223875bec1aefdae089630c0136ec191c935 Mon Sep 17 00:00:00 2001 From: JamesNK Date: Tue, 8 Apr 2008 08:56:32 +0000 Subject: [PATCH] -Added some XML comments -Made some utility methods internal --- .../JsonTextReaderTest.cs | 23 ++ Src/Newtonsoft.Json/JsonReader.cs | 3 + Src/Newtonsoft.Json/Linq/JConstructor.cs | 9 + Src/Newtonsoft.Json/Linq/JContainer.cs | 23 ++ Src/Newtonsoft.Json/Linq/JObject.cs | 10 + Src/Newtonsoft.Json/Linq/JProperty.cs | 38 +++- Src/Newtonsoft.Json/Linq/JToken.cs | 215 +++++++++++++++++- Src/Newtonsoft.Json/Linq/JValue.cs | 6 +- Src/Newtonsoft.Json/Newtonsoft.Json.csproj | 3 +- .../Utilities/DateTimeUtils.cs | 2 +- .../Utilities/DictionaryWrapper.cs | 4 +- Src/Newtonsoft.Json/Utilities/ListWrapper.cs | 4 +- 12 files changed, 317 insertions(+), 23 deletions(-) diff --git a/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs b/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs index 84a6268e..8b0112b5 100644 --- a/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs +++ b/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs @@ -305,5 +305,28 @@ namespace Newtonsoft.Json.Tests Assert.AreEqual(jsonReader.TokenType, JsonToken.EndArray); } } + + [Test] + public void LongStringTest() + { + int length = 20000; + string json = @"[""" + new string(' ', length) + @"""]"; + + JsonTextReader reader = new JsonTextReader(new StringReader(json)); + + reader.Read(); + Assert.AreEqual(JsonToken.StartArray, reader.TokenType); + + reader.Read(); + Assert.AreEqual(JsonToken.String, reader.TokenType); + Assert.AreEqual(typeof(string), reader.ValueType); + Assert.AreEqual(20000, reader.Value.ToString().Length); + + reader.Read(); + Assert.AreEqual(JsonToken.EndArray, reader.TokenType); + + reader.Read(); + Assert.AreEqual(JsonToken.EndArray, reader.TokenType); + } } } \ No newline at end of file diff --git a/Src/Newtonsoft.Json/JsonReader.cs b/Src/Newtonsoft.Json/JsonReader.cs index 267f6e90..7844eb64 100644 --- a/Src/Newtonsoft.Json/JsonReader.cs +++ b/Src/Newtonsoft.Json/JsonReader.cs @@ -307,6 +307,9 @@ namespace Newtonsoft.Json } } + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// void IDisposable.Dispose() { Dispose(true); diff --git a/Src/Newtonsoft.Json/Linq/JConstructor.cs b/Src/Newtonsoft.Json/Linq/JConstructor.cs index 9b7f2f9a..8c41c424 100644 --- a/Src/Newtonsoft.Json/Linq/JConstructor.cs +++ b/Src/Newtonsoft.Json/Linq/JConstructor.cs @@ -42,6 +42,10 @@ namespace Newtonsoft.Json.Linq set { _name = value; } } + /// + /// Gets the node type for this . + /// + /// The type. public override JsonTokenType Type { get { return JsonTokenType.Constructor; } @@ -95,6 +99,11 @@ namespace Newtonsoft.Json.Linq } } + /// + /// Writes this token to a . + /// + /// A into which this method will write. + /// A collection of which will be used when writing the token. public override void WriteTo(JsonWriter writer, params JsonConverter[] converters) { writer.WriteStartConstructor(_name); diff --git a/Src/Newtonsoft.Json/Linq/JContainer.cs b/Src/Newtonsoft.Json/Linq/JContainer.cs index ac62949e..edc0f1bf 100644 --- a/Src/Newtonsoft.Json/Linq/JContainer.cs +++ b/Src/Newtonsoft.Json/Linq/JContainer.cs @@ -48,6 +48,10 @@ namespace Newtonsoft.Json.Linq { } + /// + /// Initializes a new instance of the class from another object. + /// + /// A object to copy from. protected JContainer(JContainer other) { ValidationUtils.ArgumentNotNull(other, "c"); @@ -64,6 +68,12 @@ namespace Newtonsoft.Json.Linq } } + /// + /// Gets a value indicating whether this token has childen tokens. + /// + /// + /// true if this token has child values; otherwise, false. + /// public override bool HasValues { get { return (_content != null); } @@ -112,6 +122,12 @@ namespace Newtonsoft.Json.Linq get { return _content; } } + /// + /// Returns a collection of the child tokens of this token, in document order. + /// + /// + /// An of containing the child tokens of this , in document order. + /// public override JEnumerable Children() { return new JEnumerable(ChildrenInternal()); @@ -132,6 +148,13 @@ namespace Newtonsoft.Json.Linq && ((current = current.Next) != null)); } + /// + /// Returns a collection of the child values of this token, in document order. + /// + /// + /// + /// A containing the child values of this , in document order. + /// public override IEnumerable Values() { return Children().Convert(); diff --git a/Src/Newtonsoft.Json/Linq/JObject.cs b/Src/Newtonsoft.Json/Linq/JObject.cs index 7e37a1ed..c597b63f 100644 --- a/Src/Newtonsoft.Json/Linq/JObject.cs +++ b/Src/Newtonsoft.Json/Linq/JObject.cs @@ -33,12 +33,22 @@ using System.Globalization; namespace Newtonsoft.Json.Linq { + /// + /// Represents a JSON object. + /// public class JObject : JContainer { + /// + /// Initializes a new instance of the class. + /// public JObject() { } + /// + /// Initializes a new instance of the class from another object. + /// + /// A object to copy from. public JObject(JObject other) : base(other) { diff --git a/Src/Newtonsoft.Json/Linq/JProperty.cs b/Src/Newtonsoft.Json/Linq/JProperty.cs index d5728d06..6e07d023 100644 --- a/Src/Newtonsoft.Json/Linq/JProperty.cs +++ b/Src/Newtonsoft.Json/Linq/JProperty.cs @@ -33,26 +33,38 @@ using System.Globalization; namespace Newtonsoft.Json.Linq { + /// + /// Represents a JSON property. + /// public class JProperty : JContainer { private readonly string _name; + /// + /// Gets the property name. + /// + /// The property name. public string Name { [DebuggerStepThrough] get { return _name; } } + /// + /// Gets or sets the property value. + /// + /// The property value. public JToken Value { [DebuggerStepThrough] get { return Last; } - set - { - ReplaceAll(value); - } + set { ReplaceAll(value); } } + /// + /// Initializes a new instance of the class from another object. + /// + /// A object to copy from. public JProperty(JProperty other) : base(other) { @@ -70,12 +82,20 @@ namespace Newtonsoft.Json.Linq return new JProperty(this); } + /// + /// Gets the node type for this . + /// + /// The type. public override JsonTokenType Type { [DebuggerStepThrough] get { return JsonTokenType.Property; } } + /// + /// Initializes a new instance of the class. + /// + /// The property name. public JProperty(string name) { ValidationUtils.ArgumentNotNull(name, "name"); @@ -83,6 +103,11 @@ namespace Newtonsoft.Json.Linq _name = name; } + /// + /// Initializes a new instance of the class. + /// + /// The property name. + /// The property value. public JProperty(string name, object value) { ValidationUtils.ArgumentNotNullOrEmpty(name, "name"); @@ -99,6 +124,11 @@ namespace Newtonsoft.Json.Linq throw new ArgumentException("An item of type {0} cannot be added to content.".FormatWith(CultureInfo.InvariantCulture, o.Type)); } + /// + /// Writes this token to a . + /// + /// A into which this method will write. + /// A collection of which will be used when writing the token. public override void WriteTo(JsonWriter writer, params JsonConverter[] converters) { writer.WritePropertyName(_name); diff --git a/Src/Newtonsoft.Json/Linq/JToken.cs b/Src/Newtonsoft.Json/Linq/JToken.cs index 5400905f..5e6de856 100644 --- a/Src/Newtonsoft.Json/Linq/JToken.cs +++ b/Src/Newtonsoft.Json/Linq/JToken.cs @@ -34,11 +34,18 @@ using System.Globalization; namespace Newtonsoft.Json.Linq { + /// + /// Represents an abstract JSON token. + /// public abstract class JToken { private JContainer _parent; internal JToken _next; + /// + /// Gets or sets the parent. + /// + /// The parent. public JContainer Parent { [DebuggerStepThrough] @@ -46,6 +53,10 @@ namespace Newtonsoft.Json.Linq internal set { _parent = value; } } + /// + /// Gets the root of this . + /// + /// The root of this . public JToken Root { get @@ -66,14 +77,35 @@ namespace Newtonsoft.Json.Linq internal abstract JToken CloneNode(); internal abstract bool DeepEquals(JToken node); + /// + /// Gets the node type for this . + /// + /// The type. public abstract JsonTokenType Type { get; } + + /// + /// Gets a value indicating whether this token has childen tokens. + /// + /// + /// true if this token has child values; otherwise, false. + /// public abstract bool HasValues { get; } + /// + /// Compares the values of two tokens, including the values of all descendant tokens. + /// + /// The first to compare. + /// The second to compare. + /// true if the tokens are equal; otherwise false. public static bool DeepEquals(JToken t1, JToken t2) { return (t1 == t2 || (t1 != null && t2 != null && t1.DeepEquals(t2))); } + /// + /// Gets the next sibling token of this node. + /// + /// The that contains the next sibling token. public JToken Next { get @@ -86,6 +118,10 @@ namespace Newtonsoft.Json.Linq internal set { _next = value; } } + /// + /// Gets the previous sibling token of this node. + /// + /// The that contains the previous sibling token. public JToken Previous { get @@ -104,6 +140,10 @@ namespace Newtonsoft.Json.Linq } } + /// + /// Returns a collection of the ancestor tokens of this token. + /// + /// A collection of the ancestor tokens of this token. public IEnumerable Ancestors() { for (JToken parent = Parent; parent != null; parent = parent.Parent) @@ -112,6 +152,10 @@ namespace Newtonsoft.Json.Linq } } + /// + /// Returns a collection of the sibling tokens after this token, in document order. + /// + /// A collection of the sibling tokens after this tokens, in document order. public IEnumerable AfterSelf() { if (Parent == null) @@ -121,17 +165,31 @@ namespace Newtonsoft.Json.Linq yield return o; } + /// + /// Returns a collection of the sibling tokens before this token, in document order. + /// + /// A collection of the sibling tokens before this token, in document order. public IEnumerable BeforeSelf() { for (JToken o = Parent.First; o != this; o = o.Next) yield return o; } + /// + /// Gets the with the specified key. + /// + /// The with the specified key. public virtual JToken this[object key] { get { throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); } } + /// + /// Gets the with the specified key converted to the specified type. + /// + /// The type to convert the token to. + /// The token key. + /// The converted token value. public virtual T Value(object key) { JToken token = this[key]; @@ -139,40 +197,54 @@ namespace Newtonsoft.Json.Linq return Extensions.Convert(token); } + /// + /// Get the first child token of this token. + /// + /// A containing the first child token of the . public virtual JToken First { get { throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); } - //get { return null; } } + /// + /// Get the last child token of this token. + /// + /// A containing the last child token of the . public virtual JToken Last { get { throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); } - //get { return null; } } + /// + /// Returns a collection of the child tokens of this token, in document order. + /// + /// An of containing the child tokens of this , in document order. public virtual JEnumerable Children() { throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); - //return JEnumerable.Empty; } + /// + /// Returns a collection of the child tokens of this token, in document order. + /// + /// A containing the child tokens of this , in document order. public JEnumerable Children() where T : JToken { return new JEnumerable(Children().OfType()); } + /// + /// Returns a collection of the child values of this token, in document order. + /// + /// A containing the child values of this , in document order. public virtual IEnumerable Values() { throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); } - //public virtual IEnumerable Children() - // { - // throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); - // //return Enumerable.Empty(); - // } - + /// + /// Removes this token from its parent. + /// public void Remove() { if (_parent == null) @@ -181,6 +253,10 @@ namespace Newtonsoft.Json.Linq _parent.Remove(this); } + /// + /// Replaces this token with the specified token. + /// + /// The value. public void Replace(JToken value) { if (_parent == null) @@ -202,13 +278,29 @@ namespace Newtonsoft.Json.Linq parent.AddInternal(isLast, previous, value); } + /// + /// Writes this token to a . + /// + /// A into which this method will write. + /// A collection of which will be used when writing the token. public abstract void WriteTo(JsonWriter writer, params JsonConverter[] converters); + /// + /// Returns the indented JSON for this token. + /// + /// + /// A containing the indented JSON. + /// public override string ToString() { return ToString(null); } + /// + /// Returns the indented JSON for this token using any given converters. + /// + /// A collection of which will be used when writing the token. + /// private string ToString(params JsonConverter[] converters) { using (StringWriter sw = new StringWriter(CultureInfo.InvariantCulture)) @@ -271,6 +363,11 @@ namespace Newtonsoft.Json.Linq } #region Cast operators + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator bool(JToken value) { JValue v = EnsureValue(value); @@ -280,6 +377,11 @@ namespace Newtonsoft.Json.Linq return (bool)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator DateTimeOffset(JToken value) { JValue v = EnsureValue(value); @@ -289,6 +391,11 @@ namespace Newtonsoft.Json.Linq return (DateTimeOffset)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator bool?(JToken value) { if (value == null) @@ -301,6 +408,11 @@ namespace Newtonsoft.Json.Linq return (bool?)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator long(JToken value) { JValue v = EnsureValue(value); @@ -310,6 +422,11 @@ namespace Newtonsoft.Json.Linq return (long)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator DateTime?(JToken value) { if (value == null) @@ -322,6 +439,11 @@ namespace Newtonsoft.Json.Linq return (DateTime?)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator DateTimeOffset?(JToken value) { if (value == null) @@ -334,6 +456,11 @@ namespace Newtonsoft.Json.Linq return (DateTimeOffset?)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator decimal?(JToken value) { if (value == null) @@ -346,6 +473,11 @@ namespace Newtonsoft.Json.Linq return (decimal?)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator double?(JToken value) { if (value == null) @@ -358,6 +490,11 @@ namespace Newtonsoft.Json.Linq return (double?)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator int(JToken value) { JValue v = EnsureValue(value); @@ -367,6 +504,11 @@ namespace Newtonsoft.Json.Linq return Convert.ToInt32(v.Value, CultureInfo.InvariantCulture); } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator int?(JToken value) { if (value == null) @@ -379,6 +521,11 @@ namespace Newtonsoft.Json.Linq return (v.Value != null) ? (int?)Convert.ToInt32(v.Value, CultureInfo.InvariantCulture) : null; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator DateTime(JToken value) { JValue v = EnsureValue(value); @@ -388,6 +535,11 @@ namespace Newtonsoft.Json.Linq return (DateTime)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator long?(JToken value) { if (value == null) @@ -400,6 +552,11 @@ namespace Newtonsoft.Json.Linq return (long?)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator float?(JToken value) { if (value == null) @@ -412,6 +569,11 @@ namespace Newtonsoft.Json.Linq return (float?)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator decimal(JToken value) { JValue v = EnsureValue(value); @@ -421,6 +583,11 @@ namespace Newtonsoft.Json.Linq return (decimal)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator uint?(JToken value) { if (value == null) @@ -433,6 +600,11 @@ namespace Newtonsoft.Json.Linq return (uint?)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator ulong?(JToken value) { if (value == null) @@ -445,6 +617,11 @@ namespace Newtonsoft.Json.Linq return (ulong?)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator double(JToken value) { JValue v = EnsureValue(value); @@ -454,6 +631,11 @@ namespace Newtonsoft.Json.Linq return (double)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator float(JToken value) { JValue v = EnsureValue(value); @@ -463,6 +645,11 @@ namespace Newtonsoft.Json.Linq return Convert.ToSingle(v.Value, CultureInfo.InvariantCulture); } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator string(JToken value) { if (value == null) @@ -475,6 +662,11 @@ namespace Newtonsoft.Json.Linq return (string)v.Value; } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator uint(JToken value) { JValue v = EnsureValue(value); @@ -484,6 +676,11 @@ namespace Newtonsoft.Json.Linq return Convert.ToUInt32(v.Value, CultureInfo.InvariantCulture); } + /// + /// Performs an explicit conversion from to . + /// + /// The value. + /// The result of the conversion. public static explicit operator ulong(JToken value) { JValue v = EnsureValue(value); diff --git a/Src/Newtonsoft.Json/Linq/JValue.cs b/Src/Newtonsoft.Json/Linq/JValue.cs index 7b81435f..c6eb2bd8 100644 --- a/Src/Newtonsoft.Json/Linq/JValue.cs +++ b/Src/Newtonsoft.Json/Linq/JValue.cs @@ -109,11 +109,11 @@ namespace Newtonsoft.Json.Linq { case JsonTokenType.Integer: if (objA is ulong || objB is ulong) - return Convert.ToDecimal(objA).Equals(Convert.ToDecimal(objB)); + return Convert.ToDecimal(objA, CultureInfo.InvariantCulture).Equals(Convert.ToDecimal(objB, CultureInfo.InvariantCulture)); else - return Convert.ToInt64(objA).Equals(Convert.ToInt64(objB)); + return Convert.ToInt64(objA, CultureInfo.InvariantCulture).Equals(Convert.ToInt64(objB, CultureInfo.InvariantCulture)); case JsonTokenType.Float: - return Convert.ToDouble(objA).Equals(Convert.ToDouble(objB)); + return Convert.ToDouble(objA, CultureInfo.InvariantCulture).Equals(Convert.ToDouble(objB, CultureInfo.InvariantCulture)); case JsonTokenType.Comment: case JsonTokenType.String: case JsonTokenType.Boolean: diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.csproj index ff3ec3ac..b8008a4e 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.csproj @@ -50,8 +50,7 @@ DEBUG;TRACE prompt 4 - - + bin\Debug\Newtonsoft.Json.XML true -Microsoft.Design#CA1012;-Microsoft.Design#CA2210;-Microsoft.Design#CA1040;-Microsoft.Design#CA1005;-Microsoft.Design#CA1020;-Microsoft.Design#CA1021;-Microsoft.Design#CA1010;-Microsoft.Design#CA1011;-Microsoft.Design#CA1009;-Microsoft.Design#CA1050;-Microsoft.Design#CA1026;-Microsoft.Design#CA1019;-Microsoft.Design#CA1031;-Microsoft.Design#CA1047;-Microsoft.Design#CA1000;-Microsoft.Design#CA1048;-Microsoft.Design#CA1051;-Microsoft.Design#CA1002;-Microsoft.Design#CA1061;-Microsoft.Design#CA1006;-Microsoft.Design#CA1046;-Microsoft.Design#CA1045;-Microsoft.Design#CA1065;-Microsoft.Design#CA1038;-Microsoft.Design#CA1008;-Microsoft.Design#CA1028;-Microsoft.Design#CA1064;-Microsoft.Design#CA1004;-Microsoft.Design#CA1035;-Microsoft.Design#CA1063;-Microsoft.Design#CA1032;-Microsoft.Design#CA1023;-Microsoft.Design#CA1033;-Microsoft.Design#CA1039;-Microsoft.Design#CA1016;-Microsoft.Design#CA1014;-Microsoft.Design#CA1017;-Microsoft.Design#CA1018;-Microsoft.Design#CA1027;-Microsoft.Design#CA1059;-Microsoft.Design#CA1060;-Microsoft.Design#CA1034;-Microsoft.Design#CA1013;-Microsoft.Design#CA1036;-Microsoft.Design#CA1044;-Microsoft.Design#CA1041;-Microsoft.Design#CA1025;-Microsoft.Design#CA1052;-Microsoft.Design#CA1053;-Microsoft.Design#CA1057;-Microsoft.Design#CA1058;-Microsoft.Design#CA1001;-Microsoft.Design#CA1049;-Microsoft.Design#CA1054;-Microsoft.Design#CA1056;-Microsoft.Design#CA1055;-Microsoft.Design#CA1030;-Microsoft.Design#CA1003;-Microsoft.Design#CA1007;-Microsoft.Design#CA1043;-Microsoft.Design#CA1024;-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302;-Microsoft.Globalization#CA1308;-Microsoft.Globalization#CA1306;-Microsoft.Globalization#CA2101;-Microsoft.Globalization#CA1300;-Microsoft.Globalization#CA1307;-Microsoft.Globalization#CA1309;-Microsoft.Interoperability#CA1403;-Microsoft.Interoperability#CA1406;-Microsoft.Interoperability#CA1413;-Microsoft.Interoperability#CA1402;-Microsoft.Interoperability#CA1407;-Microsoft.Interoperability#CA1404;-Microsoft.Interoperability#CA1410;-Microsoft.Interoperability#CA1411;-Microsoft.Interoperability#CA1405;-Microsoft.Interoperability#CA1409;-Microsoft.Interoperability#CA1415;-Microsoft.Interoperability#CA1408;-Microsoft.Interoperability#CA1414;-Microsoft.Interoperability#CA1412;-Microsoft.Interoperability#CA1400;-Microsoft.Interoperability#CA1401;-Microsoft.Maintainability#CA1506;-Microsoft.Maintainability#CA1502;-Microsoft.Maintainability#CA1501;-Microsoft.Maintainability#CA1505;-Microsoft.Maintainability#CA1504;-Microsoft.Maintainability#CA1500;-Microsoft.Mobility#CA1600;-Microsoft.Mobility#CA1601;-Microsoft.Naming#CA1702;-Microsoft.Naming#CA1700;-Microsoft.Naming#CA1712;-Microsoft.Naming#CA1713;-Microsoft.Naming#CA1714;-Microsoft.Naming#CA1709;-Microsoft.Naming#CA1704;-Microsoft.Naming#CA1708;-Microsoft.Naming#CA1715;-Microsoft.Naming#CA1710;-Microsoft.Naming#CA1720;-Microsoft.Naming#CA1707;-Microsoft.Naming#CA1722;-Microsoft.Naming#CA1711;-Microsoft.Naming#CA1716;-Microsoft.Naming#CA1717;-Microsoft.Naming#CA1725;-Microsoft.Naming#CA1719;-Microsoft.Naming#CA1721;-Microsoft.Naming#CA1701;-Microsoft.Naming#CA1703;-Microsoft.Naming#CA1724;-Microsoft.Naming#CA1726;-Microsoft.Performance#CA1809;-Microsoft.Performance#CA1811;-Microsoft.Performance#CA1812;-Microsoft.Performance#CA1813;-Microsoft.Performance#CA1823;-Microsoft.Performance#CA1800;-Microsoft.Performance#CA1805;-Microsoft.Performance#CA1810;-Microsoft.Performance#CA1824;-Microsoft.Performance#CA1822;-Microsoft.Performance#CA1815;-Microsoft.Performance#CA1814;-Microsoft.Performance#CA1819;-Microsoft.Performance#CA1821;-Microsoft.Performance#CA1804;-Microsoft.Performance#CA1820;-Microsoft.Performance#CA1802;-Microsoft.Portability#CA1901;-Microsoft.Portability#CA1900;-Microsoft.Reliability#CA2001;-Microsoft.Reliability#CA2002;-Microsoft.Reliability#CA2003;-Microsoft.Reliability#CA2004;-Microsoft.Reliability#CA2006;-Microsoft.Security#CA2116;-Microsoft.Security#CA2117;-Microsoft.Security#CA2105;-Microsoft.Security#CA2115;-Microsoft.Security#CA2102;-Microsoft.Security#CA2104;-Microsoft.Security#CA2122;-Microsoft.Security#CA2114;-Microsoft.Security#CA2123;-Microsoft.Security#CA2111;-Microsoft.Security#CA2108;-Microsoft.Security#CA2107;-Microsoft.Security#CA2103;-Microsoft.Security#CA2118;-Microsoft.Security#CA2109;-Microsoft.Security#CA2119;-Microsoft.Security#CA2106;-Microsoft.Security#CA2112;-Microsoft.Security#CA2120;-Microsoft.Security#CA2121;-Microsoft.Security#CA2126;-Microsoft.Security#CA2124;-Microsoft.Security#CA2127;-Microsoft.Security#CA2128;-Microsoft.Security#CA2129;-Microsoft.Usage#CA2243;-Microsoft.Usage#CA2236;-Microsoft.Usage#CA1816;-Microsoft.Usage#CA2227;-Microsoft.Usage#CA2213;-Microsoft.Usage#CA2216;-Microsoft.Usage#CA2214;-Microsoft.Usage#CA2222;-Microsoft.Usage#CA1806;-Microsoft.Usage#CA2217;-Microsoft.Usage#CA2212;-Microsoft.Usage#CA2219;-Microsoft.Usage#CA2201;-Microsoft.Usage#CA2228;-Microsoft.Usage#CA2221;-Microsoft.Usage#CA2220;-Microsoft.Usage#CA2240;-Microsoft.Usage#CA2229;-Microsoft.Usage#CA2238;-Microsoft.Usage#CA2207;-Microsoft.Usage#CA2208;-Microsoft.Usage#CA2235;-Microsoft.Usage#CA2237;-Microsoft.Usage#CA2232;-Microsoft.Usage#CA2223;-Microsoft.Usage#CA2211;-Microsoft.Usage#CA2233;-Microsoft.Usage#CA2225;-Microsoft.Usage#CA2226;-Microsoft.Usage#CA2231;-Microsoft.Usage#CA2224;-Microsoft.Usage#CA2218;-Microsoft.Usage#CA2234;-Microsoft.Usage#CA2239;-Microsoft.Usage#CA2200;-Microsoft.Usage#CA1801;-Microsoft.Usage#CA2242;-Microsoft.Usage#CA2205;-Microsoft.Usage#CA2230 diff --git a/Src/Newtonsoft.Json/Utilities/DateTimeUtils.cs b/Src/Newtonsoft.Json/Utilities/DateTimeUtils.cs index 7933e352..f968c927 100644 --- a/Src/Newtonsoft.Json/Utilities/DateTimeUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/DateTimeUtils.cs @@ -7,7 +7,7 @@ using System.Globalization; namespace Newtonsoft.Json.Utilities { - public static class DateTimeUtils + internal static class DateTimeUtils { public static string GetLocalOffset(this DateTime d) { diff --git a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs index d2db5637..ab886a2d 100644 --- a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs +++ b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs @@ -7,12 +7,12 @@ using System.Threading; namespace Newtonsoft.Json.Utilities { - public interface IWrappedDictionary : IDictionary + internal interface IWrappedDictionary : IDictionary { object UnderlyingDictionary { get; } } - public class DictionaryWrapper : IDictionary, IWrappedDictionary + internal class DictionaryWrapper : IDictionary, IWrappedDictionary { private readonly IDictionary _dictionary; private readonly IDictionary _genericDictionary; diff --git a/Src/Newtonsoft.Json/Utilities/ListWrapper.cs b/Src/Newtonsoft.Json/Utilities/ListWrapper.cs index 9e18d062..014362fa 100644 --- a/Src/Newtonsoft.Json/Utilities/ListWrapper.cs +++ b/Src/Newtonsoft.Json/Utilities/ListWrapper.cs @@ -33,12 +33,12 @@ using System.Globalization; namespace Newtonsoft.Json.Utilities { - public interface IWrappedList : IList + internal interface IWrappedList : IList { object UnderlyingList { get; } } - public class ListWrapper : IList, IWrappedList + internal class ListWrapper : IList, IWrappedList { private readonly IList _list; private readonly IList _genericList;