JsonNode(JsonNode, JsonNodeUnexpectedDuplicateSiblingReaction) Constructor

DOM node constructor.

Definition

Namespace: MichaelBrooks.UK.Json
Assembly: JsonDOM (in JsonDOM.dll) Version: 1.0.7
C#
public JsonNode(
	JsonNode? parent,
	JsonNodeUnexpectedDuplicateSiblingReaction unexpectedDuplicateSiblingReaction
)

Parameters

parent  JsonNode
The parent node, or null if this is to be the root of the DOM / parse tree.
unexpectedDuplicateSiblingReaction  JsonNodeUnexpectedDuplicateSiblingReaction
How calls to ItemString are to react when asked to locate a specifically named child node while multiple children exist with the specified name.

Remarks

Note that if this is not to be the root node of a new DOM (i.e. if parent is not null), even though the calling code has passed in parent, it is nevertheless still the caller's responsibility to add this node to the Children collection of the parent JsonNode, because only the calling code can know whether there is any significance to the order in which the children are arranged (see Children).

  Caution

If you pass a parent but fail to add this new node to the parent's Children collection, bad things will likely happen.

Note also that although not technically strictly necessary, in most circumstances you should intend for every node in your DOM to be constructed using the same unexpectedDuplicateSiblingReaction value. Indeed should you find yourself tempted to use varying values for this parameter across your DOM, I would caution you to be alert for the possibility that this could be symptomatic of a design issue somewhere.


Online page.

See Also