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


C# Highlighting.ColorScheme类代码示例

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


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

示例1: GetIsValid

		public virtual bool GetIsValid (ColorScheme style)
		{
			foreach (Keywords keyword in keywords) {
				if (!keyword.GetIsValid (style)) {
					System.Console.WriteLine (keyword + " failed.");
					return false;
				}
			}
			foreach (Span span in spans) {
				if (!span.GetIsValid (style)) {
					System.Console.WriteLine (span + " failed.");
					return false;
				}
			}
			foreach (Match match in matches) {
				if (!match.GetIsValid (style)) {
					System.Console.WriteLine (match + " failed.");
					return false;
				}
			}
			foreach (Marker marker in prevMarker) {
				if (!marker.GetIsValid (style)) {
					System.Console.WriteLine (marker + " failed.");
					return false;
				}
			}
			return true;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:28,代码来源:Rule.cs

示例2: GetFileNameForStyle

		public static string GetFileNameForStyle (ColorScheme style)
		{
			string result;
			if (!isLoadedFromFile.TryGetValue (style.Name, out result))
				return null;
			return result;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:7,代码来源:SyntaxModeService.cs

示例3: InvalidMimeTypeInScriptTypeAttribute

		public void InvalidMimeTypeInScriptTypeAttribute ()
		{
			var doc = new TextDocument ();
			var syntaxMode = new WebFormsSyntaxMode ();
			syntaxMode.Document = doc;
			doc.Text = 
@"<%@ Page Language=""C#"" Inherits=""AspnetTest.Default"" %>
<!DOCTYPE html>
<html>
<head runat=""server"">
	<title>Default</title>
</head>
<body>
	<form id=""form1"" runat=""server"">
		<asp:Button id=""button1"" runat=""server"" Text=""Click me!"" OnClick=""button1Clicked"" />
	</form>
	<script type=""></script>
</body>
</html>
";
			var style = new ColorScheme ();
			foreach (DocumentLine line in doc.Lines) {
				Assert.DoesNotThrow (() => syntaxMode.GetChunks (style, line, line.Offset, line.Length).ToList ());
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:25,代码来源:WebFormsSyntaxModeTests.cs

示例4: GetIsValid

		public virtual bool GetIsValid (ColorScheme style)
		{
			if (style.GetChunkStyle (Color) == null) {
				System.Console.WriteLine("color:" + Color + " not found.");
				return false;
			}
			return true;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:8,代码来源:Keywords.cs

示例5: SignatureMarkupCreator

		public SignatureMarkupCreator (CSharpResolver resolver, CSharpFormattingOptions formattingOptions)
		{
			this.colorStyle = SyntaxModeService.GetColorStyle (MonoDevelop.Ide.IdeApp.Preferences.ColorScheme);

			this.resolver = resolver;
			this.astBuilder = new TypeSystemAstBuilder (resolver) {
				ConvertUnboundTypeArguments = true,
				UseAliases = false
			};
			this.formattingOptions = formattingOptions;
		}
开发者ID:Chertolom,项目名称:monodevelop,代码行数:11,代码来源:SignatureMarkupCreator.cs

示例6: Create

		public static TooltipInformation Create(DNode dn, ColorScheme st, bool templateParamCompletion = false, int currentMethodParam = -1)
		{
			var markupGen = new TooltipMarkupGen (st);

			var tti = new TooltipInformation { 
				SignatureMarkup = markupGen.GenTooltipSignature(dn, templateParamCompletion, currentMethodParam)
			};

			CreateTooltipBody (markupGen, dn, tti);

			return tti;
		}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:12,代码来源:TooltipInfoGen.cs

示例7: ApplyStyle

		void ApplyStyle (ColorScheme sheme)
		{
			sheme.Name = entryName.Text;
			sheme.Description = entryDescription.Text;
			
			Gtk.TreeIter iter;
			if (colorStore.GetIterFirst (out iter)) {
				do {
					var data = (ColorScheme.PropertyDecsription)colorStore.GetValue (iter, 1);
					var style = colorStore.GetValue (iter, 2);
					data.Info.SetValue (sheme, style, null);
				} while (colorStore.IterNext (ref iter));
			}
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:14,代码来源:ColorShemeEditor.cs

示例8: GetChunks

		public override IEnumerable<Chunk> GetChunks (ColorScheme style, DocumentLine line, int offset, int length)
		{
			// Multiline comment
			if (line.StartSpan.Count != 0 && line.StartSpan.Peek ().Begin.Pattern == "@*")
				return base.GetChunks (style, line, offset, length);

			var tokenizer = new CSharpTokenizer (new SeekableTextReader (doc.GetTextAt (offset, length)));
			chunks = new List<Chunk> ();
			CSharpSymbol symbol;
			CSharpSymbol prevSymbol = null;
			int off = line.Offset;
			currentState = State.None;

			while ((symbol = tokenizer.NextSymbol ()) != null) {
				// Apostrophes in text
				bool inApostrophes = false;
				if (symbol.Type == CSharpSymbolType.CharacterLiteral && prevSymbol != null && Char.IsLetterOrDigit (prevSymbol.Content.Last ())) {
					if (symbol.Content.Last () == '\'')
						inApostrophes = true;
					else {
						chunks.Add (new Chunk (off, 1, "Plain Text"));
						off++;
						tokenizer = new CSharpTokenizer (new SeekableTextReader (symbol.Content.Substring (1)));
						symbol = tokenizer.NextSymbol ();
						prevSymbol = null;
					}
				}

				string chunkStyle = inApostrophes ? "Plain Text" : GetStyleForChunk (symbol, prevSymbol, off);
				chunks.Add (new Chunk (off, symbol.Content.Length, chunkStyle));
				prevSymbol = symbol;
				off += symbol.Content.Length;
			}

			return chunks;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:36,代码来源:RazorSyntaxMode.cs

示例9: GetProvider

		public static IStreamProvider GetProvider (ColorScheme style)
		{
			if (styleLookup.ContainsKey (style.Name)) 
				return styleLookup[style.Name];
			return null;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:6,代码来源:SyntaxModeService.cs

示例10: AddStyle

		public static void AddStyle (ColorScheme style)
		{
			styles [style.Name] = style;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:4,代码来源:SyntaxModeService.cs

示例11: Remove

		public static void Remove (ColorScheme style)
		{
			if (styleLookup.ContainsKey (style.Name))
				styleLookup.Remove (style.Name);

			foreach (var kv in styles) {
				if (kv.Value == style) {
					styles.Remove (kv.Key); 
					return;
				}
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:12,代码来源:SyntaxModeService.cs

示例12: ChunkParser

			public ChunkParser (SyntaxMode mode, SpanParser spanParser, ColorScheme style, DocumentLine line)
			{
				this.mode = mode;
				this.doc = mode.Document;
				this.line = line;
				this.lineOffset = line.Offset;
				this.spanParser = spanParser;
				spanParser.FoundSpanBegin = FoundSpanBegin;
				spanParser.FoundSpanEnd = FoundSpanEnd;
				spanParser.FoundSpanExit = FoundSpanExit;
				spanParser.ParseChar += ParseChar;
				spanParser.IsAtWordStart = () => wordbuilder.Length == 0;
				if (line == null)
					throw new ArgumentNullException ("line");
			}
开发者ID:OnorioCatenacci,项目名称:monodevelop,代码行数:15,代码来源:SyntaxMode.cs

示例13: CreateChunkParser

		public virtual ChunkParser CreateChunkParser (SpanParser spanParser, ColorScheme style, DocumentLine line)
		{
			return new ChunkParser (this, spanParser, style, line);
		}
开发者ID:OnorioCatenacci,项目名称:monodevelop,代码行数:4,代码来源:SyntaxMode.cs

示例14: AddStyle

		public static void AddStyle (string fileName, ColorScheme style)
		{
			isLoadedFromFile [style.Name] = fileName;
			styles [style.Name] = style;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:5,代码来源:SyntaxModeService.cs

示例15: Clone

		public ColorScheme Clone ()
		{
			var result = new ColorScheme () {
				Name = this.Name,
				BaseScheme = this.BaseScheme,
				Originator = this.Originator,
				Description = this.Description
			};
			result.CopyValues (this);
			return result;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:11,代码来源:ColorScheme.cs


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