本文整理匯總了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;
}