Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Theming.Json.JsonNode Class Referenceabstract

Framework-owned JSON data node. No code execution, reflection or type activation. More...

Inheritance diagram for GWG.WindowFramework.Theming.Json.JsonNode:

Public Member Functions

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 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

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.

Detailed Description

Framework-owned JSON data node. No code execution, reflection or type activation.

Use Parse on JsonObject for bounded input. DeepClone separates manifest ownership. Arrays and opaque extension values preserve types and numeric spelling during round trips.

Member Function Documentation

◆ DeepClone()

JsonNode GWG.WindowFramework.Theming.Json.JsonNode.DeepClone ( )
abstract

Creates an independently mutable data tree, retaining scalar types and order.

Returns
New tree; no shared mutable object/array nodes.

◆ operator double()

GWG.WindowFramework.Theming.Json.JsonNode.operator double ( JsonNode node)
inlineexplicitstatic

Reads either numeric kind using invariant double parsing.

Parameters
nodeNumeric node; missing/other kinds throw InvalidCastException.
Returns
Parsed number.

◆ operator float()

GWG.WindowFramework.Theming.Json.JsonNode.operator float ( JsonNode node)
inlineexplicitstatic

Converts a numeric scalar through double to float.

Parameters
nodeNumeric node.
Returns
Float conversion; callers must enforce domain ranges.

◆ operator int()

GWG.WindowFramework.Theming.Json.JsonNode.operator int ( JsonNode node)
inlineexplicitstatic

Reads a lexical integer within Int32 range; float/exponent kinds are not accepted.

Parameters
nodeInteger node.
Returns
Parsed integer; wrong kind/range throws.

◆ operator JsonNode() [1/5]

implicit GWG.WindowFramework.Theming.Json.JsonNode.operator JsonNode ( bool value)
inlinestatic

Creates a boolean scalar without parsing text.

Parameters
valueBoolean value.
Returns
New boolean node.

◆ operator JsonNode() [2/5]

implicit GWG.WindowFramework.Theming.Json.JsonNode.operator JsonNode ( double value)
inlinestatic

Creates a finite floating scalar using invariant round-trip spelling.

Parameters
valueFinite double; nonfinite values throw ArgumentException.
Returns
New float node.

◆ operator JsonNode() [3/5]

implicit GWG.WindowFramework.Theming.Json.JsonNode.operator JsonNode ( float value)
inlinestatic

Creates a finite floating scalar using invariant round-trip spelling.

Parameters
valueFinite float; nonfinite values throw ArgumentException.
Returns
New float node.

◆ operator JsonNode() [4/5]

implicit GWG.WindowFramework.Theming.Json.JsonNode.operator JsonNode ( int value)
inlinestatic

Creates an invariant lexical integer scalar.

Parameters
valueInteger value.
Returns
New integer node.

◆ operator JsonNode() [5/5]

implicit GWG.WindowFramework.Theming.Json.JsonNode.operator JsonNode ( string value)
inlinestatic

Creates a string scalar; null produces an explicit JSON-null node.

Parameters
valueLiteral text, not parsed JSON.
Returns
New scalar node.

◆ operator string()

GWG.WindowFramework.Theming.Json.JsonNode.operator string ( JsonNode node)
inlineexplicitstatic

Reads a string scalar, or null for absent/JSON-null input.

Parameters
nodeString/null node; other kinds throw InvalidCastException.
Returns
Stored string or null.

◆ Quote()

string GWG.WindowFramework.Theming.Json.JsonNode.Quote ( string value)
inlinestatic

Encodes a JSON string, including control characters and surrogate code units.

Parameters
valueLiteral text; null serializes as JSON null.
Returns
Escaped quoted JSON string or null literal, not a parsed node.
Here is the caller graph for this function:

◆ ToString() [1/2]

override string GWG.WindowFramework.Theming.Json.JsonNode.ToString ( )
inline

Serializes compact JSON without changing this tree or writing files.

Returns
Compact JSON text.

◆ ToString() [2/2]

string GWG.WindowFramework.Theming.Json.JsonNode.ToString ( JsonFormatting formatting)
inline

Serializes this data tree using the selected whitespace policy.

Parameters
formattingNone for compact JSON or Indented for two-space formatting.
Returns
JSON text; does not write files or validate the theme manifest schema.

Programmatic trees use output-depth limits distinct from parser input limits.

Here is the caller graph for this function:

Property Documentation

◆ this[string key]

virtual JsonNode GWG.WindowFramework.Theming.Json.JsonNode.this[string key]
getset

Named object access; the base implementation throws when a subtype is not an object.

Parameters
keyCase-sensitive property name.

◆ Type

JsonKind GWG.WindowFramework.Theming.Json.JsonNode.Type
getabstract

Gets this node's exact JSON kind; lexical integer and float kinds are distinct.