本文整理汇总了C#中Token.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# Token.AddChild方法的具体用法?C# Token.AddChild怎么用?C# Token.AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Token
的用法示例。
在下文中一共展示了Token.AddChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Apply
internal override bool Apply(StringReader reader, ref Token parentToken, ref Token previousToken)
{
var token = new LineBreakToken();
parentToken.AddChild(token);
previousToken = token;
return true;
}
示例2: Apply
internal override bool Apply(StringReader reader, ref Token parentToken, ref Token previousToken)
{
var temp = previousToken as LiteralToken;
if (temp != null)
{
temp.AddChar(reader.CurrentChar);
}
else
{
var token = new LiteralToken(reader.CurrentChar);
parentToken.AddChild(token);
previousToken = token;
}
return true;
}
示例3: Apply
internal override bool Apply(StringReader reader, ref Token parentToken, ref Token previousToken)
{
var previousEmphasisToken = FindAncestorToken(parentToken, token => token is EmphasisToken);
if (previousEmphasisToken != null && previousEmphasisToken.Closed == false)
{
previousToken.Closed = true;
parentToken = parentToken.Parent;
previousToken = previousEmphasisToken;
}
else
{
var token = new EmphasisToken();
parentToken.AddChild(token);
parentToken = token;
previousToken = token;
}
return true;
}
示例4: Apply
internal override bool Apply(StringReader reader, ref Token parentToken, ref Token previousToken)
{
var token = new ParagraphToken();
if (reader.NextChar == '\n')
{
reader.Advance(2);
parentToken.Parent.AddChild(token);
parentToken = token;
}
else
{
parentToken.AddChild(token);
parentToken = token;
}
previousToken = token;
return false;
}