共用方式為


VsSearchTask Class

Definition

VsSearchTask can be used as base class for implementing search-able toolwindows

public ref class VsSearchTask : Microsoft::VisualStudio::Shell::Interop::IVsSearchTask
[Windows::Foundation::Metadata::WebHostHidden]
class VsSearchTask : Microsoft::VisualStudio::Shell::Interop::IVsSearchTask
public class VsSearchTask : Microsoft.VisualStudio.Shell.Interop.IVsSearchTask
type VsSearchTask = class
    interface IVsSearchTask
Public Class VsSearchTask
Implements IVsSearchTask
Inheritance
VsSearchTask
Derived
Implements

Constructors

VsSearchTask(UInt32, IVsSearchQuery, IVsSearchCallback)

Constructor

Properties

ErrorCode

The error code describing the search result, should the search task have completed with errors

Id

The search task identifier

SearchCallback

The callback interface that needs to be called when the search is complete

SearchQuery

The search query used by the search task

SearchResults

The number of search results found

TaskStatus

The status of the current search This needs to be set to appropriate values as the search progresses

Methods

OnStartSearch()

Called on background threads when the search is started. Override to do task-specific search. Set the SearchResults to indicate the number of results found so far. Call the SearchCallback on ReportProgress to report progress (if progress is supported) and call it on ReportComplete when the search is completed (with or without errors). Set the TaskStatus appropriately when done to Completed/Error. During the search, TaskStatus can be periodically checked if the search task was Stopped.

OnStopSearch()

Called on the UI thread when the search is stopped. Override to do task-specific stop actions. Note: a search can be set to stopped state even before it's actually started Override to stop the search, and set the SearchResults appropriately so it can be reported for completion

SetTaskStatus(VSConstants+VsSearchTaskStatus)

Helper function to set the task status

Start()

Starts the search task

Stop()

Stops the search task

Explicit Interface Implementations

IVsSearchTask.Status

The task status

Applies to