Exemplo n.º 1
0
        public UIElement GenerateGlyph(IWpfTextViewLine line, IGlyphTag tag)
        {
            ErrorGlyphTag errorDetails = tag as ErrorGlyphTag;

            if (errorDetails == null)
            {
                return(null);
            }

            BitmapImage glyphImage = null;

            switch (errorDetails.ErrorLevel)
            {
            case vsBuildErrorLevel.vsBuildErrorLevelHigh:
                glyphImage = _errorIcon;
                break;

            case vsBuildErrorLevel.vsBuildErrorLevelMedium:
                glyphImage = _warningIcon;
                break;

            case vsBuildErrorLevel.vsBuildErrorLevelLow:
                glyphImage = _infoIcon;
                break;
            }

            Image glyphIcon = new Image();

            glyphIcon.Width  = 16;
            glyphIcon.Height = 16;
            glyphIcon.Source = glyphImage;

            return(glyphIcon);
        }
Exemplo n.º 2
0
 private void SetTooltip(ErrorGlyphTag newTag, ITrackingSpan trackingSpan)
 {
     if (newTag != null)
     {
         if ((_currentTag == null) || (newTag.Description != _currentTag.Description))
         {
             _toolTipProvider.ShowToolTip(trackingSpan, newTag.Description);
             _currentTag = newTag;
         }
     }
     else if (_currentTag != null)
     {
         _toolTipProvider.ClearToolTip();
         _currentTag = null;
     }
 }