本文整理汇总了C#中IClassificationTypeRegistryService类的典型用法代码示例。如果您正苦于以下问题:C# IClassificationTypeRegistryService类的具体用法?C# IClassificationTypeRegistryService怎么用?C# IClassificationTypeRegistryService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IClassificationTypeRegistryService类属于命名空间,在下文中一共展示了IClassificationTypeRegistryService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MarkdownCodeTest
public MarkdownCodeTest(MarkdownEditorMefCatalogFixture catalogFixture) {
_exportProvider = catalogFixture.CreateExportProvider();
_crs = _exportProvider.GetExportedValue<IClassificationTypeRegistryService>();
_ctrs = _exportProvider.GetExportedValue<IContentTypeRegistryService>();
_cnp = _exportProvider.GetExports<IClassificationNameProvider, IComponentContentTypes>();
_tbfs = _exportProvider.GetExportedValue<ITextBufferFactoryService>();
}
示例2: JadeClassifierProvider
public JadeClassifierProvider(IClassificationTypeRegistryService registryService,
ITextBufferFactoryService bufferFact,
IContentTypeRegistryService contentTypeService,
[ImportMany(typeof(ITaggerProvider))]Lazy<ITaggerProvider, TaggerProviderMetadata>[] taggerProviders,
[ImportMany(typeof(IClassifierProvider))]Lazy<IClassifierProvider, IClassifierProviderMetadata>[] classifierProviders) {
ClassificationRegistryService = registryService;
BufferFactoryService = bufferFact;
JsContentType = contentTypeService.GetContentType(NodejsConstants.JavaScript);
CssContentType = contentTypeService.GetContentType(NodejsConstants.CSS);
var jsTagger = taggerProviders.Where(
provider =>
provider.Metadata.ContentTypes.Contains(NodejsConstants.JavaScript) &&
provider.Metadata.TagTypes.Any(tagType => tagType.IsSubclassOf(typeof(ClassificationTag)))
).FirstOrDefault();
if (JsTaggerProvider != null) {
JsTaggerProvider = jsTagger.Value;
}
var cssTagger = classifierProviders.Where(
provider => provider.Metadata.ContentTypes.Any(x => x.Equals("css", StringComparison.OrdinalIgnoreCase))
).FirstOrDefault();
if (cssTagger != null) {
CssClassifierProvider = cssTagger.Value;
}
}
示例3: WacomTranslationDatabaseHighlighter
internal WacomTranslationDatabaseHighlighter(IClassificationTypeRegistryService registry)
{
_keyType = registry.GetClassificationType("wacom.tdb.key");
_valType = registry.GetClassificationType("wacom.tdb.value");
_sepType = registry.GetClassificationType("wacom.tdb.separator");
_errType = registry.GetClassificationType("wacom.tdb.error");
}
开发者ID:ben,项目名称:WacomTranslationDatabaseHighlighter,代码行数:7,代码来源:WacomTranslationDatabaseHighlighter.cs
示例4: FindResultsClassifier
public FindResultsClassifier(
IVscSettingsService settingsService,
IVisualStudioEventsService vsEventsService,
IClassificationTypeRegistryService typeRegistryService,
IClassificationFormatMapService formatMapService,
IVsFontAndColorStorage fontAndColorStorageService,
DTE2 dte)
: base(settingsService,
vsEventsService,
typeRegistryService,
formatMapService,
fontAndColorStorageService,
"find results")
{
this.Dte = dte;
IsEnabled = true;
AddClassificationType(ClassificationNames.FindResultsOutputMatch);
OutputWindowTextClassificationOverride = ClassificationNames.OutputText;
ShouldOverrideOutputWindowTextClassification = true;
RefreshClassifications();
}
示例5: MarkdownClassifier
public MarkdownClassifier(IClassificationTypeRegistryService registry)
{
_bold = registry.GetClassificationType(MarkdownClassificationTypes.MarkdownBold);
_italic = registry.GetClassificationType(MarkdownClassificationTypes.MarkdownItalic);
_header = registry.GetClassificationType(MarkdownClassificationTypes.MarkdownHeader);
_code = registry.GetClassificationType(MarkdownClassificationTypes.MarkdownCode);
}
示例6: VendorClassifier
internal VendorClassifier(IClassificationTypeRegistryService registry, ITextBuffer buffer)
{
_registry = registry;
_buffer = buffer;
_decClassification = _registry.GetClassificationType(ClassificationTypes._declaration);
_valClassification = _registry.GetClassificationType(ClassificationTypes._value);
}
示例7: SqlClassifier
internal SqlClassifier(ITagAggregator<NaturalTextTag> tagger, IClassificationTypeRegistryService classificationRegistry)
{
this.tagger = tagger;
keywordType = classificationRegistry.GetClassificationType("sql-keyword");
functionType = classificationRegistry.GetClassificationType("sql-function");
variableType = classificationRegistry.GetClassificationType("sql-variable");
}
示例8: UvssClassifier
/// <summary>
/// Initializes a new instance of the <see cref="UvssClassifier"/> class.
/// </summary>
/// <param name="registry">The classification registry.</param>
/// <param name="parserService">The UVSS language parser service.</param>
/// <param name="buffer">The text buffer that contains the text being classified.</param>
internal UvssClassifier(IClassificationTypeRegistryService registry, ITextBuffer buffer)
{
this.registry = registry;
this.buffer = UvssTextBuffer.ForBuffer(buffer);
this.buffer.CommentSpanInvalidated += (obj, span) =>
RaiseClassificationChanged(new SnapshotSpan(this.buffer.Buffer.CurrentSnapshot, span));
}
示例9: DothtmlClassifier
/// <summary>
/// Initializes a new instance of the <see cref="DothtmlClassifier"/> class.
/// </summary>
public DothtmlClassifier(IClassificationTypeRegistryService registry, ITextBuffer buffer)
{
tokenizer = new DothtmlTokenizer();
this.buffer = buffer;
bindingBrace = registry.GetClassificationType(DothtmlClassificationTypes.BindingBrace);
bindingContent = registry.GetClassificationType(DothtmlClassificationTypes.BindingContent);
}
示例10: GetClassificationSpans
public static IList<ClassificationSpan> GetClassificationSpans(SnapshotSpan snapshotSpan, IClassificationTypeRegistryService registry)
{
// string fileContent = snapshotSpan.Snapshot.GetText(0, snapshotSpan.End.Position);
string fileContent = snapshotSpan.Snapshot.GetText();
var gherkinListener = new SyntaxColoringListener(snapshotSpan, registry);
I18n languageService = new I18n("en");
try
{
Lexer lexer = languageService.lexer(gherkinListener);
lexer.scan(fileContent, null, 0);
return gherkinListener.Classifications;
}
catch //(Exception ex)
{
/*
var errorClassificationType = registry.GetClassificationType("error");
int startIndex = 0;
if (gherkinListener.Classifications.Any())
{
var last = gherkinListener.Classifications.Last();
startIndex = last.Span.Start + last.Span.Length;
}
gherkinListener.Classifications.Add(new ClassificationSpan(
new SnapshotSpan(snapshotSpan.Snapshot, startIndex, snapshotSpan.Snapshot.Length - startIndex),
errorClassificationType));
*/
return gherkinListener.Classifications;
}
}
示例11: UsageClassifier
public UsageClassifier(IClassificationTypeRegistryService classificationRegistry, ITextBuffer textBuffer)
{
_highlightOne = classificationRegistry.GetClassificationType(ClassificationTypes.HighlightOneName);
_highlightTwo = classificationRegistry.GetClassificationType(ClassificationTypes.HighlightTwoName);
_textBuffer = textBuffer;
_textBuffer.Changed += (_, args) => UpdateUsageHighlighting(Enumerable.Empty<GotoInfo>());
}
示例12: OutputClassifier
public OutputClassifier(IClassificationTypeRegistryService classificationRegistry)
{
this.classificationRegistry = classificationRegistry;
this.messageTypeCharPosition = "[BuildEngine] ".Length;
InitializeClassifiers();
}
示例13: ClassificationFormatMapService
protected ClassificationFormatMapService(IThemeService themeService, IEditorFormatMapService editorFormatMapService, IEditorFormatDefinitionService editorFormatDefinitionService, IClassificationTypeRegistryService classificationTypeRegistryService) {
this.themeService = themeService;
this.editorFormatMapService = editorFormatMapService;
this.editorFormatDefinitionService = editorFormatDefinitionService;
this.classificationTypeRegistryService = classificationTypeRegistryService;
toCategoryMap = new Dictionary<IEditorFormatMap, IClassificationFormatMap>();
}
示例14: SyntaxQuickinfoBuilderService
public SyntaxQuickinfoBuilderService(IClassificationFormatMapService classificationFormatMapService,
IClassificationTypeRegistryService classificationTypeRegistryService) {
_classificationFormatMapService = classificationFormatMapService;
_classificationMap = ClassificationTypeDefinitions.GetSyntaxTokenClassificationMap(classificationTypeRegistryService);
}
示例15: MarkdownClassifier
public MarkdownClassifier(ITextBuffer buffer, IClassificationTypeRegistryService classificationRegistry)
{
_classificationRegistry = classificationRegistry;
_buffer = buffer;
_buffer.Changed += BufferChanged;
}