当前位置: 首页>>代码示例>>C#>>正文


C# SpanKind类代码示例

本文整理汇总了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);
     }
 }
开发者ID:AndersBillLinden,项目名称:Mvc,代码行数:10,代码来源:SpanConstructor.cs

示例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;
		}
开发者ID:furesoft,项目名称:FuManchu,代码行数:20,代码来源:Factory.cs

示例3: TestSimpleSpan

 public TestSimpleSpan(SpanKind kind, string content, AcceptedCharacters acceptedCharacters) : base(kind, content, hidden: false, acceptedCharacters: acceptedCharacters) { }
开发者ID:adrianvallejo,项目名称:MVC3_Source,代码行数:1,代码来源:TestSimpleSpan.cs

示例4: SingleSpanDocumentTest

 protected virtual void SingleSpanDocumentTest(string document, BlockType blockType, SpanKind spanType)
 {
     Block b = CreateSimpleBlockAndSpan(document, blockType, spanType);
     ParseDocumentTest(document, b);
 }
开发者ID:huangw-t,项目名称:aspnetwebstack,代码行数:5,代码来源:MarkupParserTestBase.cs

示例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;
        }
开发者ID:KennyBu,项目名称:Razor,代码行数:20,代码来源:PaddingTest.cs

示例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) });
 }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:6,代码来源:SpanFactory.cs

示例7: Span

 public SpanConstructor Span(SpanKind kind, string[] content, bool markup)
 {
     return new SpanConstructor(kind, Tokenize(content, markup));
 }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:4,代码来源:SpanFactory.cs

示例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);
 }
开发者ID:jesshaw,项目名称:ASP.NET-Mvc-3,代码行数:3,代码来源:NamespaceImportSpan.cs

示例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;
 }
开发者ID:jesshaw,项目名称:ASP.NET-Mvc-3,代码行数:5,代码来源:NamespaceImportSpan.cs

示例10: Span

 protected Span(ParserContext context, SpanKind kind, bool hidden, AcceptedCharacters acceptedCharacters) : this(kind, context.CurrentSpanStart, context.ContentBuffer.ToString(), hidden, acceptedCharacters) { }
开发者ID:jesshaw,项目名称:ASP.NET-Mvc-3,代码行数:1,代码来源:Span.cs

示例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;
 }
开发者ID:huangw-t,项目名称:aspnetwebstack,代码行数:12,代码来源:TestSpan.cs

示例12: GenerateSpan

        private static Span GenerateSpan(string text, SpanKind spanKind, int spanIndex, string spanText)
        {
            Span[] spans = GenerateSpans(text, spanKind, spanIndex, spanText);

            return spans[spanIndex];
        }
开发者ID:KennyBu,项目名称:Razor,代码行数:6,代码来源:PaddingTest.cs

示例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();
        }
开发者ID:huoxudong125,项目名称:Razor,代码行数:13,代码来源:HtmlMarkupParser.Block.cs

示例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);
 }
开发者ID:x-strong,项目名称:Razor,代码行数:4,代码来源:ParserTestBase.cs

示例15: SingleSpanDocumentTest

 internal virtual void SingleSpanDocumentTest(string document, BlockType blockType, SpanKind spanType) {
     ParseDocumentTest(document, new Block(blockType, new[] { new TestSimpleSpan(spanType, document) }));
 }
开发者ID:jesshaw,项目名称:ASP.NET-Mvc-3,代码行数:3,代码来源:MarkupParserTestBase.cs


注:本文中的SpanKind类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。