Keeps track of the current recursion level, and throws MaximumRecursionLevelReachedException whenever Maximum is reached.
コード例 #1
0
ファイル: YamlNode.cs プロジェクト: aaubry/YamlDotNet
 internal abstract string ToString(RecursionLevel level);
コード例 #2
0
ファイル: YamlNode.cs プロジェクト: aaubry/YamlDotNet
 /// <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);
コード例 #3
0
ファイル: YamlNode.cs プロジェクト: aaubry/YamlDotNet
 public override string ToString()
 {
     var level = new RecursionLevel(MaximumRecursionLevel);
     return ToString(level);
 }
コード例 #4
0
ファイル: YamlScalarNode.cs プロジェクト: aaubry/YamlDotNet
 /// <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;
 }
コード例 #5
0
ファイル: YamlScalarNode.cs プロジェクト: aaubry/YamlDotNet
 /// <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;
 }
コード例 #6
0
ファイル: YamlAliasNode.cs プロジェクト: aaubry/YamlDotNet
 /// <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;
 }