共用方式為


ViewFilter Class

This class handles various editing and IntelliSense commands for a language service.

This API is not CLS-compliant. 

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

Syntax

'宣告
<CLSCompliantAttribute(False)> _
<ComVisibleAttribute(True)> _
Public Class ViewFilter _
    Implements IVsTextViewFilter, IVsTextViewEvents, IOleCommandTarget, IDisposable,  _
    IVsExpansionEvents
'用途
Dim instance As ViewFilter
[CLSCompliantAttribute(false)]
[ComVisibleAttribute(true)]
public class ViewFilter : IVsTextViewFilter, IVsTextViewEvents, 
    IOleCommandTarget, IDisposable, IVsExpansionEvents
[CLSCompliantAttribute(false)]
[ComVisibleAttribute(true)]
public ref class ViewFilter : IVsTextViewFilter, 
    IVsTextViewEvents, IOleCommandTarget, IDisposable, IVsExpansionEvents
[<CLSCompliantAttribute(false)>]
[<ComVisibleAttribute(true)>]
type ViewFilter =  
    class
        interface IVsTextViewFilter
        interface IVsTextViewEvents
        interface IOleCommandTarget
        interface IDisposable
        interface IVsExpansionEvents
    end
public class ViewFilter implements IVsTextViewFilter, IVsTextViewEvents, IOleCommandTarget, IDisposable, IVsExpansionEvents

Remarks

In addition to the cursor, Enter, Backspace, and Delete key commands, this base class provides support for the following commands:

Command

Description

AUTOCOMPLETE

IntelliSense: select member from member list.

SHOWMEMBERLIST

IntelliSense: show member list.

COMPLETEWORD

IntelliSense: complete word being typed.

PARAMINFO

IntelliSense: show parameter information.

QUICKINFO

IntelliSense: show information about an identifier.

GotoDefn

Editing (advanced): go to definition.

GotoDecl

Editing (advanced): go to declaration.

GotoRef

Editing (advanced): go to a reference.

COMMENT_BLOCK

Editing (advanced): comment a span of code.

UNCOMMENT_BLOCK

Editing (Advanced): uncomment a span of code.

OUTLN_STOP_HIDING_ALL

Editing (outlining): stop outlining.

OUTLN_START_AUTOHIDING

Editing (outlining): toggle outlining.

SHOWCONTEXTMENU

Editing: show a context menu.

Notes to Implementers

This class already implements all of the support for IntelliSense as well as various advanced editing features. However, if you want to support additional commands in your language service, then you must derive a class from this class and override the appropriate methods:

  • QueryCommandStatus (to indicate support for your commands)

  • QueryParameterList (if your commands require parameters)

  • HandlePreExec (if your commands require some set up)

  • HandlePostExec(Guid%, UInt32, UInt32, IntPtr, IntPtr) (if your commands require clean up after execution).

  • ExecCommand (to execute the command).

In addition, you must override the CreateViewFilter method in the LanguageService class to create an instance of your version of the ViewFilter class.

Notes to Callers

This class is instantiated in the CreateViewFilter method of the LanguageService class that is in turn called from the OnNewView method in the CodeWindowManager class when a view is attached to a source file.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Package.ViewFilter

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

ViewFilter Members

Microsoft.VisualStudio.Package Namespace