public static void outputNode(YamlNode node,string ind="") { Console.WriteLine(ind+"NODE:\n{0}", ind+node.Tag); if (node.GetType() == typeof(YamlMapping)) foreach (YamlNode n in ((YamlMapping)node).Keys) { outputNode(n,ind+"-"); } else if (node.GetType() == typeof(YamlScalar)) Console.WriteLine("{0}\n", ind+((YamlScalar)node)); }
/// <summary> /// Returns true if <paramref name="b"/> is of same type as the <see cref="YamlNode"/> and /// its Tag is same as the node. It returns true for <paramref name="skip"/> if they /// both already appeared in the node trees and were compared. /// </summary> /// <param name="b">Node to be compared.</param> /// <param name="repository">Node repository holds the nodes that already appeared and /// the corresponding node in the other node tree.</param> /// <param name="skip">true if they already appeared in the node tree and were compared.</param> /// <returns>true if they are equal to each other.</returns> internal bool EqualsSub(YamlNode b, ObjectRepository repository, out bool skip) { YamlNode a = this; bool identity; if ( repository.AlreadyAppeared(a, b, out identity) ) { skip = true; return identity; } skip = false; if ( a.GetType() != b.GetType() || a.Tag != b.Tag ) return false; return true; }