本文整理汇总了C#中SpanKind类的典型用法代码示例。如果您正苦于以下问题:C# SpanKind类的具体用法?C# SpanKind怎么用?C# SpanKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpanKind类属于命名空间,在下文中一共展示了SpanKind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpanConstructor
public SpanConstructor(SpanKind kind, IEnumerable<ISymbol> symbols)
{
Builder = new SpanBuilder();
Builder.Kind = kind;
Builder.EditHandler = SpanEditHandler.CreateDefault(TestTokenizer);
foreach (ISymbol sym in symbols)
{
Builder.Accept(sym);
}
}
示例2: Span
public Span Span(SpanKind kind, params ISymbol[] symbols)
{
var builder = new SpanBuilder();
builder.Kind = kind;
foreach (var symbol in symbols)
{
builder.Accept(symbol);
}
var span = builder.Build();
if (_last != null)
{
span.Previous = _last;
_last.Next = span;
}
_last = span;
return span;
}
示例3: TestSimpleSpan
public TestSimpleSpan(SpanKind kind, string content, AcceptedCharacters acceptedCharacters) : base(kind, content, hidden: false, acceptedCharacters: acceptedCharacters) { }
示例4: SingleSpanDocumentTest
protected virtual void SingleSpanDocumentTest(string document, BlockType blockType, SpanKind spanType)
{
Block b = CreateSimpleBlockAndSpan(document, blockType, spanType);
ParseDocumentTest(document, b);
}
示例5: GenerateSpans
private static Span[] GenerateSpans(string text, SpanKind spanKind, int spanIndex, string spanText)
{
Assert.True(spanIndex > 0);
RazorParser parser = new RazorParser(new CSharpCodeParser(), new HtmlMarkupParser());
Span[] spans;
using (var reader = new StringReader(text))
{
ParserResults results = parser.Parse(reader);
spans = results.Document.Flatten().ToArray();
}
Assert.True(spans.Length > spanIndex);
Assert.Equal(spanKind, spans[spanIndex].Kind);
Assert.Equal(spanText, spans[spanIndex].Content);
return spans;
}
示例6: CreateSymbolSpan
private SpanConstructor CreateSymbolSpan(SpanKind kind, string content, Func<SourceLocation, ISymbol> ctor)
{
var start = LocationTracker.CurrentLocation;
LocationTracker.UpdateLocation(content);
return new SpanConstructor(kind, new[] { ctor(start) });
}
示例7: Span
public SpanConstructor Span(SpanKind kind, string[] content, bool markup)
{
return new SpanConstructor(kind, Tokenize(content, markup));
}
示例8: Create
public static NamespaceImportSpan Create(ParserContext context, AcceptedCharacters acceptedCharacters, SpanKind kind, string ns, int namespaceKeywordLength) {
return new NamespaceImportSpan(kind, context.CurrentSpanStart, context.ContentBuffer.ToString(), acceptedCharacters, ns, namespaceKeywordLength);
}
示例9: NamespaceImportSpan
public NamespaceImportSpan(SpanKind kind, SourceLocation start, string content, AcceptedCharacters acceptedCharacters, string ns, int namespaceKeywordLength)
: base(kind, start, content, hidden: false, acceptedCharacters: acceptedCharacters) {
Namespace = ns;
NamespaceKeywordLength = namespaceKeywordLength;
}
示例10: Span
protected Span(ParserContext context, SpanKind kind, bool hidden, AcceptedCharacters acceptedCharacters) : this(kind, context.CurrentSpanStart, context.ContentBuffer.ToString(), hidden, acceptedCharacters) { }
示例11: TestSpan
/// <summary>
/// Test span to simplify the generation of the actual Span in test initializer.
/// </summary>
/// <param name="kind">Span kind</param>
/// <param name="start">Zero indexed start char index in the buffer.</param>
/// <param name="end">End Column, if the text length is zero Start == End.</param>
public TestSpan(SpanKind kind, int start, int end)
{
Kind = kind;
Start = start;
End = end;
}
示例12: GenerateSpan
private static Span GenerateSpan(string text, SpanKind spanKind, int spanIndex, string spanText)
{
Span[] spans = GenerateSpans(text, spanKind, spanIndex, spanText);
return spans[spanIndex];
}
示例13: CompleteTagBlockWithSpan
private void CompleteTagBlockWithSpan(IDisposable tagBlockWrapper,
AcceptedCharacters acceptedCharacters,
SpanKind spanKind)
{
Debug.Assert(tagBlockWrapper != null,
"Tag block wrapper should not be null when attempting to complete a block");
Span.EditHandler.AcceptedCharacters = acceptedCharacters;
// Write out the current span into the block before closing it.
Output(spanKind);
// Finish the tag block
tagBlockWrapper.Dispose();
}
示例14: SingleSpanBlockTest
protected virtual void SingleSpanBlockTest(string document, string spanContent, BlockType blockType, SpanKind spanType, AcceptedCharacters acceptedCharacters = AcceptedCharacters.Any)
{
SingleSpanBlockTest(document, spanContent, blockType, spanType, acceptedCharacters, expectedErrors: null);
}
示例15: SingleSpanDocumentTest
internal virtual void SingleSpanDocumentTest(string document, BlockType blockType, SpanKind spanType) {
ParseDocumentTest(document, new Block(blockType, new[] { new TestSimpleSpan(spanType, document) }));
}