Class JConstructor
- Namespace
- Newtonsoft.Json.Linq
- Assembly
- Newtonsoft.Json.dll
Represents a JSON constructor.
public class JConstructor : JContainer, IJEnumerable<JToken>, IJsonLineInfo, ICloneable, IList<JToken>, ICollection<JToken>, IEnumerable<JToken>, ITypedList, IBindingList, IList, ICollection, IEnumerable
- Inheritance
-
JConstructor
- Implements
- Inherited Members
- Extension Methods
Constructors
JConstructor()
Initializes a new instance of the JConstructor class.
public JConstructor()
JConstructor(JConstructor)
Initializes a new instance of the JConstructor class from another JConstructor object.
public JConstructor(JConstructor other)
Parameters
otherJConstructorA JConstructor object to copy from.
JConstructor(string)
Initializes a new instance of the JConstructor class with the specified name.
public JConstructor(string name)
Parameters
namestringThe constructor name.
JConstructor(string, object)
Initializes a new instance of the JConstructor class with the specified name and content.
public JConstructor(string name, object content)
Parameters
JConstructor(string, params object[])
Initializes a new instance of the JConstructor class with the specified name and content.
public JConstructor(string name, params object[] content)
Parameters
Properties
ChildrenTokens
Gets the container's children tokens.
protected override IList<JToken> ChildrenTokens { get; }
Property Value
this[object]
Gets the JToken with the specified key.
public override JToken this[object key] { get; set; }
Parameters
keyobject
Property Value
Name
Gets or sets the name of this constructor.
public string Name { get; set; }
Property Value
- string
The constructor name.
Type
Gets the node type for this JToken.
public override JTokenType Type { get; }
Property Value
- JTokenType
The type.
Methods
Load(JsonReader)
Loads an JConstructor from a JsonReader.
public static JConstructor Load(JsonReader reader)
Parameters
readerJsonReaderA JsonReader that will be read for the content of the JConstructor.
Returns
- JConstructor
A JConstructor that contains the JSON that was read from the specified JsonReader.
WriteTo(JsonWriter, params JsonConverter[])
Writes this token to a JsonWriter.
public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)
Parameters
writerJsonWriterA JsonWriter into which this method will write.
convertersJsonConverter[]A collection of JsonConverter which will be used when writing the token.