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


C# Highlighting.Span类代码示例

本文整理汇总了C#中Mono.TextEditor.Highlighting.Span的典型用法代码示例。如果您正苦于以下问题:C# Span类的具体用法?C# Span怎么用?C# Span使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Span类属于Mono.TextEditor.Highlighting命名空间,在下文中一共展示了Span类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DefaultFoundSpanEnd

			void DefaultFoundSpanEnd (Span span, int offset, int length)
			{
				PopSpan ();
			}
开发者ID:nieve,项目名称:monodevelop,代码行数:4,代码来源:SyntaxMode.cs

示例2: CreatePreprocessorSpan

			public static Span CreatePreprocessorSpan ()
			{
				var result = new Span ();
				result.TagColor = "text.preprocessor";
				result.Color = "text.preprocessor";
				result.Rule = "String";
				result.StopAtEol = true;
				return result;
			}
开发者ID:Poiros,项目名称:monodevelop,代码行数:9,代码来源:CSharpSyntaxMode.cs

示例3: DefaultFoundSpanBegin

			void DefaultFoundSpanBegin (Span span, int offset, int length)
			{
				PushSpan (span, GetRule (span));
			}
开发者ID:nieve,项目名称:monodevelop,代码行数:4,代码来源:SyntaxMode.cs

示例4: FoundSpanEnd

			public void FoundSpanEnd (Span span, int offset, int length)
			{
				curChunk.Length = offset - curChunk.Offset;
				curChunk.Style  = GetStyle (curChunk) ?? GetChunkStyle (span);
				AddChunk (ref curChunk, 0, defaultStyle);

				curChunk.Offset = offset;
				curChunk.Length = length;
				curChunk.Style  = span.TagColor ?? GetChunkStyle (span);
				AddChunk (ref curChunk, 0, defaultStyle);
				spanParser.PopSpan ();
			}
开发者ID:nieve,项目名称:monodevelop,代码行数:12,代码来源:SyntaxMode.cs

示例5: ScanSpanEnd

 protected override bool ScanSpanEnd(Span cur, ref int i)
 {
     return base.ScanSpanEnd(cur, ref i);
 }
开发者ID:foerdi,项目名称:Mono-D,代码行数:4,代码来源:DSyntaxMode.cs

示例6: ScanSpanEnd

			protected virtual bool ScanSpanEnd (Span cur, ref int i)
			{
				int textOffset = i - StartOffset;
				
				if (cur.End != null) {
					RegexMatch match = cur.End.TryMatch (CurText, textOffset);
					if (match.Success) {
						FoundSpanEnd (cur, i, match.Length);
						i += match.Length - 1;
						return true;
					}
				}

				if (cur.Exit != null) {
					RegexMatch match = cur.Exit.TryMatch (CurText, textOffset);
					if (match.Success) {
						FoundSpanExit (cur, i, match.Length);
						i += match.Length - 1;
						return true;
					}
				}
				return false;
			}
开发者ID:nieve,项目名称:monodevelop,代码行数:23,代码来源:SyntaxMode.cs

示例7: FoundSpanBegin

			public void FoundSpanBegin (Span span, int offset, int length)
			{
				curChunk.Length = offset - curChunk.Offset;
				curChunk.Style = GetStyle (curChunk);
				if (string.IsNullOrEmpty (curChunk.Style)) {
//					Span tmpSpan = spanParser.SpanStack.Count > 0 ? spanParser.SpanStack.Pop () : null;
					curChunk.Style = GetSpanStyle ();
//					if (tmpSpan != null)
//						spanParser.SpanStack.Push (tmpSpan);
				}
				AddChunk (ref curChunk, 0, curChunk.Style);

				Rule spanRule = spanParser.GetRule (span);
				
				if (spanRule == null)
					throw new Exception ("Rule " + span.Rule + " not found in " + span);
				spanParser.PushSpan (span, spanRule);

				curChunk.Offset = offset;
				curChunk.Length = length;
				curChunk.Style  = span.TagColor ?? GetChunkStyle (span);
				curChunk.SpanStack.Push (span);
				AddChunk (ref curChunk, 0, curChunk.Style);
				foreach (SemanticRule semanticRule in spanRule.SemanticRules) {
					semanticRule.Analyze (this.doc, line, curChunk, offset, line.EndOffset);
				}
			}
开发者ID:nieve,项目名称:monodevelop,代码行数:27,代码来源:SyntaxMode.cs

示例8: PushSpan

			public void PushSpan (Span span, Rule rule)
			{
				spanStack.Push (span);
				ruleStack.Push (rule);
				CurRule = rule;
				CurSpan = span;
				if (rule.Name == "InterpolatedString" || rule.Name == "InterpolatedVerbatimString")
					interpolatedBraces.Push(0);
			}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:9,代码来源:SyntaxMode.cs

示例9: ScanSpanEnd

			protected virtual bool ScanSpanEnd (Span cur, ref int i)
			{
				int textOffset = i - StartOffset;
				
				if (cur.End != null) {
					if (interpolatedBraces.Count > 0) {
						char ch = CurText [textOffset];
						if (ch == '{')
							interpolatedBraces.Push (interpolatedBraces.Pop () + 1);
						else if (ch == '}')
							interpolatedBraces.Push (interpolatedBraces.Pop () - 1);
						if (interpolatedBraces.Peek () >= 1)
							return false;
					}
					RegexMatch match = cur.End.TryMatch (CurText, textOffset);
					if (match.Success) {
						FoundSpanEnd (cur, i, match.Length);
						i += System.Math.Max (0, match.Length - 1);
						return true;
					}
				}

				if (cur.Exit != null) {
					RegexMatch match = cur.Exit.TryMatch (CurText, textOffset);
					if (match.Success) {
						FoundSpanExit (cur, i, match.Length);
						i += System.Math.Max (0, match.Length - 1);
						return true;
					}
				}
				return false;
			}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:32,代码来源:SyntaxMode.cs

示例10: FoundSpanBegin

			public void FoundSpanBegin (Span span, int offset, int length)
			{
				curChunk.Length = offset - curChunk.Offset;
				curChunk.Style  = GetStyle (curChunk) ?? GetSpanStyle ();
				AddChunk (ref curChunk, 0, curChunk.Style);
				
				curChunk.Offset = offset;
				curChunk.Length = length;
				curChunk.Style  = GetChunkStyle (span);
				AddChunk (ref curChunk, 0, curChunk.Style);
				Rule spanRule = spanParser.GetRule (span);
				if (spanRule == null)
					throw new Exception ("Rule " + span.Rule + " not found in " + span);
				foreach (SemanticRule semanticRule in spanRule.SemanticRules) {
					semanticRule.Analyze (this.doc, line, curChunk, offset, line.EndOffset);
				}
			}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:17,代码来源:SyntaxMode.cs

示例11: EndsWithContinuation

			bool EndsWithContinuation (Span span, LineSegment line)
			{
				return !span.StopAtEol || span.StopAtEol && !string.IsNullOrEmpty (span.Continuation) &&
					line != null && doc.GetTextAt (line).Trim ().EndsWith (span.Continuation);
			}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:5,代码来源:SyntaxModeService.cs

示例12: ScanSpanEnd

			protected virtual bool ScanSpanEnd (Span cur, int i)
			{
				if (cur.End != null) {
					RegexMatch match = cur.End.TryMatch (doc, i);
					if (match.Success) {
						OnFoundSpanEnd (cur, i, match.Length);
						spanStack.Pop ();
						if (ruleStack.Count > 1) // rulStack[1] is always syntax mode
							ruleStack.Pop ();
						return true;
					}
				}
				
				if (cur.Exit != null) {
					RegexMatch match = cur.Exit.TryMatch (doc, i);
					if (match.Success) {
						spanStack.Pop ();
						if (ruleStack.Count > 1) // rulStack[1] is always syntax mode
							ruleStack.Pop ();
						OnFoundSpanExit (cur, i, match.Length);
						return true;
					}
				}
				return false;
			}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:25,代码来源:SyntaxMode.cs

示例13: OnFoundSpanEnd

			public virtual void OnFoundSpanEnd (Span span, int offset, int length)
			{
				if (FoundSpanEnd != null)
					FoundSpanEnd (span, offset, length);
			}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:5,代码来源:SyntaxMode.cs

示例14: OnFoundSpanBegin

			public virtual void OnFoundSpanBegin (Span span, int offset, int length)
			{
				if (FoundSpanBegin != null)
					FoundSpanBegin (span, offset, length);
			}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:5,代码来源:SyntaxMode.cs

示例15: PushSpan

			public void PushSpan (Span span, Rule rule)
			{
				spanStack.Push (span);
				ruleStack.Push (rule);
				this.CurRule = rule;
				this.CurSpan = span;
			}
开发者ID:nieve,项目名称:monodevelop,代码行数:7,代码来源:SyntaxMode.cs


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