當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。