本文整理汇总了C#中System.Xml.Linq.XContainer.GetTextOnly方法的典型用法代码示例。如果您正苦于以下问题:C# XContainer.GetTextOnly方法的具体用法?C# XContainer.GetTextOnly怎么用?C# XContainer.GetTextOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Linq.XContainer
的用法示例。
在下文中一共展示了XContainer.GetTextOnly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ContentsEqual
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: ContentsEqual
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;
}