Coordinates cancellable recursive searches across a file system and pushes matching entries to the UI in buffered batches while maintaining a simple animated search status label.
More...
Coordinates cancellable recursive searches across a file system and pushes matching entries to the UI in buffered batches while maintaining a simple animated search status label.
◆ SearchManager()
| FileSurfer.Core.ViewModels.SearchManager.SearchManager |
( |
Action< string > | updateAnimation, |
|
|
Action< FileSystemEntryViewModel > | putEntry ) |
|
inline |
Creates a new SearchManager instance.
- Parameters
-
| updateAnimation | Callback invoked whenever the search status label should be updated (for example Searching... and Searching finished). |
| putEntry | Callback invoked for each matching FileSystemEntryViewModel discovered during search result streaming. |
◆ CancelSearchAsync()
| async Task FileSurfer.Core.ViewModels.SearchManager.CancelSearchAsync |
( |
| ) |
|
|
inline |
Requests cancellation for the currently running search, if any, and waits until the active search task has fully completed.
- Returns
- A task that completes once cancellation has been requested and the active search has stopped processing.
◆ Dispose()
| void FileSurfer.Core.ViewModels.SearchManager.Dispose |
( |
| ) |
|
|
inline |
◆ SearchAsync()
| async Task< int?> FileSurfer.Core.ViewModels.SearchManager.SearchAsync |
( |
IFileSystem | fileSystem, |
|
|
string | searchQuery, |
|
|
string | dirToSearch ) |
|
inline |
Starts a new recursive search from the given directory.
If another search is already running, it is canceled and awaited before the new one begins.
- Parameters
-
| fileSystem | File system abstraction used to enumerate directories and files. |
| searchQuery | Case-insensitive query string matched against entry names. |
| dirToSearch | Absolute path of the root directory where traversal starts. |
- Returns
- A task that resolves to the number of entries found, or
null if the search was canceled before completion.
The documentation for this class was generated from the following file:
- /home/janecea/Documents/CODE/PROJECTS/FileSurfer/src/FileSurfer.Core/ViewModels/SearchManager.cs