本文整理汇总了C#中AcceptedCharacters类的典型用法代码示例。如果您正苦于以下问题:C# AcceptedCharacters类的具体用法?C# AcceptedCharacters怎么用?C# AcceptedCharacters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AcceptedCharacters类属于命名空间,在下文中一共展示了AcceptedCharacters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Accepts
public SpanConstructor Accepts(AcceptedCharacters accepted)
{
return With(eh => eh.AcceptedCharacters = accepted);
}
示例2: EscapedMarkupTagBlock
public Block EscapedMarkupTagBlock(string prefix, string suffix, AcceptedCharacters acceptedCharacters)
{
return new MarkupTagBlock(
_factory.Markup(prefix),
_factory.BangEscape(),
_factory.Markup(suffix).Accepts(acceptedCharacters));
}
示例3: RunSingleAtEscapeTest
public static void RunSingleAtEscapeTest(Action<string, Block> testMethod, AcceptedCharacters lastSpanAcceptedCharacters = AcceptedCharacters.None) {
testMethod("<foo>@@bar</foo>",
new MarkupBlock(
new MarkupSpan("<foo>"),
new MarkupSpan("@", hidden: true),
new MarkupSpan("@bar</foo>", hidden: false, acceptedCharacters: lastSpanAcceptedCharacters)
)
);
}
示例4: RunSingleAtEscapeTest
public static void RunSingleAtEscapeTest(Action<string, Block> testMethod, AcceptedCharacters lastSpanAcceptedCharacters = AcceptedCharacters.None)
{
var factory = SpanFactory.CreateCsHtml();
testMethod("<foo>@@bar</foo>",
new MarkupBlock(
factory.Markup("<foo>"),
factory.Markup("@").Hidden(),
factory.Markup("@bar</foo>").Accepts(lastSpanAcceptedCharacters)));
}
示例5: ImplicitExpressionTest
protected void ImplicitExpressionTest(string input, string expected, AcceptedCharacters acceptedCharacters, params RazorError[] errors) {
ParseBlockTest(input,
new ExpressionBlock(
new ImplicitExpressionSpan(expected,
CSharpCodeParser.DefaultKeywords,
acceptTrailingDot: false,
acceptedCharacters: acceptedCharacters)),
errors);
}
示例6: ImplicitExpressionTest
protected void ImplicitExpressionTest(string input, string expected, AcceptedCharacters acceptedCharacters, params RazorError[] errors)
{
var factory = CreateSpanFactory();
ParseBlockTest(SyntaxConstants.TransitionString + input,
new ExpressionBlock(
factory.CodeTransition(),
factory.Code(expected)
.AsImplicitExpression(KeywordSet)
.Accepts(acceptedCharacters)),
errors);
}
示例7: ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket
public void ParseBlockMethodParsesNullConditionalOperatorImplicitExpression_Bracket(
string implicitExpresison,
string expectedImplicitExpression,
AcceptedCharacters acceptedCharacters,
RazorError[] expectedErrors)
{
// Act & Assert
ImplicitExpressionTest(
implicitExpresison,
expectedImplicitExpression,
acceptedCharacters,
expectedErrors);
}
示例8: RunMultiAtEscapeTest
public static void RunMultiAtEscapeTest(Action<string, Block> testMethod, AcceptedCharacters lastSpanAcceptedCharacters = AcceptedCharacters.None) {
testMethod("<foo>@@@@@bar</foo>",
new MarkupBlock(
new MarkupSpan("<foo>"),
new MarkupSpan("@", hidden: true),
new MarkupSpan("@"),
new MarkupSpan("@", hidden: true),
new MarkupSpan("@"),
new ExpressionBlock(
new TransitionSpan(RazorParser.TransitionString, hidden: false, acceptedCharacters: AcceptedCharacters.None),
new ImplicitExpressionSpan("bar", CSharpCodeParser.DefaultKeywords, acceptTrailingDot: false, acceptedCharacters: AcceptedCharacters.NonWhiteSpace)
),
new MarkupSpan("</foo>", hidden: false, acceptedCharacters: lastSpanAcceptedCharacters)
));
}
示例9: SimpleMarkupSwitch
public void SimpleMarkupSwitch(string keyword, string endSequence, AcceptedCharacters acceptedCharacters)
{
ParseBlockTest(keyword + Environment.NewLine
+ " If True Then" + Environment.NewLine
+ " @<p>It's True!</p>" + Environment.NewLine
+ " End If" + Environment.NewLine
+ endSequence,
new StatementBlock(
Factory.Code(keyword + "\r\n If True Then\r\n").AsStatement(),
new MarkupBlock(
Factory.Markup(" "),
Factory.MarkupTransition(),
Factory.Markup("<p>It's True!</p>\r\n").Accepts(AcceptedCharacters.None)),
Factory.Code(" End If\r\n" + endSequence).AsStatement().Accepts(acceptedCharacters)));
}
示例10: RunMultiAtEscapeTest
public static void RunMultiAtEscapeTest(Action<string, Block> testMethod, AcceptedCharacters lastSpanAcceptedCharacters = AcceptedCharacters.None)
{
var factory = SpanFactory.CreateCsHtml();
testMethod("<foo>@@@@@bar</foo>",
new MarkupBlock(
factory.Markup("<foo>"),
factory.Markup("@").Hidden(),
factory.Markup("@"),
factory.Markup("@").Hidden(),
factory.Markup("@"),
new ExpressionBlock(
factory.CodeTransition(),
factory.Code("bar")
.AsImplicitExpression(CSharpCodeParser.DefaultKeywords)
.Accepts(AcceptedCharacters.NonWhiteSpace)),
factory.Markup("</foo>").Accepts(lastSpanAcceptedCharacters)));
}
示例11: EscapedMarkupTagBlock
public Block EscapedMarkupTagBlock(
string prefix,
string suffix,
AcceptedCharacters acceptedCharacters,
params SyntaxTreeNode[] children)
{
var newChildren = new List<SyntaxTreeNode>(
new SyntaxTreeNode[]
{
_factory.Markup(prefix),
_factory.BangEscape(),
_factory.Markup(suffix).Accepts(acceptedCharacters)
});
newChildren.AddRange(children);
return new MarkupTagBlock(newChildren.ToArray());
}
示例12: SingleLineMarkupSwitch
public void SingleLineMarkupSwitch(string keyword, string endSequence, AcceptedCharacters acceptedCharacters)
{
ParseBlockTest(keyword + Environment.NewLine
+ " If True Then" + Environment.NewLine
+ " @:<p>It's True!</p>" + Environment.NewLine
+ " This is code!" + Environment.NewLine
+ " End If" + Environment.NewLine
+ endSequence,
new StatementBlock(
Factory.Code(keyword + "\r\n If True Then\r\n").AsStatement(),
new MarkupBlock(
Factory.Markup(" "),
Factory.MarkupTransition(),
Factory.MetaMarkup(":", HtmlSymbolType.Colon),
Factory.Markup("<p>It's True!</p>\r\n")
.With(new SingleLineMarkupEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString))
.Accepts(AcceptedCharacters.None)),
Factory.Code(" This is code!\r\n End If\r\n" + endSequence)
.AsStatement()
.Accepts(acceptedCharacters)));
}
示例13: SingleLineMarkupEditHandler
public SingleLineMarkupEditHandler(Func<string, IEnumerable<ISymbol>> tokenizer, AcceptedCharacters accepted)
: base(tokenizer, accepted)
{
}
示例14: Create
public static ImplicitExpressionSpan Create(ParserContext context, ISet<string> keywords, bool acceptTrailingDot, AcceptedCharacters acceptedCharacters) {
return new ImplicitExpressionSpan(context.CurrentSpanStart, context.ContentBuffer.ToString(), keywords, acceptTrailingDot, acceptedCharacters);
}
示例15: CommentSpan
public CommentSpan(SourceLocation start, string content, bool hidden, AcceptedCharacters acceptedCharacters) : base(SpanKind.Comment, start, content, hidden, acceptedCharacters) { }