Class JToken
Represents an abstract JSON token.
Implements
Inherited Members
Namespace: Bayat.Json.Linq
Assembly: Bayat.Json.Runtime.dll
Syntax
public abstract class JToken : IJEnumerable<JToken>, IEnumerable<JToken>, IEnumerable, IJsonLineInfo, ICloneable, IDynamicMetaObjectProvider
Constructors
| Improve this Doc View SourceJToken()
Declaration
public JToken()
Properties
| Improve this Doc View SourceEqualityComparer
Gets a comparer that can compare two tokens for value equality.
Declaration
public static JTokenEqualityComparer EqualityComparer { get; }
Property Value
| Type | Description |
|---|---|
| JTokenEqualityComparer | A JTokenEqualityComparer that can compare two nodes for value equality. |
First
Get the first child token of this token.
Declaration
public virtual JToken First { get; }
Property Value
| Type | Description |
|---|---|
| JToken |
HasValues
Gets a value indicating whether this token has child tokens.
Declaration
public abstract bool HasValues { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Item[Object]
Gets the JToken with the specified key.
Declaration
public virtual JToken this[object key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | key |
Property Value
| Type | Description |
|---|---|
| JToken | The JToken with the specified key. |
Last
Get the last child token of this token.
Declaration
public virtual JToken Last { get; }
Property Value
| Type | Description |
|---|---|
| JToken |
Next
Gets the next sibling token of this node.
Declaration
public JToken Next { get; set; }
Property Value
| Type | Description |
|---|---|
| JToken | The JToken that contains the next sibling token. |
Parent
Gets or sets the parent.
Declaration
public JContainer Parent { get; set; }
Property Value
| Type | Description |
|---|---|
| JContainer | The parent. |
Path
Gets the path of the JSON token.
Declaration
public string Path { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Previous
Gets the previous sibling token of this node.
Declaration
public JToken Previous { get; set; }
Property Value
| Type | Description |
|---|---|
| JToken | The JToken that contains the previous sibling token. |
Root
Declaration
public JToken Root { get; }
Property Value
| Type | Description |
|---|---|
| JToken |
Type
Gets the node type for this JToken.
Declaration
public abstract JTokenType Type { get; }
Property Value
| Type | Description |
|---|---|
| JTokenType | The type. |
Methods
| Improve this Doc View SourceAddAfterSelf(Object)
Adds the specified content immediately after this token.
Declaration
public void AddAfterSelf(object content)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | content | A content object that contains simple content or a collection of content objects to be added after this token. |
AddAnnotation(Object)
Adds an object to the annotation list of this JToken.
Declaration
public void AddAnnotation(object annotation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | annotation | The annotation to add. |
AddBeforeSelf(Object)
Adds the specified content immediately before this token.
Declaration
public void AddBeforeSelf(object content)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | content | A content object that contains simple content or a collection of content objects to be added before this token. |
AfterSelf()
Returns a collection of the sibling tokens after this token, in document order.
Declaration
public IEnumerable<JToken> AfterSelf()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<JToken> | A collection of the sibling tokens after this tokens, in document order. |
Ancestors()
Returns a collection of the ancestor tokens of this token.
Declaration
public IEnumerable<JToken> Ancestors()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<JToken> | A collection of the ancestor tokens of this token. |
AncestorsAndSelf()
Returns a collection of tokens that contain this token, and the ancestors of this token.
Declaration
public IEnumerable<JToken> AncestorsAndSelf()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<JToken> | A collection of tokens that contain this token, and the ancestors of this token. |
Annotation(Type)
Gets the first annotation object of the specified type from this JToken.
Declaration
public object Annotation(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The Type of the annotation to retrieve. |
Returns
| Type | Description |
|---|---|
| System.Object | The first annotation object that matches the specified type, or |
Annotation<T>()
Get the first annotation object of the specified type from this JToken.
Declaration
public T Annotation<T>()
where T : class
Returns
| Type | Description |
|---|---|
| T | The first annotation object that matches the specified type, or |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the annotation to retrieve. |
Annotations(Type)
Gets a collection of annotations of the specified type for this JToken.
Declaration
public IEnumerable<object> Annotations(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The Type of the annotations to retrieve. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.Object> | An System.Collections.Generic.IEnumerable<T> of System.Object that contains the annotations that match the specified type for this JToken. |
Annotations<T>()
Gets a collection of annotations of the specified type for this JToken.
Declaration
public IEnumerable<T> Annotations<T>()
where T : class
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T> | An System.Collections.Generic.IEnumerable<T> that contains the annotations for this JToken. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the annotations to retrieve. |
BeforeSelf()
Returns a collection of the sibling tokens before this token, in document order.
Declaration
public IEnumerable<JToken> BeforeSelf()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<JToken> | A collection of the sibling tokens before this token, in document order. |
Children()
Returns a collection of the child tokens of this token, in document order.
Declaration
public virtual JEnumerable<JToken> Children()
Returns
| Type | Description |
|---|---|
| JEnumerable<JToken> | An System.Collections.Generic.IEnumerable<T> of JToken containing the child tokens of this JToken, in document order. |
Children<T>()
Returns a collection of the child tokens of this token, in document order, filtered by the specified type.
Declaration
public JEnumerable<T> Children<T>()
where T : JToken
Returns
| Type | Description |
|---|---|
| JEnumerable<T> | A JEnumerable<T> containing the child tokens of this JToken, in document order. |
Type Parameters
| Name | Description |
|---|---|
| T | The type to filter the child tokens on. |
CloneToken()
Declaration
public abstract JToken CloneToken()
Returns
| Type | Description |
|---|---|
| JToken |
CreateReader()
Creates an JsonReader for this token.
Declaration
public JsonReader CreateReader()
Returns
| Type | Description |
|---|---|
| JsonReader | An JsonReader that can be used to read this token and its descendants. |
DeepClone()
Creates a new instance of the JToken. All child tokens are recursively cloned.
Declaration
public JToken DeepClone()
Returns
| Type | Description |
|---|---|
| JToken | A new instance of the JToken. |
DeepEquals(JToken)
Declaration
public abstract bool DeepEquals(JToken node)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | node |
Returns
| Type | Description |
|---|---|
| System.Boolean |
DeepEquals(JToken, JToken)
Compares the values of two tokens, including the values of all descendant tokens.
Declaration
public static bool DeepEquals(JToken t1, JToken t2)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | t1 | The first JToken to compare. |
| JToken | t2 | The second JToken to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the tokens are equal; otherwise false. |
FromObject(Object)
Creates a JToken from an object.
Declaration
public static JToken FromObject(object o)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | o | The object that will be used to create JToken. |
Returns
| Type | Description |
|---|---|
| JToken | A JToken with the value of the specified object |
FromObject(Object, JsonSerializer)
Creates a JToken from an object using the specified JsonSerializer.
Declaration
public static JToken FromObject(object o, JsonSerializer jsonSerializer)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | o | The object that will be used to create JToken. |
| JsonSerializer | jsonSerializer | The JsonSerializer that will be used when reading the object. |
Returns
| Type | Description |
|---|---|
| JToken | A JToken with the value of the specified object |
GetAncestors(Boolean)
Declaration
public IEnumerable<JToken> GetAncestors(bool self)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | self |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<JToken> |
GetDeepHashCode()
Declaration
public abstract int GetDeepHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetMetaObject(Expression)
Returns the System.Dynamic.DynamicMetaObject responsible for binding operations performed on this object.
Declaration
protected virtual DynamicMetaObject GetMetaObject(Expression parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression | parameter | The expression tree representation of the runtime value. |
Returns
| Type | Description |
|---|---|
| System.Dynamic.DynamicMetaObject | The System.Dynamic.DynamicMetaObject to bind this object. |
Load(JsonReader)
Creates a JToken from a JsonReader.
Declaration
public static JToken Load(JsonReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonReader | reader | An JsonReader positioned at the token to read into this JToken. |
Returns
| Type | Description |
|---|---|
| JToken | An JToken that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. |
Load(JsonReader, JsonLoadSettings)
Creates a JToken from a JsonReader.
Declaration
public static JToken Load(JsonReader reader, JsonLoadSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonReader | reader | An JsonReader positioned at the token to read into this JToken. |
| JsonLoadSettings | settings | The JsonLoadSettings used to load the JSON. If this is null, default load settings will be used. |
Returns
| Type | Description |
|---|---|
| JToken | An JToken that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. |
Parse(String)
Load a JToken from a string that contains JSON.
Declaration
public static JToken Parse(string json)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | json | A System.String that contains JSON. |
Returns
| Type | Description |
|---|---|
| JToken | A JToken populated from the string that contains JSON. |
Parse(String, JsonLoadSettings)
Load a JToken from a string that contains JSON.
Declaration
public static JToken Parse(string json, JsonLoadSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | json | A System.String that contains JSON. |
| JsonLoadSettings | settings | The JsonLoadSettings used to load the JSON. If this is null, default load settings will be used. |
Returns
| Type | Description |
|---|---|
| JToken | A JToken populated from the string that contains JSON. |
ReadFrom(JsonReader)
Creates a JToken from a JsonReader.
Declaration
public static JToken ReadFrom(JsonReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonReader | reader | An JsonReader positioned at the token to read into this JToken. |
Returns
| Type | Description |
|---|---|
| JToken | An JToken that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. |
ReadFrom(JsonReader, JsonLoadSettings)
Creates a JToken from a JsonReader.
Declaration
public static JToken ReadFrom(JsonReader reader, JsonLoadSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonReader | reader | An JsonReader positioned at the token to read into this JToken. |
| JsonLoadSettings | settings | The JsonLoadSettings used to load the JSON. If this is null, default load settings will be used. |
Returns
| Type | Description |
|---|---|
| JToken | An JToken that contains the token and its descendant tokens that were read from the reader. The runtime type of the token is determined by the token type of the first token encountered in the reader. |
Remove()
Removes this token from its parent.
Declaration
public void Remove()
RemoveAnnotations(Type)
Removes the annotations of the specified type from this JToken.
Declaration
public void RemoveAnnotations(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The Type of annotations to remove. |
RemoveAnnotations<T>()
Removes the annotations of the specified type from this JToken.
Declaration
public void RemoveAnnotations<T>()
where T : class
Type Parameters
| Name | Description |
|---|---|
| T | The type of annotations to remove. |
Replace(JToken)
Replaces this token with the specified token.
Declaration
public void Replace(JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
SelectToken(String)
Selects a JToken using a JPath expression. Selects the token that matches the object path.
Declaration
public JToken SelectToken(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | A System.String that contains a JPath expression. |
Returns
| Type | Description |
|---|---|
| JToken | A JToken, or null. |
SelectToken(String, Boolean)
Selects a JToken using a JPath expression. Selects the token that matches the object path.
Declaration
public JToken SelectToken(string path, bool errorWhenNoMatch)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | A System.String that contains a JPath expression. |
| System.Boolean | errorWhenNoMatch | A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. |
Returns
| Type | Description |
|---|---|
| JToken | A JToken. |
SelectTokens(String)
Selects a collection of elements using a JPath expression.
Declaration
public IEnumerable<JToken> SelectTokens(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | A System.String that contains a JPath expression. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<JToken> | An System.Collections.Generic.IEnumerable<T> that contains the selected elements. |
SelectTokens(String, Boolean)
Selects a collection of elements using a JPath expression.
Declaration
public IEnumerable<JToken> SelectTokens(string path, bool errorWhenNoMatch)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | A System.String that contains a JPath expression. |
| System.Boolean | errorWhenNoMatch | A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<JToken> | An System.Collections.Generic.IEnumerable<T> that contains the selected elements. |
SetLineInfo(IJsonLineInfo, JsonLoadSettings)
Declaration
public void SetLineInfo(IJsonLineInfo lineInfo, JsonLoadSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| IJsonLineInfo | lineInfo | |
| JsonLoadSettings | settings |
SetLineInfo(Int32, Int32)
Declaration
public void SetLineInfo(int lineNumber, int linePosition)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | lineNumber | |
| System.Int32 | linePosition |
ToObject(Type)
Creates the specified .NET type from the JToken.
Declaration
public object ToObject(Type objectType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | objectType | The object type that the token will be deserialized to. |
Returns
| Type | Description |
|---|---|
| System.Object | The new object created from the JSON value. |
ToObject(Type, JsonSerializer)
Creates the specified .NET type from the JToken using the specified JsonSerializer.
Declaration
public object ToObject(Type objectType, JsonSerializer jsonSerializer)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | objectType | The object type that the token will be deserialized to. |
| JsonSerializer | jsonSerializer | The JsonSerializer that will be used when creating the object. |
Returns
| Type | Description |
|---|---|
| System.Object | The new object created from the JSON value. |
ToObject<T>()
Creates the specified .NET type from the JToken.
Declaration
public T ToObject<T>()
Returns
| Type | Description |
|---|---|
| T | The new object created from the JSON value. |
Type Parameters
| Name | Description |
|---|---|
| T | The object type that the token will be deserialized to. |
ToObject<T>(JsonSerializer)
Creates the specified .NET type from the JToken using the specified JsonSerializer.
Declaration
public T ToObject<T>(JsonSerializer jsonSerializer)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonSerializer | jsonSerializer | The JsonSerializer that will be used when creating the object. |
Returns
| Type | Description |
|---|---|
| T | The new object created from the JSON value. |
Type Parameters
| Name | Description |
|---|---|
| T | The object type that the token will be deserialized to. |
ToString()
Returns the indented JSON for this token.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | The indented JSON for this token. |
Overrides
ToString(Formatting, JsonConverter[])
Returns the JSON for this token using the given formatting and converters.
Declaration
public string ToString(Formatting formatting, params JsonConverter[] converters)
Parameters
| Type | Name | Description |
|---|---|---|
| Formatting | formatting | Indicates how the output is formatted. |
| JsonConverter[] | converters | A collection of JsonConverter which will be used when writing the token. |
Returns
| Type | Description |
|---|---|
| System.String | The JSON for this token using the given formatting and converters. |
Value<T>(Object)
Gets the JToken with the specified key converted to the specified type.
Declaration
public virtual T Value<T>(object key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | key | The token key. |
Returns
| Type | Description |
|---|---|
| T | The converted token value. |
Type Parameters
| Name | Description |
|---|---|
| T | The type to convert the token to. |
Values<T>()
Returns a collection of the child values of this token, in document order.
Declaration
public virtual IEnumerable<T> Values<T>()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T> | A System.Collections.Generic.IEnumerable<T> containing the child values of this JToken, in document order. |
Type Parameters
| Name | Description |
|---|---|
| T | The type to convert the values to. |
WriteTo(JsonWriter, JsonConverter[])
Writes this token to a JsonWriter.
Declaration
public abstract void WriteTo(JsonWriter writer, params JsonConverter[] converters)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonWriter | writer | A JsonWriter into which this method will write. |
| JsonConverter[] | converters | A collection of JsonConverter which will be used when writing the token. |
Operators
| Improve this Doc View SourceExplicit(JToken to Boolean)
Performs an explicit conversion from JToken to System.Boolean.
Declaration
public static explicit operator bool (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Boolean | The result of the conversion. |
Explicit(JToken to Byte)
Performs an explicit conversion from JToken to System.Byte.
Declaration
public static explicit operator byte (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Byte | The result of the conversion. |
Explicit(JToken to Byte[])
Performs an explicit conversion from JToken to System.Byte[].
Declaration
public static explicit operator byte[](JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Byte[] | The result of the conversion. |
Explicit(JToken to Char)
Performs an explicit conversion from JToken to System.Char.
Declaration
public static explicit operator char (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Char | The result of the conversion. |
Explicit(JToken to DateTime)
Performs an explicit conversion from JToken to System.DateTime.
Declaration
public static explicit operator DateTime(JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.DateTime | The result of the conversion. |
Explicit(JToken to DateTimeOffset)
Performs an explicit conversion from JToken to System.DateTimeOffset.
Declaration
public static explicit operator DateTimeOffset(JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.DateTimeOffset | The result of the conversion. |
Explicit(JToken to Decimal)
Performs an explicit conversion from JToken to System.Decimal.
Declaration
public static explicit operator decimal (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Decimal | The result of the conversion. |
Explicit(JToken to Double)
Performs an explicit conversion from JToken to System.Double.
Declaration
public static explicit operator double (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Double | The result of the conversion. |
Explicit(JToken to Guid)
Performs an explicit conversion from JToken to System.Guid.
Declaration
public static explicit operator Guid(JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Guid | The result of the conversion. |
Explicit(JToken to Int16)
Performs an explicit conversion from JToken to System.Int16.
Declaration
public static explicit operator short (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Int16 | The result of the conversion. |
Explicit(JToken to Int32)
Performs an explicit conversion from JToken to System.Int32.
Declaration
public static explicit operator int (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The result of the conversion. |
Explicit(JToken to Int64)
Performs an explicit conversion from JToken to System.Int64.
Declaration
public static explicit operator long (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Int64 | The result of the conversion. |
Explicit(JToken to Nullable<Boolean>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator bool? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> | The result of the conversion. |
Explicit(JToken to Nullable<Byte>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator byte? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Byte> | The result of the conversion. |
Explicit(JToken to Nullable<Char>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator char? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Char> | The result of the conversion. |
Explicit(JToken to Nullable<DateTime>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator DateTime? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.DateTime> | The result of the conversion. |
Explicit(JToken to Nullable<DateTimeOffset>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator DateTimeOffset? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.DateTimeOffset> | The result of the conversion. |
Explicit(JToken to Nullable<Decimal>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator decimal? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Decimal> | The result of the conversion. |
Explicit(JToken to Nullable<Double>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator double? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The result of the conversion. |
Explicit(JToken to Nullable<Guid>)
Performs an explicit conversion from JToken to System.Guid.
Declaration
public static explicit operator Guid? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Guid> | The result of the conversion. |
Explicit(JToken to Nullable<Int16>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator short? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Int16> | The result of the conversion. |
Explicit(JToken to Nullable<Int32>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator int? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Int32> | The result of the conversion. |
Explicit(JToken to Nullable<Int64>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator long? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Int64> | The result of the conversion. |
Explicit(JToken to Nullable<SByte>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator sbyte? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.SByte> | The result of the conversion. |
Explicit(JToken to Nullable<Single>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator float? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Single> | The result of the conversion. |
Explicit(JToken to Nullable<TimeSpan>)
Performs an explicit conversion from JToken to System.TimeSpan.
Declaration
public static explicit operator TimeSpan? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.TimeSpan> | The result of the conversion. |
Explicit(JToken to Nullable<UInt16>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator ushort? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.UInt16> | The result of the conversion. |
Explicit(JToken to Nullable<UInt32>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator uint? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.UInt32> | The result of the conversion. |
Explicit(JToken to Nullable<UInt64>)
Performs an explicit conversion from JToken to System.Nullable<T>.
Declaration
public static explicit operator ulong? (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.UInt64> | The result of the conversion. |
Explicit(JToken to SByte)
Performs an explicit conversion from JToken to System.SByte.
Declaration
public static explicit operator sbyte (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.SByte | The result of the conversion. |
Explicit(JToken to Single)
Performs an explicit conversion from JToken to System.Single.
Declaration
public static explicit operator float (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Single | The result of the conversion. |
Explicit(JToken to String)
Performs an explicit conversion from JToken to System.String.
Declaration
public static explicit operator string (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.String | The result of the conversion. |
Explicit(JToken to TimeSpan)
Performs an explicit conversion from JToken to System.TimeSpan.
Declaration
public static explicit operator TimeSpan(JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.TimeSpan | The result of the conversion. |
Explicit(JToken to UInt16)
Performs an explicit conversion from JToken to System.UInt16.
Declaration
public static explicit operator ushort (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.UInt16 | The result of the conversion. |
Explicit(JToken to UInt32)
Performs an explicit conversion from JToken to System.UInt32.
Declaration
public static explicit operator uint (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.UInt32 | The result of the conversion. |
Explicit(JToken to UInt64)
Performs an explicit conversion from JToken to System.UInt64.
Declaration
public static explicit operator ulong (JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.UInt64 | The result of the conversion. |
Explicit(JToken to Uri)
Performs an explicit conversion from JToken to System.Uri.
Declaration
public static explicit operator Uri(JToken value)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Uri | The result of the conversion. |
Implicit(Boolean to JToken)
Performs an implicit conversion from System.Boolean to JToken.
Declaration
public static implicit operator JToken(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Byte to JToken)
Performs an implicit conversion from System.Byte to JToken.
Declaration
public static implicit operator JToken(byte value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Byte[] to JToken)
Performs an implicit conversion from System.Byte[] to JToken.
Declaration
public static implicit operator JToken(byte[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(DateTime to JToken)
Performs an implicit conversion from System.DateTime to JToken.
Declaration
public static implicit operator JToken(DateTime value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(DateTimeOffset to JToken)
Performs an implicit conversion from System.DateTimeOffset to JToken.
Declaration
public static implicit operator JToken(DateTimeOffset value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTimeOffset | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Decimal to JToken)
Performs an implicit conversion from System.Decimal to JToken.
Declaration
public static implicit operator JToken(decimal value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Decimal | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Double to JToken)
Performs an implicit conversion from System.Double to JToken.
Declaration
public static implicit operator JToken(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Guid to JToken)
Performs an implicit conversion from System.Guid to JToken.
Declaration
public static implicit operator JToken(Guid value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Int16 to JToken)
Performs an implicit conversion from System.Int16 to JToken.
Declaration
public static implicit operator JToken(short value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int16 | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Int32 to JToken)
Performs an implicit conversion from System.Int32 to JToken.
Declaration
public static implicit operator JToken(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Int64 to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(long value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<Boolean> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(bool? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Boolean> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<Byte> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(byte? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Byte> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<DateTime> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(DateTime? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.DateTime> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<DateTimeOffset> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(DateTimeOffset? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.DateTimeOffset> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<Decimal> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(decimal? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Decimal> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<Double> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(double? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<Guid> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(Guid? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Guid> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<Int16> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(short? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Int16> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<Int32> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(int? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Int32> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<Int64> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(long? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Int64> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<SByte> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(sbyte? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.SByte> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<Single> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(float? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Single> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<TimeSpan> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(TimeSpan? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.TimeSpan> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<UInt16> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(ushort? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.UInt16> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<UInt32> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(uint? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.UInt32> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Nullable<UInt64> to JToken)
Performs an implicit conversion from System.Nullable<T> to JToken.
Declaration
public static implicit operator JToken(ulong? value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.UInt64> | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(SByte to JToken)
Performs an implicit conversion from System.SByte to JToken.
Declaration
public static implicit operator JToken(sbyte value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.SByte | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Single to JToken)
Performs an implicit conversion from System.Single to JToken.
Declaration
public static implicit operator JToken(float value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(String to JToken)
Performs an implicit conversion from System.String to JToken.
Declaration
public static implicit operator JToken(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(TimeSpan to JToken)
Performs an implicit conversion from System.TimeSpan to JToken.
Declaration
public static implicit operator JToken(TimeSpan value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.TimeSpan | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(UInt16 to JToken)
Performs an implicit conversion from System.UInt16 to JToken.
Declaration
public static implicit operator JToken(ushort value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(UInt32 to JToken)
Performs an implicit conversion from System.UInt32 to JToken.
Declaration
public static implicit operator JToken(uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(UInt64 to JToken)
Performs an implicit conversion from System.UInt64 to JToken.
Declaration
public static implicit operator JToken(ulong value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Implicit(Uri to JToken)
Performs an implicit conversion from System.Uri to JToken.
Declaration
public static implicit operator JToken(Uri value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | value | The value to create a JValue from. |
Returns
| Type | Description |
|---|---|
| JToken | The JValue initialized with the specified value. |
Explicit Interface Implementations
| Improve this Doc View SourceIJsonLineInfo.HasLineInfo()
Declaration
bool IJsonLineInfo.HasLineInfo()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IJsonLineInfo.LineNumber
Declaration
int IJsonLineInfo.LineNumber { get; }
Returns
| Type | Description |
|---|---|
| System.Int32 |
IJsonLineInfo.LinePosition
Declaration
int IJsonLineInfo.LinePosition { get; }
Returns
| Type | Description |
|---|---|
| System.Int32 |
IJEnumerable<JToken>.Item[Object]
Declaration
IJEnumerable<JToken> IJEnumerable<JToken>.this[object key] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | key |
Returns
| Type | Description |
|---|---|
| IJEnumerable<JToken> |
IEnumerable<JToken>.GetEnumerator()
Declaration
IEnumerator<JToken> IEnumerable<JToken>.GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerator<JToken> |
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerator |
IDynamicMetaObjectProvider.GetMetaObject(Expression)
Returns the System.Dynamic.DynamicMetaObject responsible for binding operations performed on this object.
Declaration
DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(Expression parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression | parameter | The expression tree representation of the runtime value. |
Returns
| Type | Description |
|---|---|
| System.Dynamic.DynamicMetaObject | The System.Dynamic.DynamicMetaObject to bind this object. |
ICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
| Type | Description |
|---|---|
| System.Object |