コード例 #1
0
        internal bool ContentsEqual(XContainer e)
        {
            if (content == e.content)
            {
                return(true);
            }
            string s = GetTextOnly();

            if (s != null)
            {
                return(s == e.GetTextOnly());
            }
            XNode n1 = content as XNode;
            XNode n2 = e.content as XNode;

            if (n1 != null && n2 != null)
            {
                n1 = n1.next;
                n2 = n2.next;
                while (true)
                {
                    if (CollectText(ref n1) != e.CollectText(ref n2))
                    {
                        break;
                    }
                    if (n1 == null && n2 == null)
                    {
                        return(true);
                    }
                    if (n1 == null || n2 == null || !n1.DeepEquals(n2))
                    {
                        break;
                    }
                    n1 = n1 != content ? n1.next : null;
                    n2 = n2 != e.content ? n2.next : null;
                }
            }
            return(false);
        }
コード例 #2
0
        internal bool ContentsEqual(XContainer e)
        {
            if (this.content == e.content)
            {
                return(true);
            }
            string textOnly = this.GetTextOnly();

            if (textOnly != null)
            {
                return(textOnly == e.GetTextOnly());
            }
            XNode content = this.content as XNode;
            XNode n       = e.content as XNode;

            if ((content == null) || (n == null))
            {
                goto Label_00A9;
            }
            content = content.next;
            n       = n.next;
Label_0053:
            if (this.CollectText(ref content) == e.CollectText(ref n))
            {
                if ((content == null) && (n == null))
                {
                    return(true);
                }
                if (((content != null) && (n != null)) && content.DeepEquals(n))
                {
                    content = (content != this.content) ? content.next : null;
                    n       = (n != e.content) ? n.next : null;
                    goto Label_0053;
                }
            }
Label_00A9:
            return(false);
        }
コード例 #3
0
ファイル: XContainer.cs プロジェクト: er0dr1guez/corefx
 internal bool ContentsEqual(XContainer e)
 {
     if (content == e.content) return true;
     string s = GetTextOnly();
     if (s != null) return s == e.GetTextOnly();
     XNode n1 = content as XNode;
     XNode n2 = e.content as XNode;
     if (n1 != null && n2 != null)
     {
         n1 = n1.next;
         n2 = n2.next;
         while (true)
         {
             if (CollectText(ref n1) != e.CollectText(ref n2)) break;
             if (n1 == null && n2 == null) return true;
             if (n1 == null || n2 == null || !n1.DeepEquals(n2)) break;
             n1 = n1 != content ? n1.next : null;
             n2 = n2 != e.content ? n2.next : null;
         }
     }
     return false;
 }
コード例 #4
0
 internal bool ContentsEqual(XContainer e)
 {
     if (this.content == e.content)
     {
         return true;
     }
     string textOnly = this.GetTextOnly();
     if (textOnly != null)
     {
         return (textOnly == e.GetTextOnly());
     }
     XNode content = this.content as XNode;
     XNode n = e.content as XNode;
     if ((content == null) || (n == null))
     {
         goto Label_00A9;
     }
     content = content.next;
     n = n.next;
 Label_0053:
     if (this.CollectText(ref content) == e.CollectText(ref n))
     {
         if ((content == null) && (n == null))
         {
             return true;
         }
         if (((content != null) && (n != null)) && content.DeepEquals(n))
         {
             content = (content != this.content) ? content.next : null;
             n = (n != e.content) ? n.next : null;
             goto Label_0053;
         }
     }
 Label_00A9:
     return false;
 }