Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Theming.Json.JsonValue Class Referencesealed

Scalar JSON value. Construction refuses nonfinite numeric output. More...

Inheritance diagram for GWG.WindowFramework.Theming.Json.JsonValue:
Collaboration diagram for GWG.WindowFramework.Theming.Json.JsonValue:

Public Member Functions

 JsonValue (bool value)
 Creates a boolean scalar.
 JsonValue (string value)
 Creates literal string data; null is an explicit null node, not missing data.
override JsonNode DeepClone ()
 Copies this scalar retaining its kind and numeric spelling.
Public Member Functions inherited from GWG.WindowFramework.Theming.Json.JsonNode
JsonNode DeepClone ()
 Creates an independently mutable data tree, retaining scalar types and order.
override string ToString ()
 Serializes compact JSON without changing this tree or writing files.
string ToString (JsonFormatting formatting)
 Serializes this data tree using the selected whitespace policy.

Static Public Member Functions

static JsonValue CreateNull ()
 Creates a new explicit JSON-null scalar.
Static Public Member Functions inherited from GWG.WindowFramework.Theming.Json.JsonNode
static operator double (JsonNode node)
 Reads either numeric kind using invariant double parsing.
static operator float (JsonNode node)
 Converts a numeric scalar through double to float.
static operator int (JsonNode node)
 Reads a lexical integer within Int32 range; float/exponent kinds are not accepted.
static implicit operator JsonNode (bool value)
 Creates a boolean scalar without parsing text.
static implicit operator JsonNode (double value)
 Creates a finite floating scalar using invariant round-trip spelling.
static implicit operator JsonNode (float value)
 Creates a finite floating scalar using invariant round-trip spelling.
static implicit operator JsonNode (int value)
 Creates an invariant lexical integer scalar.
static implicit operator JsonNode (string value)
 Creates a string scalar; null produces an explicit JSON-null node.
static operator string (JsonNode node)
 Reads a string scalar, or null for absent/JSON-null input.
static string Quote (string value)
 Encodes a JSON string, including control characters and surrogate code units.

Properties

override JsonKind Type [get]
 Gets scalar kind, including explicit Null.
Properties inherited from GWG.WindowFramework.Theming.Json.JsonNode
virtual JsonNode this[string key] [get, set]
 Named object access; the base implementation throws when a subtype is not an object.
JsonKind Type [get]
 Gets this node's exact JSON kind; lexical integer and float kinds are distinct.

Private Member Functions

 JsonValue (string value, JsonKind kind)

Private Attributes

readonly JsonKind _kind

Detailed Description

Scalar JSON value. Construction refuses nonfinite numeric output.

Constructor & Destructor Documentation

◆ JsonValue() [1/3]

GWG.WindowFramework.Theming.Json.JsonValue.JsonValue ( string value)
inline

Creates literal string data; null is an explicit null node, not missing data.

Parameters
valueLiteral text; never parsed as JSON.
Here is the caller graph for this function:

◆ JsonValue() [2/3]

GWG.WindowFramework.Theming.Json.JsonValue.JsonValue ( bool value)
inline

Creates a boolean scalar.

Parameters
valueBoolean value.

◆ JsonValue() [3/3]

GWG.WindowFramework.Theming.Json.JsonValue.JsonValue ( string value,
JsonKind kind )
inlineprivate

Member Function Documentation

◆ CreateNull()

JsonValue GWG.WindowFramework.Theming.Json.JsonValue.CreateNull ( )
inlinestatic

Creates a new explicit JSON-null scalar.

Returns
Null-kind node, not a C# null reference.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeepClone()

override JsonNode GWG.WindowFramework.Theming.Json.JsonValue.DeepClone ( )
inline

Copies this scalar retaining its kind and numeric spelling.

Returns
Independent scalar node.
Here is the call graph for this function:

Field Documentation

◆ _kind

readonly JsonKind GWG.WindowFramework.Theming.Json.JsonValue._kind
private

Property Documentation

◆ Type

override JsonKind GWG.WindowFramework.Theming.Json.JsonValue.Type
get

Gets scalar kind, including explicit Null.