public
Description: A sample VS2010 extension that renders C# some keywords in a different color.
Homepage:
Clone URL: git://github.com/tomasr/KeywordClassifier.git
KeywordClassifier / Classifications.cs
100644 65 lines (60 sloc) 2.45 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Windows.Media;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Utilities;
 
namespace Winterdom.VisualStudio.Extensions.Text {
 
   public static class FlowControlClassificationDefinition {
[Export(typeof(ClassificationTypeDefinition))]
[Name(Constants.CLASSIF_NAME)]
      internal static ClassificationTypeDefinition FlowControlClassificationType = null;
   }
   public static class LinqKeywordClassificationDefinition {
[Export(typeof(ClassificationTypeDefinition))]
[Name(Constants.LINQ_CLASSIF_NAME)]
      internal static ClassificationTypeDefinition LinqKeywordClassificationType = null;
   }
   public static class VisibilityKeywordClassificationDefinition {
[Export(typeof(ClassificationTypeDefinition))]
[Name(Constants.VISIBILITY_CLASSIF_NAME)]
      internal static ClassificationTypeDefinition VisibilityKeywordClassificationType = null;
   }
 
[Export(typeof(EditorFormatDefinition))]
[ClassificationType(ClassificationTypeNames = Constants.CLASSIF_NAME)]
[Name(Constants.CLASSIF_NAME)]
[DisplayName("Keyword - Flow Control")]
[UserVisible(true)]
[Order(After = Priority.High)]
   public sealed class FlowControlFormat : ClassificationFormatDefinition {
      public FlowControlFormat() {
         this.ForegroundColor = Colors.MediumTurquoise;
         this.IsItalic = true;
      }
   }
 
[Export(typeof(EditorFormatDefinition))]
[ClassificationType(ClassificationTypeNames = Constants.LINQ_CLASSIF_NAME)]
[Name(Constants.LINQ_CLASSIF_NAME)]
[DisplayName("Operator - LINQ")]
[UserVisible(true)]
[Order(After = Priority.High)]
   public sealed class LinqKeywordFormat : ClassificationFormatDefinition {
      public LinqKeywordFormat() {
         this.ForegroundColor = Colors.MediumSeaGreen;
      }
   }
[Export(typeof(EditorFormatDefinition))]
[ClassificationType(ClassificationTypeNames = Constants.VISIBILITY_CLASSIF_NAME)]
[Name(Constants.VISIBILITY_CLASSIF_NAME)]
[DisplayName("Keyword - Visibility")]
[UserVisible(true)]
[Order(After = Priority.High)]
   public sealed class VisibilityKeywordFormat : ClassificationFormatDefinition {
      public VisibilityKeywordFormat() {
         this.ForegroundColor = Colors.DimGray;
         this.IsBold = true;
      }
   }
}