Keeps track of the current recursion level, and throws MaximumRecursionLevelReachedException whenever Maximum is reached.
Esempio n. 1
0
 internal abstract string ToString(RecursionLevel level);
Esempio n. 2
0
 /// <summary>
 /// When implemented, recursively enumerates all the nodes from the document, starting on the current node.
 /// If <see cref="RecursionLevel.Maximum"/> is reached, a <see cref="MaximumRecursionLevelReachedException"/> is thrown
 /// instead of continuing and crashing with a <see cref="StackOverflowException"/>.
 /// </summary>
 internal abstract IEnumerable<YamlNode> SafeAllNodes(RecursionLevel level);
Esempio n. 3
0
 public override string ToString()
 {
     var level = new RecursionLevel(MaximumRecursionLevel);
     return ToString(level);
 }
Esempio n. 4
0
 /// <summary>
 /// Returns a <see cref="System.String"/> that represents this instance.
 /// </summary>
 /// <returns>
 /// A <see cref="System.String"/> that represents this instance.
 /// </returns>
 internal override string ToString(RecursionLevel level)
 {
     return Value;
 }
Esempio n. 5
0
 /// <summary>
 /// Recursively enumerates all the nodes from the document, starting on the current node,
 /// and throwing <see cref="MaximumRecursionLevelReachedException"/>
 /// if <see cref="RecursionLevel.Maximum"/> is reached.
 /// </summary>
 internal override IEnumerable<YamlNode> SafeAllNodes(RecursionLevel level)
 {
     yield return this;
 }
Esempio n. 6
0
 /// <summary>
 /// Returns a <see cref="System.String"/> that represents this instance.
 /// </summary>
 /// <returns>
 /// A <see cref="System.String"/> that represents this instance.
 /// </returns>
 internal override string ToString(RecursionLevel level)
 {
     return "*" + Anchor;
 }