本文整理汇总了C#中TidyNet.Node.IsDescendantOf方法的典型用法代码示例。如果您正苦于以下问题:C# Node.IsDescendantOf方法的具体用法?C# Node.IsDescendantOf怎么用?C# Node.IsDescendantOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TidyNet.Node
的用法示例。
在下文中一共展示了Node.IsDescendantOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
/*
element is node created by the lexer
upon seeing the start tag, or by the
parser when the start tag is inferred
*/
public virtual void Parse(Lexer lexer, Node element, short mode)
{
Node node, parent;
bool checkstack;
int istackbase = 0;
TagTable tt = lexer.Options.tt;
checkstack = true;
if ((element.Tag.Model & ContentModel.Empty) != 0)
{
return;
}
if (element.Tag == tt.TagForm && element.IsDescendantOf(tt.TagForm))
{
Report.Warning(lexer, element, null, Report.ILLEGAL_NESTING);
}
/*
InlineDup() asks the lexer to insert inline emphasis tags
currently pushed on the istack, but take care to avoid
propagating inline emphasis inside OBJECT or APPLET.
For these elements a fresh inline stack context is created
and disposed of upon reaching the end of the element.
They thus behave like table cells in this respect.
*/
if ((element.Tag.Model & ContentModel.Object) != 0)
{
istackbase = lexer.istackbase;
lexer.istackbase = lexer.istack.Count;
}
if (!((element.Tag.Model & ContentModel.Mixed) != 0))
{
lexer.InlineDup(null);
}
mode = Lexer.IgnoreWhitespace;
while (true)
{
node = lexer.GetToken(mode);
if (node == null)
{
break;
}
/* end tag for this element */
if (node.Type == Node.EndTag && node.Tag != null && (node.Tag == element.Tag || element.Was == node.Tag))
{
if ((element.Tag.Model & ContentModel.Object) != 0)
{
/* pop inline stack */
while (lexer.istack.Count > lexer.istackbase)
{
lexer.PopInline(null);
}
lexer.istackbase = istackbase;
}
element.Closed = true;
Node.TrimSpaces(lexer, element);
Node.TrimEmptyElement(lexer, element);
return;
}
if (node.Tag == tt.TagHtml || node.Tag == tt.TagHead || node.Tag == tt.TagBody)
{
if (node.Type == Node.StartTag || node.Type == Node.StartEndTag)
{
Report.Warning(lexer, element, node, Report.DISCARDING_UNEXPECTED);
}
continue;
}
if (node.Type == Node.EndTag)
{
if (node.Tag == null)
{
Report.Warning(lexer, element, node, Report.DISCARDING_UNEXPECTED);
continue;
}
else if (node.Tag == tt.TagBr)
{
node.Type = Node.StartTag;
}
else if (node.Tag == tt.TagP)
{
Node.CoerceNode(lexer, node, tt.TagBr);
Node.InsertNodeAtEnd(element, node);
node = lexer.InferredTag("br");
}
//.........这里部分代码省略.........