Esempio n. 1
0
        MarkerElement TryCreateMarkerElement(SnapshotSpan span, IGlyphTextMarkerTag tag)
        {
            Debug.Assert(tag.MarkerTypeName != null);
            var geo = TextView.TextViewLines.GetMarkerGeometry(span);

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

            var type          = tag.MarkerTypeName ?? string.Empty;
            var props         = editorFormatMap.GetProperties(type);
            var markerElement = new MarkerElement(span, type, tag.ZIndex, geo);

            markerElement.BackgroundBrush = GetBackgroundBrush(props);
            markerElement.Pen             = GetPen(props);
            return(markerElement);
        }
		MarkerElement TryCreateMarkerElement(SnapshotSpan span, IGlyphTextMarkerTag tag) {
			Debug.Assert(tag.MarkerTypeName != null);
			var geo = TextView.TextViewLines.GetMarkerGeometry(span);
			if (geo == null)
				return null;

			var type = tag.MarkerTypeName ?? string.Empty;
			var selectedType = tag.SelectedMarkerTypeName;
			var propName = (selectedType != null && IsSelected(span) ? selectedType : type) ?? type;
			var props = editorFormatMap.GetProperties(propName);
			var markerElement = new MarkerElement(span, propName, type, selectedType, tag.ZIndex, geo);
			markerElement.BackgroundBrush = GetBackgroundBrush(props);
			markerElement.Pen = GetPen(props);
			return markerElement;
		}