From ea2897c1b30303df8f2ddf6b88ab2b2062c37d16 Mon Sep 17 00:00:00 2001 From: JamesNK Date: Sat, 1 Oct 2011 12:11:51 +0000 Subject: [PATCH] -Clean up compiler warnings --- Src/Newtonsoft.Json/JsonWriter.cs | 6 +++--- Src/Newtonsoft.Json/Linq/JArray.cs | 4 ++++ Src/Newtonsoft.Json/Linq/JConstructor.cs | 4 ++++ Src/Newtonsoft.Json/Linq/JContainer.cs | 8 ++++++++ Src/Newtonsoft.Json/Linq/JObject.cs | 4 ++++ Src/Newtonsoft.Json/Linq/JProperty.cs | 4 ++++ .../Serialization/DefaultSerializationBinder.cs | 6 ++++++ 7 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Src/Newtonsoft.Json/JsonWriter.cs b/Src/Newtonsoft.Json/JsonWriter.cs index 0db37e95..03ac0b25 100644 --- a/Src/Newtonsoft.Json/JsonWriter.cs +++ b/Src/Newtonsoft.Json/JsonWriter.cs @@ -353,16 +353,16 @@ namespace Newtonsoft.Json WriteComment(reader.Value.ToString()); break; case JsonToken.Integer: - WriteValue(Convert.ToInt64(reader.Value)); + WriteValue(Convert.ToInt64(reader.Value, CultureInfo.InvariantCulture)); break; case JsonToken.Float: - WriteValue(Convert.ToDouble(reader.Value)); + WriteValue(Convert.ToDouble(reader.Value, CultureInfo.InvariantCulture)); break; case JsonToken.String: WriteValue(reader.Value.ToString()); break; case JsonToken.Boolean: - WriteValue(Convert.ToBoolean(reader.Value)); + WriteValue(Convert.ToBoolean(reader.Value, CultureInfo.InvariantCulture)); break; case JsonToken.Null: WriteNull(); diff --git a/Src/Newtonsoft.Json/Linq/JArray.cs b/Src/Newtonsoft.Json/Linq/JArray.cs index 39cfd332..1c5ff74b 100644 --- a/Src/Newtonsoft.Json/Linq/JArray.cs +++ b/Src/Newtonsoft.Json/Linq/JArray.cs @@ -41,6 +41,10 @@ namespace Newtonsoft.Json.Linq { private IList _values = new List(); + /// + /// Gets the container's children tokens. + /// + /// The container's children tokens. protected override IList ChildrenTokens { get { return _values; } diff --git a/Src/Newtonsoft.Json/Linq/JConstructor.cs b/Src/Newtonsoft.Json/Linq/JConstructor.cs index 9b0175f7..c2e0c5d2 100644 --- a/Src/Newtonsoft.Json/Linq/JConstructor.cs +++ b/Src/Newtonsoft.Json/Linq/JConstructor.cs @@ -40,6 +40,10 @@ namespace Newtonsoft.Json.Linq private string _name; private IList _values = new List(); + /// + /// Gets the container's children tokens. + /// + /// The container's children tokens. protected override IList ChildrenTokens { get { return _values; } diff --git a/Src/Newtonsoft.Json/Linq/JContainer.cs b/Src/Newtonsoft.Json/Linq/JContainer.cs index fd077b84..01bda6e7 100644 --- a/Src/Newtonsoft.Json/Linq/JContainer.cs +++ b/Src/Newtonsoft.Json/Linq/JContainer.cs @@ -67,6 +67,10 @@ namespace Newtonsoft.Json.Linq public event NotifyCollectionChangedEventHandler CollectionChanged; #endif + /// + /// Gets the container's children tokens. + /// + /// The container's children tokens. protected abstract IList ChildrenTokens { get; } private object _syncRoot; @@ -865,6 +869,10 @@ namespace Newtonsoft.Json.Linq CopyItemsTo(array, index); } + /// + /// Gets the count of child JSON tokens. + /// + /// The count of child JSON tokens public int Count { get { return ChildrenTokens.Count; } diff --git a/Src/Newtonsoft.Json/Linq/JObject.cs b/Src/Newtonsoft.Json/Linq/JObject.cs index fab78d5d..3091c0f9 100644 --- a/Src/Newtonsoft.Json/Linq/JObject.cs +++ b/Src/Newtonsoft.Json/Linq/JObject.cs @@ -85,6 +85,10 @@ namespace Newtonsoft.Json.Linq private JPropertKeyedCollection _properties = new JPropertKeyedCollection(StringComparer.Ordinal); + /// + /// Gets the container's children tokens. + /// + /// The container's children tokens. protected override IList ChildrenTokens { get { return _properties; } diff --git a/Src/Newtonsoft.Json/Linq/JProperty.cs b/Src/Newtonsoft.Json/Linq/JProperty.cs index 77496291..3487ab10 100644 --- a/Src/Newtonsoft.Json/Linq/JProperty.cs +++ b/Src/Newtonsoft.Json/Linq/JProperty.cs @@ -43,6 +43,10 @@ namespace Newtonsoft.Json.Linq private readonly List _content = new List(); private readonly string _name; + /// + /// Gets the container's children tokens. + /// + /// The container's children tokens. protected override IList ChildrenTokens { get { return _content; } diff --git a/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs b/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs index 798b9db8..9f0176a1 100644 --- a/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs +++ b/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs @@ -118,6 +118,12 @@ namespace Newtonsoft.Json.Serialization } #if !(NET35 || NET20) + /// + /// When overridden in a derived class, controls the binding of a serialized object to a type. + /// + /// The type of the object the formatter creates a new instance of. + /// Specifies the name of the serialized object. + /// Specifies the name of the serialized object. public override void BindToName(Type serializedType, out string assemblyName, out string typeName) { #if !SILVERLIGHT