ViewFilter 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重要
此 API 不符合 CLS。
此类处理语言服务的各种编辑和 IntelliSense 命令。
public ref class ViewFilter : IDisposable, Microsoft::VisualStudio::OLE::Interop::IOleCommandTarget, Microsoft::VisualStudio::TextManager::Interop::IVsExpansionEvents, Microsoft::VisualStudio::TextManager::Interop::IVsTextViewEvents, Microsoft::VisualStudio::TextManager::Interop::IVsTextViewFilter
[System.CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(true)]
public class ViewFilter : IDisposable, Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget, Microsoft.VisualStudio.TextManager.Interop.IVsExpansionEvents, Microsoft.VisualStudio.TextManager.Interop.IVsTextViewEvents, Microsoft.VisualStudio.TextManager.Interop.IVsTextViewFilter
[<System.CLSCompliant(false)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ViewFilter = class
interface IVsTextViewFilter
interface IVsTextViewEvents
interface IOleCommandTarget
interface IDisposable
interface IVsExpansionEvents
Public Class ViewFilter
Implements IDisposable, IOleCommandTarget, IVsExpansionEvents, IVsTextViewEvents, IVsTextViewFilter
- 继承
-
ViewFilter
- 属性
- 实现
注解
除 cursor、Enter、Backspace 和 Delete 键命令外,此基类还支持以下命令:
| 命令 | 描述 |
|---|---|
| AUTOCOMPLETE | IntelliSense:从成员列表中选择成员。 |
| SHOWMEMBERLIST | IntelliSense:显示成员列表。 |
| COMPLETEWORD | IntelliSense:正在键入完整的单词。 |
| PARAMINFO | IntelliSense:显示参数信息。 |
| QUICKINFO | IntelliSense:显示有关标识符的信息。 |
| GotoDefn | 编辑 (advanced) :中转到 "定义"。 |
| GotoDecl | 编辑 (advanced) :中转到声明。 |
| GotoRef | 编辑 (高级) :中转到引用。 |
| COMMENT_BLOCK | 编辑 (高级) :注释一段代码。 |
| UNCOMMENT_BLOCK | 编辑 (高级) :取消注释代码段。 |
| OUTLN_STOP_HIDING_ALL | 编辑 (大纲显示) :停止大纲显示。 |
| OUTLN_START_AUTOHIDING | 编辑 (大纲显示) :切换大纲显示。 |
| SHOWCONTEXTMENU | 编辑:显示上下文菜单。 |
继承者说明
此类已经实现了对 IntelliSense 以及各种高级编辑功能的所有支持。 但是,如果你想要在语言服务中支持其他命令,则必须从此类派生一个类并重写适当的方法:
QueryCommandStatus(Guid, UInt32) (指示对命令的支持)
QueryParameterList(Guid, UInt32, UInt32, IntPtr, IntPtr) 如果命令需要参数,则 ()
HandlePreExec(Guid, UInt32, UInt32, IntPtr, IntPtr) 如果你的命令需要某些设置,则 ()
Microsoft.VisualStudio.Package.ViewFilter.HandlePostExec(System.Guid@,System.UInt32,System.UInt32,System.IntPtr,System.IntPtr) (,如果命令在执行后需要清理) 。
此外,必须重写 CreateViewFilter(CodeWindowManager, IVsTextView) 类中的方法, LanguageService 以创建类版本的实例 ViewFilter 。
调用方说明
此类是在类的方法中实例化的 CreateViewFilter(CodeWindowManager, IVsTextView) LanguageService , OnNewView(IVsTextView) CodeWindowManager 当视图附加到源文件时,该类中的方法又会从类中的方法调用。
构造函数
| ViewFilter(CodeWindowManager, IVsTextView) |
初始化 ViewFilter 类的新实例。 |
属性
| CodeWindowManager |
获取 CodeWindowManager 拥有此的 ViewFilter 。 |
| IsExecutingCommand |
确定筛选器是否正在执行命令。 |
| IsExpansionUIActive |
确定代码片段扩展用户界面 (UI) 是否处于活动状态。 |
| SnippetBound |
获取或设置键是否已绑定到快捷命令的调用代码段。 |
| Source |
获取与此 Source 关联的 ViewFilter。 |
| TextTipData |
已过时。
获取或设置 TextTipData 与此视图关联的。 |
| TextView |
获取与此 IVsTextView 对象关联的 ViewFilter 对象。 |
方法
显式接口实现
| IOleCommandTarget.Exec(Guid, UInt32, UInt32, IntPtr, IntPtr) |
处理支持的命令的执行。 |
| IOleCommandTarget.QueryStatus(Guid, UInt32, OLECMD[], IntPtr) |
确定是否支持给定命令组中的指定命令。 |