C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
OnRaiseRegionSelected ( EventArgs e ) : void

Приватные методы

Метод Описание
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

Описание методов

AddHighlightMarker() публичный Метод

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
Результат void

AddTracking() публичный Метод

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
Результат void

AttachToDocument() публичный Метод

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
Результат void

CanAttachToDocument() публичный Метод

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
Результат bool

Clear() публичный Метод

Clear all markers and tracking classes
public Clear ( ) : void
Результат void

DetachFromDocument() публичный Метод

public DetachFromDocument ( long docCookie ) : void
docCookie long
Результат void

GetSourceLocation() публичный Метод

Get source location of current marker (tracking code place).
public GetSourceLocation ( ) : Region
Результат Microsoft.CodeAnalysis.Sarif.Region

IsTracking() публичный Метод

Check if current class track changes for document docCookie
public IsTracking ( long docCookie ) : bool
docCookie long
Результат bool

OnRaiseRegionSelected() защищенный Метод

protected OnRaiseRegionSelected ( EventArgs e ) : void
e System.EventArgs
Результат void

RemoveHighlightMarker() публичный Метод

Remove selection for tracking text
public RemoveHighlightMarker ( ) : void
Результат void

ResultTextMarker() публичный Метод

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
Результат System

SaveCurrentTrackingData() публичный Метод

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
Результат void