Compartilhar via


LanguageService.OnCaretMoved Method

Called when the caret has moved.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)

Syntax

'Declaration
Public Overridable Sub OnCaretMoved ( _
    mgr As CodeWindowManager, _
    textView As IVsTextView, _
    line As Integer, _
    col As Integer _
)
public virtual void OnCaretMoved(
    CodeWindowManager mgr,
    IVsTextView textView,
    int line,
    int col
)
public:
virtual void OnCaretMoved(
    CodeWindowManager^ mgr, 
    IVsTextView^ textView, 
    int line, 
    int col
)
abstract OnCaretMoved : 
        mgr:CodeWindowManager * 
        textView:IVsTextView * 
        line:int * 
        col:int -> unit  
override OnCaretMoved : 
        mgr:CodeWindowManager * 
        textView:IVsTextView * 
        line:int * 
        col:int -> unit
public function OnCaretMoved(
    mgr : CodeWindowManager, 
    textView : IVsTextView, 
    line : int, 
    col : int
)

Parameters

  • line
    Type: Int32

    [in] The new line the caret is on.

  • col
    Type: Int32

    [in] the new column the caret is on.

Remarks

If you want to do anything special when the caret is moved, you must derive a class from the LanguageService class and implement this method. Be sure to call the base class version of this method either before or after your specific needs.

The base method calls the internal TypeAndMemberDropdownBars.SynchronizeDropdowns method if a drop-down bar has been added to the text view. TypeAndMemberDropdownBars.SynchronizeDropdowns calls the virtual method, OnSynchronizeDropdowns, and then refreshes the combo-boxes.

.NET Framework Security

See Also

Reference

LanguageService Class

Microsoft.VisualStudio.Package Namespace