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(ImageReference); if (content.WarningGlyph != null) WarningImageReference = content.WarningGlyph.Value.GetImageReference() ?? default(ImageReference); 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), }; }