C# Class Microsoft.Sarif.Viewer.ResultTextMarker

This class represents an instance of "highlighed" line in the editor, holds necessary Shell objects and logic to managed lifecycle and appearance.
Afficher le fichier Open project: Microsoft/sarif-sdk Class Usage Examples

Méthodes publiques

Méthode Description
AddHighlightMarker ( string highlightColor ) : void

Select current tracking text with highlightColor. If highlightColor is null than code will be selected with color from Color. If the mark doesn't support tracking changes, then we simply ignore this condition (addresses VS crash reported in Bug 476347 : Code Analysis clicking error report C6244 causes VS2012 to crash). Tracking changes helps to ensure that we nativate to the right line even if edits to the file have occured, but even if that behavior doesn't work right, it is better to simply return here (before the fix this code threw an exception which terminated VS).

AddTracking ( IWpfTextView wpfTextView, ITextSnapshot textSnapshot, long docCookie, Span span ) : void

Add tracking for text in span for document with id docCookie.

AttachToDocument ( string documentName, long docCookie, IVsWindowFrame frame ) : void

An overridden method for reacting to the event of a document window being opened

CanAttachToDocument ( string documentName, long docCookie, IVsWindowFrame frame ) : bool

Determines if a document can be associated with this ResultTextMarker.

Clear ( ) : void

Clear all markers and tracking classes

DetachFromDocument ( long docCookie ) : void
GetSourceLocation ( ) : Region

Get source location of current marker (tracking code place).

IsTracking ( long docCookie ) : bool

Check if current class track changes for document docCookie

RemoveHighlightMarker ( ) : void

Remove selection for tracking text

ResultTextMarker ( IServiceProvider serviceProvider, Region region, string fullFilePath ) : System

fullFilePath may be null for global issues.

SaveCurrentTrackingData ( ) : void

Save current tracking data to stored source location. If user will change, save, close and after that open document which has tracking data this class will not loose place where code exists.

Méthodes protégées

Méthode Description
OnRaiseRegionSelected ( EventArgs e ) : void

Private Methods

Méthode Description
AttachMarkerToTextView ( IWpfTextView textView, long docCookie, ResultTextMarker marker, int line, int column, int endLine, int endColumn ) : void

Highlight the source code on a particular line

AttachToDocumentWorker ( IVsWindowFrame frame, long docCookie ) : void

Check that current marker point to correct line position and attach it to docCookie for track changes.

CaretPositionChanged ( object sender, CaretPositionChangedEventArgs e ) : void
CreateTracking ( IWpfTextView textView, ITextSnapshot textSnapshot, Span span ) : void
GetTextViewFromFrame ( IVsWindowFrame frame ) : IVsTextView
GetWpfTextView ( IVsTextView textView ) : IWpfTextView

Helper method for getting a IWpfTextView from a IVsTextView object

IsTracking ( ) : bool
IsValidMarker ( ) : bool
NavigateTo ( bool usePreviewPane ) : IVsWindowFrame
RemoveTracking ( ) : void
SaveCurrentTrackingData ( Region sourceLocation ) : void
SubscribeToCaretEvents ( IWpfTextView textView ) : void
UpdateAtCaretPosition ( CaretPosition caretPoisition ) : void
ViewLayoutChanged ( object sender, TextViewLayoutChangedEventArgs e ) : void

Method Details

AddHighlightMarker() public méthode

Select current tracking text with highlightColor. If highlightColor is null than code will be selected with color from Color. If the mark doesn't support tracking changes, then we simply ignore this condition (addresses VS crash reported in Bug 476347 : Code Analysis clicking error report C6244 causes VS2012 to crash). Tracking changes helps to ensure that we nativate to the right line even if edits to the file have occured, but even if that behavior doesn't work right, it is better to simply return here (before the fix this code threw an exception which terminated VS).
public AddHighlightMarker ( string highlightColor ) : void
highlightColor string Color
Résultat void

AddTracking() public méthode

Add tracking for text in span for document with id docCookie.
public AddTracking ( IWpfTextView wpfTextView, ITextSnapshot textSnapshot, long docCookie, Span span ) : void
wpfTextView IWpfTextView
textSnapshot ITextSnapshot
docCookie long
span Span
Résultat void

AttachToDocument() public méthode

An overridden method for reacting to the event of a document window being opened
public AttachToDocument ( string documentName, long docCookie, IVsWindowFrame frame ) : void
documentName string
docCookie long
frame IVsWindowFrame
Résultat void

CanAttachToDocument() public méthode

Determines if a document can be associated with this ResultTextMarker.
public CanAttachToDocument ( string documentName, long docCookie, IVsWindowFrame frame ) : bool
documentName string
docCookie long
frame IVsWindowFrame
Résultat bool

Clear() public méthode

Clear all markers and tracking classes
public Clear ( ) : void
Résultat void

DetachFromDocument() public méthode

public DetachFromDocument ( long docCookie ) : void
docCookie long
Résultat void

GetSourceLocation() public méthode

Get source location of current marker (tracking code place).
public GetSourceLocation ( ) : Region
Résultat Microsoft.CodeAnalysis.Sarif.Region

IsTracking() public méthode

Check if current class track changes for document docCookie
public IsTracking ( long docCookie ) : bool
docCookie long
Résultat bool

OnRaiseRegionSelected() protected méthode

protected OnRaiseRegionSelected ( EventArgs e ) : void
e System.EventArgs
Résultat void

RemoveHighlightMarker() public méthode

Remove selection for tracking text
public RemoveHighlightMarker ( ) : void
Résultat void

ResultTextMarker() public méthode

fullFilePath may be null for global issues.
public ResultTextMarker ( IServiceProvider serviceProvider, Region region, string fullFilePath ) : System
serviceProvider IServiceProvider
region Microsoft.CodeAnalysis.Sarif.Region
fullFilePath string
Résultat System

SaveCurrentTrackingData() public méthode

Save current tracking data to stored source location. If user will change, save, close and after that open document which has tracking data this class will not loose place where code exists.
public SaveCurrentTrackingData ( ) : void
Résultat void