-Explicit enum values

This commit is contained in:
James Newton-King
2014-12-02 00:43:01 +13:00
parent 4a19ecd940
commit 209c10ddde
23 changed files with 181 additions and 181 deletions
+9 -9
View File
@@ -61,15 +61,15 @@ namespace Newtonsoft.Json.Bson
private enum BsonReaderState private enum BsonReaderState
{ {
Normal, Normal = 0,
ReferenceStart, ReferenceStart = 1,
ReferenceRef, ReferenceRef = 2,
ReferenceId, ReferenceId = 3,
CodeWScopeStart, CodeWScopeStart = 4,
CodeWScopeCode, CodeWScopeCode = 5,
CodeWScopeScope, CodeWScopeScope = 6,
CodeWScopeScopeObject, CodeWScopeScopeObject = 7,
CodeWScopeScopeEnd CodeWScopeScopeEnd = 8
} }
private class ContainerContext private class ContainerContext
+3 -3
View File
@@ -33,17 +33,17 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Date formatted strings are not parsed to a date type and are read as strings. /// Date formatted strings are not parsed to a date type and are read as strings.
/// </summary> /// </summary>
None, None = 0,
/// <summary> /// <summary>
/// Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to <see cref="DateTime"/>. /// Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to <see cref="DateTime"/>.
/// </summary> /// </summary>
DateTime, DateTime = 1,
#if !NET20 #if !NET20
/// <summary> /// <summary>
/// Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to <see cref="DateTimeOffset"/>. /// Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to <see cref="DateTimeOffset"/>.
/// </summary> /// </summary>
DateTimeOffset DateTimeOffset = 2
#endif #endif
} }
} }
+4 -4
View File
@@ -35,22 +35,22 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Treat as local time. If the <see cref="DateTime"/> object represents a Coordinated Universal Time (UTC), it is converted to the local time. /// Treat as local time. If the <see cref="DateTime"/> object represents a Coordinated Universal Time (UTC), it is converted to the local time.
/// </summary> /// </summary>
Local, Local = 0,
/// <summary> /// <summary>
/// Treat as a UTC. If the <see cref="DateTime"/> object represents a local time, it is converted to a UTC. /// Treat as a UTC. If the <see cref="DateTime"/> object represents a local time, it is converted to a UTC.
/// </summary> /// </summary>
Utc, Utc = 1,
/// <summary> /// <summary>
/// Treat as a local time if a <see cref="DateTime"/> is being converted to a string. /// Treat as a local time if a <see cref="DateTime"/> is being converted to a string.
/// If a string is being converted to <see cref="DateTime"/>, convert to a local time if a time zone is specified. /// If a string is being converted to <see cref="DateTime"/>, convert to a local time if a time zone is specified.
/// </summary> /// </summary>
Unspecified, Unspecified = 2,
/// <summary> /// <summary>
/// Time zone information should be preserved when converting. /// Time zone information should be preserved when converting.
/// </summary> /// </summary>
RoundtripKind RoundtripKind = 3
} }
} }
+3 -3
View File
@@ -34,17 +34,17 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". /// Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity".
/// </summary> /// </summary>
String, String = 0,
/// <summary> /// <summary>
/// Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. /// Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity.
/// Note that this will produce non-valid JSON. /// Note that this will produce non-valid JSON.
/// </summary> /// </summary>
Symbol, Symbol = 1,
/// <summary> /// <summary>
/// Write special floating point values as the property's default value in JSON, e.g. 0.0 for a <see cref="System.Double"/> property, null for a <see cref="System.Nullable{Double}"/> property. /// Write special floating point values as the property's default value in JSON, e.g. 0.0 for a <see cref="System.Double"/> property, null for a <see cref="System.Nullable{Double}"/> property.
/// </summary> /// </summary>
DefaultValue DefaultValue = 2
} }
} }
+2 -2
View File
@@ -33,11 +33,11 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Floating point numbers are parsed to <see cref="Double"/>. /// Floating point numbers are parsed to <see cref="Double"/>.
/// </summary> /// </summary>
Double, Double = 0,
/// <summary> /// <summary>
/// Floating point numbers are parsed to <see cref="Decimal"/>. /// Floating point numbers are parsed to <see cref="Decimal"/>.
/// </summary> /// </summary>
Decimal Decimal = 1
} }
} }
@@ -11,12 +11,12 @@ namespace System.Runtime.Serialization.Formatters
/// <summary> /// <summary>
/// In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method is used to load the assembly. /// In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method is used to load the assembly.
/// </summary> /// </summary>
Simple, Simple = 0,
/// <summary> /// <summary>
/// In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the Assembly class is used to load the assembly. /// In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the Assembly class is used to load the assembly.
/// </summary> /// </summary>
Full Full = 1
} }
} }
+2 -2
View File
@@ -33,11 +33,11 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// No special formatting is applied. This is the default. /// No special formatting is applied. This is the default.
/// </summary> /// </summary>
None, None = 0,
/// <summary> /// <summary>
/// Causes child objects to be indented according to the <see cref="JsonTextWriter.Indentation"/> and <see cref="JsonTextWriter.IndentChar"/> settings. /// Causes child objects to be indented according to the <see cref="JsonTextWriter.Indentation"/> and <see cref="JsonTextWriter.IndentChar"/> settings.
/// </summary> /// </summary>
Indented Indented = 1
} }
} }
+4 -4
View File
@@ -33,10 +33,10 @@ namespace Newtonsoft.Json
{ {
internal enum JsonContainerType internal enum JsonContainerType
{ {
None, None = 0,
Object, Object = 1,
Array, Array = 2,
Constructor Constructor = 3
} }
internal struct JsonPosition internal struct JsonPosition
+18 -18
View File
@@ -37,91 +37,91 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// This is returned by the <see cref="JsonReader"/> if a <see cref="JsonReader.Read"/> method has not been called. /// This is returned by the <see cref="JsonReader"/> if a <see cref="JsonReader.Read"/> method has not been called.
/// </summary> /// </summary>
None, None = 0,
/// <summary> /// <summary>
/// An object start token. /// An object start token.
/// </summary> /// </summary>
StartObject, StartObject = 1,
/// <summary> /// <summary>
/// An array start token. /// An array start token.
/// </summary> /// </summary>
StartArray, StartArray = 2,
/// <summary> /// <summary>
/// A constructor start token. /// A constructor start token.
/// </summary> /// </summary>
StartConstructor, StartConstructor = 3,
/// <summary> /// <summary>
/// An object property name. /// An object property name.
/// </summary> /// </summary>
PropertyName, PropertyName = 4,
/// <summary> /// <summary>
/// A comment. /// A comment.
/// </summary> /// </summary>
Comment, Comment = 5,
/// <summary> /// <summary>
/// Raw JSON. /// Raw JSON.
/// </summary> /// </summary>
Raw, Raw = 6,
/// <summary> /// <summary>
/// An integer. /// An integer.
/// </summary> /// </summary>
Integer, Integer = 7,
/// <summary> /// <summary>
/// A float. /// A float.
/// </summary> /// </summary>
Float, Float = 8,
/// <summary> /// <summary>
/// A string. /// A string.
/// </summary> /// </summary>
String, String = 9,
/// <summary> /// <summary>
/// A boolean. /// A boolean.
/// </summary> /// </summary>
Boolean, Boolean = 10,
/// <summary> /// <summary>
/// A null token. /// A null token.
/// </summary> /// </summary>
Null, Null = 11,
/// <summary> /// <summary>
/// An undefined token. /// An undefined token.
/// </summary> /// </summary>
Undefined, Undefined = 12,
/// <summary> /// <summary>
/// An object end token. /// An object end token.
/// </summary> /// </summary>
EndObject, EndObject = 13,
/// <summary> /// <summary>
/// An array end token. /// An array end token.
/// </summary> /// </summary>
EndArray, EndArray = 14,
/// <summary> /// <summary>
/// A constructor end token. /// A constructor end token.
/// </summary> /// </summary>
EndConstructor, EndConstructor = 15,
/// <summary> /// <summary>
/// A Date. /// A Date.
/// </summary> /// </summary>
Date, Date = 16,
/// <summary> /// <summary>
/// Byte data. /// Byte data.
/// </summary> /// </summary>
Bytes Bytes = 17
} }
} }
+10 -10
View File
@@ -47,16 +47,16 @@ namespace Newtonsoft.Json
{ {
internal enum State internal enum State
{ {
Start, Start = 0,
Property, Property = 1,
ObjectStart, ObjectStart = 2,
Object, Object = 3,
ArrayStart, ArrayStart = 4,
Array, Array = 5,
ConstructorStart, ConstructorStart = 6,
Constructor, Constructor = 7,
Closed, Closed = 8,
Error Error = 9
} }
// array that gives a new state based on the current state an the token being written // array that gives a new state based on the current state an the token being written
+18 -18
View File
@@ -33,91 +33,91 @@ namespace Newtonsoft.Json.Linq
/// <summary> /// <summary>
/// No token type has been set. /// No token type has been set.
/// </summary> /// </summary>
None, None = 0,
/// <summary> /// <summary>
/// A JSON object. /// A JSON object.
/// </summary> /// </summary>
Object, Object = 1,
/// <summary> /// <summary>
/// A JSON array. /// A JSON array.
/// </summary> /// </summary>
Array, Array = 2,
/// <summary> /// <summary>
/// A JSON constructor. /// A JSON constructor.
/// </summary> /// </summary>
Constructor, Constructor = 3,
/// <summary> /// <summary>
/// A JSON object property. /// A JSON object property.
/// </summary> /// </summary>
Property, Property = 4,
/// <summary> /// <summary>
/// A comment. /// A comment.
/// </summary> /// </summary>
Comment, Comment = 5,
/// <summary> /// <summary>
/// An integer value. /// An integer value.
/// </summary> /// </summary>
Integer, Integer = 6,
/// <summary> /// <summary>
/// A float value. /// A float value.
/// </summary> /// </summary>
Float, Float = 7,
/// <summary> /// <summary>
/// A string value. /// A string value.
/// </summary> /// </summary>
String, String = 8,
/// <summary> /// <summary>
/// A boolean value. /// A boolean value.
/// </summary> /// </summary>
Boolean, Boolean = 9,
/// <summary> /// <summary>
/// A null value. /// A null value.
/// </summary> /// </summary>
Null, Null = 10,
/// <summary> /// <summary>
/// An undefined value. /// An undefined value.
/// </summary> /// </summary>
Undefined, Undefined = 11,
/// <summary> /// <summary>
/// A date value. /// A date value.
/// </summary> /// </summary>
Date, Date = 12,
/// <summary> /// <summary>
/// A raw JSON value. /// A raw JSON value.
/// </summary> /// </summary>
Raw, Raw = 13,
/// <summary> /// <summary>
/// A collection of bytes value. /// A collection of bytes value.
/// </summary> /// </summary>
Bytes, Bytes = 14,
/// <summary> /// <summary>
/// A Guid value. /// A Guid value.
/// </summary> /// </summary>
Guid, Guid = 15,
/// <summary> /// <summary>
/// A Uri value. /// A Uri value.
/// </summary> /// </summary>
Uri, Uri = 16,
/// <summary> /// <summary>
/// A TimeSpan value. /// A TimeSpan value.
/// </summary> /// </summary>
TimeSpan TimeSpan = 17
} }
} }
@@ -5,16 +5,16 @@ namespace Newtonsoft.Json.Linq.JsonPath
{ {
internal enum QueryOperator internal enum QueryOperator
{ {
None, None = 0,
Equals, Equals = 1,
NotEquals, NotEquals = 2,
Exists, Exists = 3,
LessThan, LessThan = 4,
LessThanOrEquals, LessThanOrEquals = 5,
GreaterThan, GreaterThan = 6,
GreaterThanOrEquals, GreaterThanOrEquals = 7,
And, And = 8,
Or Or = 9
} }
internal abstract class QueryExpression internal abstract class QueryExpression
@@ -6,15 +6,15 @@ namespace Newtonsoft.Json.Linq
public enum MergeArrayHandling public enum MergeArrayHandling
{ {
/// <summary>Concatenate arrays.</summary> /// <summary>Concatenate arrays.</summary>
Concat, Concat = 0,
/// <summary>Union arrays, skipping items that already exist.</summary> /// <summary>Union arrays, skipping items that already exist.</summary>
Union, Union = 1,
/// <summary>Replace all array items.</summary> /// <summary>Replace all array items.</summary>
Replace, Replace = 2,
/// <summary>Merge array items together, matched by index.</summary> /// <summary>Merge array items together, matched by index.</summary>
Merge Merge = 3
} }
} }
+3 -3
View File
@@ -39,20 +39,20 @@ namespace Newtonsoft.Json
/// All public members are serialized by default. Members can be excluded using <see cref="JsonIgnoreAttribute"/> or <see cref="NonSerializedAttribute"/>. /// All public members are serialized by default. Members can be excluded using <see cref="JsonIgnoreAttribute"/> or <see cref="NonSerializedAttribute"/>.
/// This is the default member serialization mode. /// This is the default member serialization mode.
/// </summary> /// </summary>
OptOut, OptOut = 0,
/// <summary> /// <summary>
/// Only members must be marked with <see cref="JsonPropertyAttribute"/> or <see cref="DataMemberAttribute"/> are serialized. /// Only members must be marked with <see cref="JsonPropertyAttribute"/> or <see cref="DataMemberAttribute"/> are serialized.
/// This member serialization mode can also be set by marking the class with <see cref="DataContractAttribute"/>. /// This member serialization mode can also be set by marking the class with <see cref="DataContractAttribute"/>.
/// </summary> /// </summary>
OptIn, OptIn = 1,
/// <summary> /// <summary>
/// All public and private fields are serialized. Members can be excluded using <see cref="JsonIgnoreAttribute"/> or <see cref="NonSerializedAttribute"/>. /// All public and private fields are serialized. Members can be excluded using <see cref="JsonIgnoreAttribute"/> or <see cref="NonSerializedAttribute"/>.
/// This member serialization mode can also be set by marking the class with <see cref="SerializableAttribute"/> /// This member serialization mode can also be set by marking the class with <see cref="SerializableAttribute"/>
/// and setting IgnoreSerializableAttribute on <see cref="DefaultContractResolver"/> to false. /// and setting IgnoreSerializableAttribute on <see cref="DefaultContractResolver"/> to false.
/// </summary> /// </summary>
Fields Fields = 2
#pragma warning restore 1584,1711,1572,1581,1580,1574 #pragma warning restore 1584,1711,1572,1581,1580,1574
} }
} }
+3 -3
View File
@@ -33,16 +33,16 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// The property is not required. The default state. /// The property is not required. The default state.
/// </summary> /// </summary>
Default, Default = 0,
/// <summary> /// <summary>
/// The property must be defined in JSON but can be a null value. /// The property must be defined in JSON but can be a null value.
/// </summary> /// </summary>
AllowNull, AllowNull = 1,
/// <summary> /// <summary>
/// The property must be defined in JSON and cannot be a null value. /// The property must be defined in JSON and cannot be a null value.
/// </summary> /// </summary>
Always Always = 2
} }
} }
@@ -35,19 +35,19 @@ namespace Newtonsoft.Json.Serialization
{ {
internal enum JsonContractType internal enum JsonContractType
{ {
None, None = 0,
Object, Object = 1,
Array, Array = 2,
Primitive, Primitive = 3,
String, String = 4,
Dictionary, Dictionary = 5,
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20 || PORTABLE40)
Dynamic, Dynamic = 6,
#endif #endif
#if !(NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
Serializable, Serializable = 7,
#endif #endif
Linq Linq = 8
} }
/// <summary> /// <summary>
@@ -52,9 +52,9 @@ namespace Newtonsoft.Json.Serialization
{ {
internal enum PropertyPresence internal enum PropertyPresence
{ {
None, None = 0,
Null, Null = 1,
Value Value = 2
} }
private JsonSerializerProxy _internalSerializer; private JsonSerializerProxy _internalSerializer;
+3 -3
View File
@@ -33,16 +33,16 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Only control characters (e.g. newline) are escaped. /// Only control characters (e.g. newline) are escaped.
/// </summary> /// </summary>
Default, Default = 0,
/// <summary> /// <summary>
/// All non-ASCII and control characters (e.g. newline) are escaped. /// All non-ASCII and control characters (e.g. newline) are escaped.
/// </summary> /// </summary>
EscapeNonAscii, EscapeNonAscii = 1,
/// <summary> /// <summary>
/// HTML (&lt;, &gt;, &amp;, &apos;, &quot;) and control characters (e.g. newline) are escaped. /// HTML (&lt;, &gt;, &amp;, &apos;, &quot;) and control characters (e.g. newline) are escaped.
/// </summary> /// </summary>
EscapeHtml EscapeHtml = 2
} }
} }
+5 -5
View File
@@ -12,27 +12,27 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Output no tracing and debugging messages. /// Output no tracing and debugging messages.
/// </summary> /// </summary>
Off, Off = 0,
/// <summary> /// <summary>
/// Output error-handling messages. /// Output error-handling messages.
/// </summary> /// </summary>
Error, Error = 1,
/// <summary> /// <summary>
/// Output warnings and error-handling messages. /// Output warnings and error-handling messages.
/// </summary> /// </summary>
Warning, Warning = 2,
/// <summary> /// <summary>
/// Output informational messages, warnings, and error-handling messages. /// Output informational messages, warnings, and error-handling messages.
/// </summary> /// </summary>
Info, Info = 3,
/// <summary> /// <summary>
/// Output all debugging and tracing messages. /// Output all debugging and tracing messages.
/// </summary> /// </summary>
Verbose Verbose = 4
} }
} }
+50 -50
View File
@@ -46,52 +46,52 @@ namespace Newtonsoft.Json.Utilities
{ {
internal enum PrimitiveTypeCode internal enum PrimitiveTypeCode
{ {
Empty, Empty = 0,
Object, Object = 1,
Char, Char = 2,
CharNullable, CharNullable = 3,
Boolean, Boolean = 4,
BooleanNullable, BooleanNullable = 5,
SByte, SByte = 6,
SByteNullable, SByteNullable = 7,
Int16, Int16 = 8,
Int16Nullable, Int16Nullable = 9,
UInt16, UInt16 = 10,
UInt16Nullable, UInt16Nullable = 11,
Int32, Int32 = 12,
Int32Nullable, Int32Nullable = 13,
Byte, Byte = 14,
ByteNullable, ByteNullable = 15,
UInt32, UInt32 = 16,
UInt32Nullable, UInt32Nullable = 17,
Int64, Int64 = 18,
Int64Nullable, Int64Nullable = 19,
UInt64, UInt64 = 20,
UInt64Nullable, UInt64Nullable = 21,
Single, Single = 22,
SingleNullable, SingleNullable = 23,
Double, Double = 24,
DoubleNullable, DoubleNullable = 25,
DateTime, DateTime = 26,
DateTimeNullable, DateTimeNullable = 27,
#if !NET20 #if !NET20
DateTimeOffset, DateTimeOffset = 28,
DateTimeOffsetNullable, DateTimeOffsetNullable = 29,
#endif #endif
Decimal, Decimal = 30,
DecimalNullable, DecimalNullable = 31,
Guid, Guid = 32,
GuidNullable, GuidNullable = 33,
TimeSpan, TimeSpan = 34,
TimeSpanNullable, TimeSpanNullable = 35,
#if !(PORTABLE || NET35 || NET20) #if !(PORTABLE || NET35 || NET20)
BigInteger, BigInteger = 36,
BigIntegerNullable, BigIntegerNullable = 37,
#endif #endif
Uri, Uri = 38,
String, String = 39,
Bytes, Bytes = 40,
DBNull DBNull = 41
} }
internal class TypeInformation internal class TypeInformation
@@ -102,10 +102,10 @@ namespace Newtonsoft.Json.Utilities
internal enum ParseResult internal enum ParseResult
{ {
None, None = 0,
Success, Success = 1,
Overflow, Overflow = 2,
Invalid Invalid = 3
} }
internal static class ConvertUtils internal static class ConvertUtils
@@ -360,10 +360,10 @@ namespace Newtonsoft.Json.Utilities
#region TryConvert #region TryConvert
internal enum ConvertResult internal enum ConvertResult
{ {
Success, Success = 0,
CannotConvertNull, CannotConvertNull = 1,
NotInstantiableType, NotInstantiableType = 2,
NoValidConversion NoValidConversion = 3
} }
public static object Convert(object initialValue, CultureInfo culture, Type targetType) public static object Convert(object initialValue, CultureInfo culture, Type targetType)
@@ -29,10 +29,10 @@ namespace Newtonsoft.Json.Utilities
{ {
internal enum ParserTimeZone internal enum ParserTimeZone
{ {
Unspecified, Unspecified = 0,
Utc, Utc = 1,
LocalWestOfUtc, LocalWestOfUtc = 2,
LocalEastOfUtc LocalEastOfUtc = 3
} }
internal struct DateTimeParser internal struct DateTimeParser
@@ -46,11 +46,11 @@ namespace Newtonsoft.Json.Utilities
#if (NETFX_CORE || PORTABLE || PORTABLE40) #if (NETFX_CORE || PORTABLE || PORTABLE40)
internal enum MemberTypes internal enum MemberTypes
{ {
Property, Property = 0,
Field, Field = 1,
Event, Event = 2,
Method, Method = 3,
Other Other = 4
} }
#endif #endif
+7 -7
View File
@@ -37,36 +37,36 @@ namespace Newtonsoft.Json
/// You may call the <see cref="JsonWriter.Close"/> method to put the <see cref="JsonWriter"/> in the <c>Closed</c> state. /// You may call the <see cref="JsonWriter.Close"/> method to put the <see cref="JsonWriter"/> in the <c>Closed</c> state.
/// Any other <see cref="JsonWriter"/> method calls results in an <see cref="InvalidOperationException"/> being thrown. /// Any other <see cref="JsonWriter"/> method calls results in an <see cref="InvalidOperationException"/> being thrown.
/// </summary> /// </summary>
Error, Error = 0,
/// <summary> /// <summary>
/// The <see cref="JsonWriter.Close"/> method has been called. /// The <see cref="JsonWriter.Close"/> method has been called.
/// </summary> /// </summary>
Closed, Closed = 1,
/// <summary> /// <summary>
/// An object is being written. /// An object is being written.
/// </summary> /// </summary>
Object, Object = 2,
/// <summary> /// <summary>
/// A array is being written. /// A array is being written.
/// </summary> /// </summary>
Array, Array = 3,
/// <summary> /// <summary>
/// A constructor is being written. /// A constructor is being written.
/// </summary> /// </summary>
Constructor, Constructor = 4,
/// <summary> /// <summary>
/// A property is being written. /// A property is being written.
/// </summary> /// </summary>
Property, Property = 5,
/// <summary> /// <summary>
/// A write method has not been called. /// A write method has not been called.
/// </summary> /// </summary>
Start Start = 6
} }
} }