Partager via


Help2.FilterQuery Property

Definition

Returns the query string for the current Help collection filter.

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

Property Value

A string containing the query string for the current filter.

Implements

Attributes

Examples

Create a Visual Studio add-in by using Visual C# as described in How to: Create an Add-In. Add references to Microsoft.VisualStudio.VSHelp, Microsoft.VisualStudio.VSHelp80, and System.Windows.Forms. Replace the code in the OnConnection method in the Connect.cs file with the following code. Run the code example as described in How to: Compile and Run the Automation Object Model Code Examples.

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);  
    }  
}  

Applies to