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
'Declaración
<CLSCompliantAttribute(False)> _
<ComVisibleAttribute(True)> _
Public Class ViewFilter _
Implements IVsTextViewFilter, IVsTextViewEvents, IOleCommandTarget, IDisposable, _
IVsExpansionEvents
'Uso
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 |
---|---|
IntelliSense: select member from member list. |
|
IntelliSense: show member list. |
|
IntelliSense: complete word being typed. |
|
IntelliSense: show parameter information. |
|
IntelliSense: show information about an identifier. |
|
Editing (advanced): go to definition. |
|
Editing (advanced): go to declaration. |
|
Editing (advanced): go to a reference. |
|
Editing (advanced): comment a span of code. |
|
Editing (Advanced): uncomment a span of code. |
|
Editing (outlining): stop outlining. |
|
Editing (outlining): toggle outlining. |
|
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.