Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

YamlAlias

OfficeIMO.Yaml

Namespace
OfficeIMO.Yaml
Assembly
OfficeIMO.Yaml
Source revision
0eef6a5756b9 with working tree changes
Modifiers
sealed

An alias node (*name). The tree keeps aliases as nodes so saving and editing preserve them; resolution is a view: YamlAlias.Target and the typed reads on YamlNode look through to the anchored node.

Inheritance

Constructors

public YamlAlias(YamlNode anchored) #

Creates an alias to an anchored node, for example to reuse shared settings with a << merge key. The alias must come after its anchor in the document when it is saved.

Parameters

anchored OfficeIMO.Yaml.YamlNode required

Exceptions

  • ArgumentException – anchored has no anchor, or is itself an alias.

Properties

public string Name { get; } #

Gets the anchor name the alias refers to, without *. It follows renames of the anchor.

public YamlNode Target { get; } #

Gets the anchored node: the most recent node before the alias in the same document whose anchor is YamlAlias.Name. It is never itself an alias.