public InformationQuickInfoContentVM(InformationQuickInfoContent content, IRoslynGlyphService roslynGlyphService, IClassificationFormatMap classificationFormatMap, IThemeClassificationTypeService themeClassificationTypeService) { if (content == null) { throw new ArgumentNullException(nameof(content)); } if (roslynGlyphService == null) { throw new ArgumentNullException(nameof(roslynGlyphService)); } if (classificationFormatMap == null) { throw new ArgumentNullException(nameof(classificationFormatMap)); } if (themeClassificationTypeService == null) { throw new ArgumentNullException(nameof(themeClassificationTypeService)); } var sb = new StringBuilder(); if (content.SymbolGlyph != null) { SymbolImageSource = roslynGlyphService.GetImage(content.SymbolGlyph.Value, BackgroundType.QuickInfo); } if (content.WarningGlyph != null) { WarningImageSource = roslynGlyphService.GetImage(content.WarningGlyph.Value, BackgroundType.QuickInfo); } MainDescriptionObject = TryCreateObject(sb, content.MainDescription, classificationFormatMap, themeClassificationTypeService); DocumentationObject = TryCreateObject(sb, content.Documentation, classificationFormatMap, themeClassificationTypeService); UsageObject = TryCreateObject(sb, content.UsageText, classificationFormatMap, themeClassificationTypeService); TypeParameterMapObject = TryCreateObject(sb, content.TypeParameterMap, classificationFormatMap, themeClassificationTypeService); AnonymousTypesObject = TryCreateObject(sb, content.AnonymousTypes, classificationFormatMap, themeClassificationTypeService); ExceptionObject = TryCreateObject(sb, content.ExceptionText, classificationFormatMap, themeClassificationTypeService); }
public InformationQuickInfoContentVM(ITextView textView, InformationQuickInfoContent content, IClassificationFormatMap classificationFormatMap, IThemeClassificationTypeService themeClassificationTypeService) { if (textView == null) { throw new ArgumentNullException(nameof(textView)); } if (content == null) { throw new ArgumentNullException(nameof(content)); } if (classificationFormatMap == null) { throw new ArgumentNullException(nameof(classificationFormatMap)); } if (themeClassificationTypeService == null) { throw new ArgumentNullException(nameof(themeClassificationTypeService)); } var sb = new StringBuilder(); if (content.SymbolGlyph != null) { SymbolImageReference = content.SymbolGlyph.Value.GetImageReference() ?? default; } if (content.WarningGlyph != null) { WarningImageReference = content.WarningGlyph.Value.GetImageReference() ?? default; } MainDescriptionObject = TryCreateObject(sb, content.MainDescription, classificationFormatMap, themeClassificationTypeService); DocumentationObject = TryCreateObject(sb, content.Documentation, classificationFormatMap, themeClassificationTypeService); UsageObject = TryCreateObject(sb, content.UsageText, classificationFormatMap, themeClassificationTypeService); TypeParameterMapObject = TryCreateObject(sb, content.TypeParameterMap, classificationFormatMap, themeClassificationTypeService); AnonymousTypesObject = TryCreateObject(sb, content.AnonymousTypes, classificationFormatMap, themeClassificationTypeService); ExceptionObject = TryCreateObject(sb, content.ExceptionText, classificationFormatMap, themeClassificationTypeService); }
IEnumerable <object> Create(InformationQuickInfoContent content) { yield return(new InformationQuickInfoContentControl { DataContext = new InformationQuickInfoContentVM(textView, content, classificationFormatMap, themeClassificationTypeService), }); }