コード例 #1
0
        IGlyphTextMethodMarker AddMarker(ModuleId module, uint token, uint ilOffset, ImageReference?glyphImage, string markerTypeName, string selectedMarkerTypeName, IClassificationType classificationType, int zIndex, object tag, IGlyphTextMarkerHandler handler, Func <ITextView, bool> textViewFilter)
        {
            var marker = new GlyphTextMethodMarker(module, token, ilOffset, glyphImage, markerTypeName, selectedMarkerTypeName, classificationType, zIndex, tag, handler, textViewFilter);

            glyphTextMarkers.Add(marker);
            MarkerAdded?.Invoke(this, new GlyphTextMarkerAddedEventArgs(marker));
            return(marker);
        }
コード例 #2
0
 IGlyphTextMethodMarker IGlyphTextMarkerService.AddMarker(ModuleTokenId tokenId, uint ilOffset, ImageReference?glyphImage, string markerTypeName, string selectedMarkerTypeName, IClassificationType classificationType, int zIndex, object tag, IGlyphTextMarkerHandler handler, Func <ITextView, bool> textViewFilter) =>
 AddMarker(tokenId.Module, tokenId.Token, ilOffset, glyphImage, markerTypeName, selectedMarkerTypeName, classificationType, zIndex, tag, handler, textViewFilter);
コード例 #3
0
 public GlyphTextDotNetTokenMarker(ModuleId module, uint token, ImageReference?glyphImage, string markerTypeName, string selectedMarkerTypeName, IClassificationType classificationType, int zIndex, object tag, IGlyphTextMarkerHandler handler, Func <ITextView, bool> textViewFilter)
 {
     Module = module;
     Token  = token;
     GlyphImageReference    = glyphImage == null || glyphImage.Value.IsDefault ? null : glyphImage;
     MarkerTypeName         = markerTypeName;
     SelectedMarkerTypeName = selectedMarkerTypeName;
     ClassificationType     = classificationType;
     ZIndex         = zIndex;
     Tag            = tag;
     Handler        = handler ?? NullGlyphTextMarkerHandler.Instance;
     TextViewFilter = textViewFilter ?? defaultTextViewFilter;
 }
コード例 #4
0
        public IGlyphTextMarker AddMarker(GlyphTextMarkerLocationInfo location, ImageReference?glyphImage, string markerTypeName, string selectedMarkerTypeName, IClassificationType classificationType, int zIndex, object tag, IGlyphTextMarkerHandler handler, Func <ITextView, bool> textViewFilter)
        {
            if (location == null)
            {
                throw new ArgumentNullException(nameof(location));
            }
            switch (location)
            {
            case DotNetMethodBodyGlyphTextMarkerLocationInfo bodyLoc:
                return(AddMarker(bodyLoc.Module, bodyLoc.Token, bodyLoc.ILOffset, glyphImage, markerTypeName, selectedMarkerTypeName, classificationType, zIndex, tag, handler, textViewFilter));

            case DotNetTokenGlyphTextMarkerLocationInfo tokenLoc:
                return(AddMarker(tokenLoc.Module, tokenLoc.Token, glyphImage, markerTypeName, selectedMarkerTypeName, classificationType, zIndex, tag, handler, textViewFilter));

            default:
                throw new InvalidOperationException();
            }
        }
コード例 #5
0
 public IGlyphTextMethodMarker AddMarker(MethodDef method, uint ilOffset, ImageReference?glyphImage, string markerTypeName, string selectedMarkerTypeName, IClassificationType classificationType, int zIndex, object tag, IGlyphTextMarkerHandler handler, Func <ITextView, bool> textViewFilter)
 {
     if (method == null)
     {
         throw new ArgumentNullException(nameof(method));
     }
     return(AddMarker(new ModuleTokenId(moduleIdProvider.Create(method.Module), method.MDToken), ilOffset, glyphImage, markerTypeName, selectedMarkerTypeName, classificationType, zIndex, tag, handler, textViewFilter));
 }
コード例 #6
0
 public GlyphTextMethodMarker(ModuleTokenId method, uint ilOffset, ImageReference?glyphImage, string markerTypeName, string selectedMarkerTypeName, IClassificationType classificationType, int zIndex, object tag, IGlyphTextMarkerHandler handler, Func <ITextView, bool> textViewFilter)
 {
     Method                 = method;
     ILOffset               = ilOffset;
     GlyphImageReference    = glyphImage == null || glyphImage.Value.IsDefault ? null : glyphImage;
     MarkerTypeName         = markerTypeName;
     SelectedMarkerTypeName = selectedMarkerTypeName;
     ClassificationType     = classificationType;
     ZIndex                 = zIndex;
     Tag            = tag;
     Handler        = handler ?? NullGlyphTextMarkerHandler.Instance;
     TextViewFilter = textViewFilter ?? defaultTextViewFilter;
 }