Help2.FilterQuery 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回当前帮助集合筛选器的查询字符串。
public:
property System::String ^ FilterQuery { System::String ^ get(); };
public:
property Platform::String ^ FilterQuery { Platform::String ^ get(); };
[System.Runtime.InteropServices.DispId(23)]
public string FilterQuery { [System.Runtime.InteropServices.DispId(23)] get; }
[<System.Runtime.InteropServices.DispId(23)>]
[<get: System.Runtime.InteropServices.DispId(23)>]
member this.FilterQuery : string
Public ReadOnly Property FilterQuery As String
属性值
一个包含当前筛选器的查询字符串的字符串。
实现
- 属性
示例
使用创建外接程序, Visual Studio Visual C# 如 如何:创建外接程序中所述。 添加对 Microsoft.VisualStudio.VSHelp 、 Microsoft.VisualStudio.VSHelp80 和的引用 System.Windows.Forms 。 将 OnConnection Connect.cs 文件中方法中的代码替换为以下代码。 按照 如何:编译和运行自动化对象模型代码示例中所述运行代码示例。
using System;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.VSHelp;
using Microsoft.VisualStudio.VSHelp80;
using System.Windows.Forms;
public void OnConnection(object application,
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
HelpFilterQueryExample(_applicationObject);
}
public void HelpFilterQueryExample(DTE2 dte)
{
// This add-in displays a message box with the query string
// for the active Help collection.
try
{
Microsoft.VisualStudio.VSHelp80.Help2 help2 =
(Microsoft.VisualStudio.VSHelp80.Help2)_applicationObject.GetObject ("Help2");
// Display the filter query.
MessageBox.Show("The Help filter query is: "
+ help2.FilterQuery.ToString());
}
catch (SystemException ex)
{
MessageBox.Show("ERROR: " + ex);
}
}