Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 /// <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;
 }