Share via


IVsWindowSearchCustomFilter.ApplyFilter Method

Filters the current search string.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assemblies:   Microsoft.VisualStudio.Shell.Interop.11.0 (in Microsoft.VisualStudio.Shell.Interop.11.0.dll)
  Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)

Syntax

'Declaration
Sub ApplyFilter ( _
    <OutAttribute> ByRef pbstrSearchString As String, _
    <OutAttribute> ByRef piSelectionStart As Integer, _
    <OutAttribute> ByRef piSelectionEnd As Integer _
)
void ApplyFilter(
    out string pbstrSearchString,
    out int piSelectionStart,
    out int piSelectionEnd
)
void ApplyFilter(
    [InAttribute] [OutAttribute] String^% pbstrSearchString, 
    [InAttribute] [OutAttribute] int% piSelectionStart, 
    [InAttribute] [OutAttribute] int% piSelectionEnd
)
abstract ApplyFilter : 
        pbstrSearchString:string byref * 
        piSelectionStart:int byref * 
        piSelectionEnd:int byref -> unit
function ApplyFilter(
    pbstrSearchString : String, 
    piSelectionStart : int, 
    piSelectionEnd : int
)

Parameters

  • pbstrSearchString
    Type: System.String%

    [in, out] The current search string to be filtered. Returns a string modified by the filtering action.

  • piSelectionStart
    Type: System.Int32%

    [in, out] The position in the string to start filtering (0 indicates the first character in the string). Returns the starting position of the filtered string.

  • piSelectionEnd
    Type: System.Int32%

    [in, out] The position in the string to stop filtering (-1 indicates the last character in the string). Returns the stopping position of the filtered string.

Remarks

This method applies the filter to the current search string, returning the result and a selection interval delimiting the string that should be displayed. Use -1 to indicate string end, [0,-1] to select the whole string, and so on.

For example, you could append text like “Filter:(<parameter>)” if no text is selected and return a selection for the “<parameter>” string for easy replacement. You could also insert text around the selected text like “Filter:(<existing_selection>)”.

.NET Framework Security

See Also

Reference

IVsWindowSearchCustomFilter Interface

Microsoft.VisualStudio.Shell.Interop Namespace