本文整理汇总了C#中Token.toString方法的典型用法代码示例。如果您正苦于以下问题:C# Token.toString方法的具体用法?C# Token.toString怎么用?C# Token.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Token
的用法示例。
在下文中一共展示了Token.toString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: accept
public void accept(Token token, Token lastToken)
{
if (token.type == HtmlTokenType.UNESCAPED)
{
sb.Append(CssRewriter.rewrite(token.toString(), source, linkRewriter));
}
else
{
sb.Append(HtmlRewriter.producePreTokenSeparator(token, lastToken));
sb.Append(token.toString());
sb.Append(HtmlRewriter.producePostTokenSeparator(token, lastToken));
}
}
示例2: accept
public void accept(Token token,
Token lastToken)
{
if (token.type == HtmlTokenType.TAGBEGIN)
{
tagAttributeTargets.TryGetValue(token.toString().Substring(1).ToLower(), out currentTagAttrs);
}
if (currentTagAttrs != null &&
lastToken != null &&
lastToken.type == HtmlTokenType.ATTRNAME &&
currentTagAttrs.Contains(lastToken.toString().ToLower()))
{
String link = stripQuotes(token.toString());
builder.Append("=\"");
builder.Append(linkRewriter.rewrite(link, relativeBase));
builder.Append('\"');
return;
}
builder.Append(HtmlRewriter.producePreTokenSeparator(token, lastToken));
builder.Append(token.toString());
builder.Append(HtmlRewriter.producePostTokenSeparator(token, lastToken));
}
示例3: accept
public void accept(Token token, Token lastToken)
{
try
{
if (isTagOpen)
{
if (lastToken != null &&
lastToken.type == HtmlTokenType.ATTRNAME &&
lastToken.toString().ToLower().Equals("src"))
{
scripts.Add(Uri.parse(stripQuotes(token.toString())));
}
else if (token.type == HtmlTokenType.UNESCAPED)
{
scripts.Add(token);
}
}
}
catch (UriFormatException use)
{
throw use;
}
}
示例4: acceptNextTag
public bool acceptNextTag(Token tagStart)
{
if (tagStart.toString().ToLower().Equals("<script"))
{
isTagOpen = true;
return true;
}
else if (tagStart.toString().ToLower().Equals("</script"))
{
isTagOpen = false;
return true;
}
return false;
}
示例5: rewriteLink
private static String rewriteLink(Token token, Uri _base, ILinkRewriter rewriter)
{
Match matcher = urlMatcher.Match(token.toString());
if (!matcher.Success)
return token.toString();
return "url(\"" + rewriter.rewrite(matcher.Groups[2].Value.Trim(), _base) + "\")";
}