### Search Setup and Requirements Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Details on the necessary system requirements and setup steps to enable search functionality. ```APIDOC ## Search Setup and Requirements ### Requirements - **Windows 10+** for full search functionality - **Windows Search service** must be enabled - **Search folders support** must be enabled in ExplorerBrowser options ### Setup Enable search folders support in your ExplorerBrowser: ```csharp explorerBrowser.ContentOptions.Flags |= ExplorerBrowserContentSectionOptions.UseSearchFolders; ``` ``` -------------------------------- ### Search Usage Examples Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Illustrates how to use the various search methods with practical code examples. ```APIDOC ## Search Usage Examples ### Simple Filename Search ```csharp // Search for files containing "report" in Documents explorerBrowser.Search("report", KnownFolders.Documents); ``` ### Windows Search Syntax ```csharp // Search for pictures modified today explorerBrowser.SearchWithQueryString("kind:picture AND datemodified:today", KnownFolders.Pictures); ``` ### Date Range Search ```csharp // Search for files modified in the last week var lastWeek = DateTime.Today.AddDays(-7); explorerBrowser.SearchByDateRange(lastWeek, DateTime.Today, KnownFolders.Downloads); ``` ### File Size Search ```csharp // Search for files larger than 10MB explorerBrowser.SearchByFileSize(10 * 1024 * 1024, KnownFolders.ComputerFolder); ``` ### Property-Based Search ```csharp // Search for documents by author explorerBrowser.SearchByProperty("System.Author", "John Doe", SearchConditionOperation.Contains, KnownFolders.Documents); ``` ### Custom Search Condition ```csharp // Create complex search conditions var filenameCondition = SearchConditionFactory.CreateLeafCondition( "System.FileName", "report", SearchConditionOperation.Contains ); var dateCondition = SearchConditionFactory.CreateLeafCondition( "System.DateModified", DateTime.Today.AddDays(-30), SearchConditionOperation.GreaterThan ); var combinedCondition = SearchConditionFactory.CreateAndCondition(filenameCondition, dateCondition); explorerBrowser.Search(combinedCondition, KnownFolders.Documents); ``` ``` -------------------------------- ### Install WindowsAPICodePack via CLI Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Current/Windows API CodePack/Components/WindowsAPICodePack/Readme.md Commands to add the package to a project using Package Manager Console or .NET CLI. ```bash # Install via Package Manager Console Install-Package WindowsAPICodePack # Or via .NET CLI dotnet add package WindowsAPICodePack ``` -------------------------------- ### Unregister Assembly Command Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/HandlerSamples/Readme.txt Command to unregister an assembly, requiring the original GUID. ```bash regasm /unregister ``` -------------------------------- ### Perform Date Range Search with ExplorerBrowser Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Find files modified within a specific date range using the SearchByDateRange method. Ensure the start and end dates are correctly formatted. ```csharp // Search for files modified in the last week var lastWeek = DateTime.Today.AddDays(-7); explorerBrowser.SearchByDateRange(lastWeek, DateTime.Today, KnownFolders.Downloads); ``` -------------------------------- ### Build and Run Demo Project Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Search Implementation.md Commands to build and execute the demo application using the .NET CLI. ```bash dotnet build ``` ```bash dotnet run ``` -------------------------------- ### Enable Authenticode Signing via MSBuild Command Line Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/README.md Build your project with Authenticode signing enabled by passing parameters to the dotnet build command. ```bash dotnet build /p:EnableAuthenticodeSigning=true /p:CodeSigningCertificatePath="path\to\certificate.pfx" /p:CodeSigningCertificatePassword="password" ``` -------------------------------- ### Migrate Search Implementation Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Compare the legacy external helper approach with the new integrated method call. ```csharp // Old way - external helper var searchHelper = new SearchHelper(explorerBrowser); searchHelper.SearchFiles("report", KnownFolders.Documents); ``` ```csharp // New way - direct method call explorerBrowser.Search("report", KnownFolders.Documents); ``` -------------------------------- ### Initialize PropertyGrid and set ExplorerBrowser Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/Shell/ExplorerBrowserPropertyGridDemo/README.md Instantiate a PropertyGrid, enable its toolbar and help pane, and assign the ExplorerBrowser instance as the object to inspect. ```csharp PropertyGrid propertyGrid = new PropertyGrid(); propertyGrid.ToolbarVisible = true; propertyGrid.HelpVisible = true; propertyGrid.SelectedObject = explorerBrowser; ``` -------------------------------- ### Configure ExplorerBrowser Properties Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/Shell/ExplorerBrowserPropertiesDemo/README.md Demonstrates how to initialize and configure search behavior, display options, and advanced features for an ExplorerBrowser instance. ```csharp var explorerBrowser = new ExplorerBrowser(); // Configure search behavior explorerBrowser.AutoRefreshSearchResults = true; explorerBrowser.MaxSearchResults = 1000; explorerBrowser.ShowSearchProgress = true; explorerBrowser.CacheSearchResults = true; // Configure display options explorerBrowser.SearchResultSortOrder = SearchResultSortOrder.NameAscending; explorerBrowser.GroupSearchResultsByType = true; explorerBrowser.ShowFilePreviews = true; explorerBrowser.SearchResultThumbnailSize = 128; // Enable advanced features explorerBrowser.EnableIncrementalSearch = true; explorerBrowser.IncrementalSearchDelay = 300; explorerBrowser.ShowSearchSuggestions = true; explorerBrowser.MaxSearchSuggestions = 15; // Configure visual enhancements explorerBrowser.HighlightSearchTerms = true; explorerBrowser.SearchTermHighlightColor = Color.LightBlue; explorerBrowser.EnableAdvancedSearchFilters = true; ``` -------------------------------- ### Configure Authenticode Signing with Certificate File Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/README.md Enable Authenticode signing for DLLs by specifying the path to your PFX certificate file and optionally its password. ```xml true path\to\your\certificate.pfx your-password ``` -------------------------------- ### Configure Authenticode Signing with Certificate Store Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/README.md Enable Authenticode signing for DLLs by providing the thumbprint of your code signing certificate from the certificate store. ```xml true your-certificate-thumbprint ``` -------------------------------- ### Combine Multiple Search Scopes Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Search Implementation.md Instantiate `ShellSearchFolder` with multiple `KnownFolders` to combine search scopes. ```csharp var searchFolder = new ShellSearchFolder( searchCondition, KnownFolders.Documents, KnownFolders.Pictures, KnownFolders.Downloads ); ``` -------------------------------- ### Perform Search Using Windows Search Syntax Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Utilize the SearchWithQueryString method to perform searches using native Windows Search syntax. This allows for complex queries based on file kind, date, and other attributes. ```csharp // Search for pictures modified today explorerBrowser.SearchWithQueryString("kind:picture AND datemodified:today", KnownFolders.Pictures); ``` -------------------------------- ### Implement File Name Search Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Search Implementation.md Creates a search condition for file names and navigates the ExplorerBrowser to the resulting search folder. ```csharp // Create search condition for filename search var searchCondition = SearchConditionFactory.CreateLeafCondition( "System.FileName", searchQuery, SearchConditionOperation.Contains ); // Create search folder and navigate to results using (var searchFolder = new ShellSearchFolder(searchCondition, selectedScope)) { explorerBrowser.Navigate(searchFolder); } ``` -------------------------------- ### Import WindowsAPICodePack Namespaces Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Current/Windows API CodePack/Components/WindowsAPICodePack/Readme.md Required using directives to access the various components of the library. ```csharp using Microsoft.WindowsAPICodePack.Core; using Microsoft.WindowsAPICodePack.Shell; using Microsoft.WindowsAPICodePack.Sensors; using Microsoft.WindowsAPICodePack.ExtendedLinguisticServices; using Microsoft.WindowsAPICodePack.ShellExtensions; ``` -------------------------------- ### Windows Search Syntax Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Details on the syntax supported by the `SearchWithQueryString` method. ```APIDOC ## Windows Search Syntax The `SearchWithQueryString` method supports native Windows Search syntax: - `kind:picture` - Search by file type - `datemodified:today` - Search by date - `size:>10MB` - Search by size - `author:"John Doe"` - Search by author - `AND`, `OR`, `NOT` - Logical operators - `()` - Grouping Examples: - `kind:picture AND datemodified:today` - `size:>10MB AND kind:document` - `author:"John Doe" OR author:"Jane Smith"` ``` -------------------------------- ### Register Assembly Command Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/HandlerSamples/Readme.txt Command to register the compiled assembly using the Visual Studio command prompt. ```bash regasm /codebase "" ``` -------------------------------- ### Perform Property-Based Search with ExplorerBrowser Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Search for files based on specific properties and their values using SearchByProperty. Requires the property name, value, operation, and search scope. ```csharp // Search for documents by author explorerBrowser.SearchByProperty("System.Author", "John Doe", SearchConditionOperation.Contains, KnownFolders.Documents); ``` -------------------------------- ### Handle ExplorerBrowser Property Changes Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/Shell/ExplorerBrowserPropertiesDemo/README.md Shows how to subscribe to the PropertyChanged event to react to specific state changes in the ExplorerBrowser. ```csharp // Handle property changes explorerBrowser.PropertyChanged += (sender, e) => { switch (e.PropertyName) { case nameof(ExplorerBrowser.CurrentSearchQuery): var query = explorerBrowser.CurrentSearchQuery; if (!string.IsNullOrEmpty(query)) { Console.WriteLine($"Search query changed to: {query}"); } break; case nameof(ExplorerBrowser.IsShowingSearchResults): if (explorerBrowser.IsShowingSearchResults) { Console.WriteLine("Now showing search results"); } break; } }; ``` -------------------------------- ### Common Shell Extension Attributes Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/HandlerSamples/Readme.txt Required attributes for both Preview handlers and Thumbnail providers to ensure visibility and proper association with the shell. ```csharp [ComVisible(true)] // Lets Shell/COM see your class [ClassInterface(ClassInterfaceType.None)] // Required [ProgId("HandlerSamples.XYZPreviewerWPF")] // This is required for associating the surrogate host, it should be unique per handler. [Guid("B9E6A036-9778-4B48-BA45-33F15B9B07AF")] // This is the GUID under which the assembly is registered; it must be unique. ``` -------------------------------- ### Preview Handler Attribute Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/HandlerSamples/Readme.txt Additional attribute required specifically for implementing preview handlers. ```csharp [PreviewHandler("PreviewHandlerWPFDemo", ".xyz", "{EC3E84CC-BDC5-4E9F-A67F-CC960F366497}")] // Name, Semi-colon-separated list of extensions and handler ID (must be unique). ``` -------------------------------- ### Enable Search Folders in ExplorerBrowser Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Search Implementation.md Configures the ExplorerBrowser control to support search folder functionality. ```csharp explorerBrowser.ContentOptions.Flags |= ExplorerBrowserContentSectionOptions.UseSearchFolders; ``` -------------------------------- ### Available Search Properties and Operations Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Lists common properties and operations that can be used in searches. ```APIDOC ## Available Search Properties and Operations ### Available Search Properties Common Windows Search properties you can use: - `System.FileName` - File name - `System.Title` - Document title - `System.Author` - Document author - `System.Keywords` - Keywords/tags - `System.DateModified` - Modification date - `System.DateCreated` - Creation date - `System.Size` - File size - `System.FileExtension` - File extension - `System.Kind` - File type (document, picture, music, etc.) ### Search Operations Available search operations: - `Contains` - Value contains the search term - `Equals` - Value equals the search term exactly - `StartsWith` - Value starts with the search term - `EndsWith` - Value ends with the search term - `GreaterThan` - Value is greater than the search term - `LessThan` - Value is less than the search term - `GreaterThanOrEqual` - Value is greater than or equal to the search term - `LessThanOrEqual` - Value is less than or equal to the search term ``` -------------------------------- ### Thumbnail Provider Attribute Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/HandlerSamples/Readme.txt Additional attribute required specifically for implementing thumbnail providers. ```csharp [ThumbnailProvider("XYZThumbnailer", ".xyz", DisableProcessIsolation = false)] // Name, Semi-colon-separated list of file extensions. DisableProcessIsolation is only required if IThumbnailFromStream is not implemented. ``` -------------------------------- ### ExplorerBrowser Search Methods Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md This section covers the core search methods available on the ExplorerBrowser class, allowing for flexible searching within specified scopes. ```APIDOC ## ExplorerBrowser Search Methods ### Description Provides methods for performing various types of searches directly within the ExplorerBrowser control. ### Methods - **`Search(string searchQuery, ShellContainer searchScope)`** - **Description**: Performs a simple filename search. - **Parameters**: - `searchQuery` (string) - Required - The text to search for in filenames. - `searchScope` (ShellContainer) - Required - The container to search within. - **`Search(SearchCondition searchCondition, ShellContainer searchScope)`** - **Description**: Performs a search based on a custom search condition. - **Parameters**: - `searchCondition` (SearchCondition) - Required - The custom search condition object. - `searchScope` (ShellContainer) - Required - The container to search within. - **`SearchWithQueryString(string queryString, ShellContainer searchScope)`** - **Description**: Performs a search using Windows Search syntax. - **Parameters**: - `queryString` (string) - Required - The Windows Search query string. - `searchScope` (ShellContainer) - Required - The container to search within. - **`SearchByDateRange(DateTime startDate, DateTime endDate, ShellContainer searchScope)`** - **Description**: Performs a search for files modified within a specified date range. - **Parameters**: - `startDate` (DateTime) - Required - The start date of the range. - `endDate` (DateTime) - Required - The end date of the range. - `searchScope` (ShellContainer) - Required - The container to search within. - **`SearchByFileSize(long minSizeBytes, ShellContainer searchScope)`** - **Description**: Performs a search for files larger than a specified size. - **Parameters**: - `minSizeBytes` (long) - Required - The minimum file size in bytes. - `searchScope` (ShellContainer) - Required - The container to search within. - **`SearchByProperty(string propertyName, string propertyValue, SearchConditionOperation operation, ShellContainer searchScope)`** - **Description**: Performs a search based on a specific file property. - **Parameters**: - `propertyName` (string) - Required - The name of the property to search (e.g., "System.Author"). - `propertyValue` (string) - Required - The value of the property to match. - `operation` (SearchConditionOperation) - Required - The comparison operation to use. - `searchScope` (ShellContainer) - Required - The container to search within. - **`ClearSearch(ShellObject location)`** - **Description**: Clears the current search results and navigates to the specified location. - **Parameters**: - `location` (ShellObject) - Required - The location to navigate to after clearing search. ### Property - **`IsShowingSearchResults`** (bool) - **Description**: Returns `true` if the control is currently displaying search results, `false` otherwise. ``` -------------------------------- ### Enable Windows Common Controls in Application Manifest Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Current/Windows API CodePack/Components/Core/Readme.md Uncomment this dependency block in your application manifest to ensure the correct version of comctl32.dll is loaded for TaskDialog support. ```xml ``` -------------------------------- ### Implement Search in WPF Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Use the search functionality within the WPF version of the ExplorerBrowser control. ```csharp // WPF ExplorerBrowser var wpfExplorerBrowser = new Microsoft.WindowsAPICodePack.Controls.WindowsPresentationFoundation.ExplorerBrowser(); wpfExplorerBrowser.Search("report", KnownFolders.Documents); ``` -------------------------------- ### Combine Search Conditions Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Search Implementation.md Creates a logical AND condition to combine multiple search criteria. ```csharp var combinedCondition = SearchConditionFactory.CreateAndCondition( filenameCondition, dateCondition ); ``` -------------------------------- ### Perform File Size Search with ExplorerBrowser Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Use SearchByFileSize to find files that are larger than a specified size in bytes. This is useful for identifying large files within a scope. ```csharp // Search for files larger than 10MB explorerBrowser.SearchByFileSize(10 * 1024 * 1024, KnownFolders.ComputerFolder); ``` -------------------------------- ### Perform Simple Filename Search with ExplorerBrowser Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Use the Search method to find files containing a specific string in their names within a given scope. Requires ExplorerBrowser to be configured for search. ```csharp // Search for files containing "report" in Documents explorerBrowser.Search("report", KnownFolders.Documents); ``` -------------------------------- ### ExplorerBrowser Search Properties Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/Shell/ExplorerBrowserPropertiesDemo/README.md A collection of properties for configuring search behavior, display options, and performance within the ExplorerBrowser control. ```APIDOC ## ExplorerBrowser Search Properties ### Description These properties allow developers to configure search behavior, display options, and performance settings for the ExplorerBrowser control. ### Search State Properties - **CurrentSearchQuery** (string?) - Gets the current search query. - **CurrentSearchScope** (ShellContainer?) - Gets the current search scope. - **IsShowingSearchResults** (bool) - Gets whether the current view is showing search results. ### Search Behavior Properties - **AutoRefreshSearchResults** (bool) - Whether search results should be automatically refreshed when the search scope changes. - **MaxSearchResults** (int) - Maximum number of search results to display. - **ShowSearchProgress** (bool) - Whether to show search progress indicators. - **CacheSearchResults** (bool) - Whether to cache search results for better performance. ### Display Options - **SearchResultSortOrder** (SearchResultSortOrder) - The search result sorting order. - **GroupSearchResultsByType** (bool) - Whether to group search results by file type. - **ShowFilePreviews** (bool) - Whether to show file previews in search results. - **SearchResultThumbnailSize** (int) - Thumbnail size for search results (32-256 pixels). ### Advanced Features - **EnableIncrementalSearch** (bool) - Whether to enable incremental search. - **IncrementalSearchDelay** (int) - Delay in milliseconds before performing incremental search. - **ShowSearchSuggestions** (bool) - Whether to show search suggestions. - **MaxSearchSuggestions** (int) - Maximum number of search suggestions to display. ### Performance Optimization - **EnableVirtualScrolling** (bool) - Whether to enable search result virtual scrolling. - **VirtualScrollingPageSize** (int) - Virtual scrolling page size for search results. ``` -------------------------------- ### Create and Use Custom Search Conditions Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Construct complex search criteria using SearchConditionFactory to combine multiple conditions with logical operators. Then, use the Search method with the combined condition. ```csharp // Create complex search conditions var filenameCondition = SearchConditionFactory.CreateLeafCondition( "System.FileName", "report", SearchConditionOperation.Contains ); var dateCondition = SearchConditionFactory.CreateLeafCondition( "System.DateModified", DateTime.Today.AddDays(-30), SearchConditionOperation.GreaterThan ); var combinedCondition = SearchConditionFactory.CreateAndCondition(filenameCondition, dateCondition); explorerBrowser.Search(combinedCondition, KnownFolders.Documents); ``` -------------------------------- ### Error Handling and Performance Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Integrated Search.md Information on potential errors and performance considerations when using the search functionality. ```APIDOC ## Error Handling and Performance ### Error Handling All search methods throw `CommonControlException` with appropriate error messages when search operations fail. Common causes: - Windows Search service not running - Search scope not indexed - Invalid search conditions - Insufficient permissions ### Performance Considerations - Search results are loaded asynchronously - Large search scopes may take time to complete - Consider limiting search scope for better performance - Search results are cached by Windows Search ``` -------------------------------- ### Configure ExplorerBrowser Search Options Programmatically Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/Shell/ExplorerBrowserPropertyGridDemo/README.md Modify properties within the SearchOptions group to customize search behavior, such as setting the maximum number of results or enabling incremental search. ```csharp explorerBrowser.SearchOptions.MaxSearchResults = 100; explorerBrowser.SearchOptions.EnableIncrementalSearch = true; explorerBrowser.SearchOptions.SearchResultSortOrder = SearchResultSortOrder.NameAscending; ``` -------------------------------- ### Update ExplorerBrowser Preferences Dynamically Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/Shell/ExplorerBrowserPropertiesDemo/README.md Provides a method to update multiple ExplorerBrowser properties simultaneously based on a custom preferences object. ```csharp // Update properties based on user preferences private void UpdateSearchPreferences(SearchPreferences prefs) { explorerBrowser.MaxSearchResults = prefs.MaxResults; explorerBrowser.SearchResultSortOrder = prefs.SortOrder; explorerBrowser.GroupSearchResultsByType = prefs.GroupByType; explorerBrowser.ShowFilePreviews = prefs.ShowPreviews; explorerBrowser.SearchResultThumbnailSize = prefs.ThumbnailSize; explorerBrowser.EnableIncrementalSearch = prefs.IncrementalSearch; explorerBrowser.IncrementalSearchDelay = prefs.SearchDelay; explorerBrowser.HighlightSearchTerms = prefs.HighlightTerms; explorerBrowser.SearchTermHighlightColor = prefs.HighlightColor; } ``` -------------------------------- ### Access ExplorerBrowser Search State Programmatically Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/Shell/ExplorerBrowserPropertyGridDemo/README.md Read properties from the SearchState group to determine the current status of search operations within the ExplorerBrowser. ```csharp bool isSearching = explorerBrowser.SearchState.IsShowingSearchResults; string currentQuery = explorerBrowser.SearchState.CurrentSearchQuery; ``` -------------------------------- ### Define SearchResultExportFormat Enumeration Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/Shell/ExplorerBrowserPropertiesDemo/README.md Defines the supported file formats for exporting search results. ```csharp public enum SearchResultExportFormat { CSV, // Export as comma-separated values TSV, // Export as tab-separated values XML, // Export as XML format JSON, // Export as JSON format HTML, // Export as HTML table format Text // Export as plain text format } ``` -------------------------------- ### Create Size-based Search Condition Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Search Implementation.md Generates a search condition to filter files larger than a specified size in bytes. ```csharp var sizeCondition = SearchConditionFactory.CreateLeafCondition( "System.Size", 1024 * 1024, // 1MB SearchConditionOperation.GreaterThan ); ``` -------------------------------- ### Filter Search Results by Size Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Search Implementation.md Filter the search results asynchronously using LINQ's `Where` clause to select items larger than a specified size. ```csharp var filteredResults = searchFolder .Where(item => item.Properties.System.Size.Value > 1024) .ToList(); ``` -------------------------------- ### Create Custom Search Condition Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Search Implementation.md Use `SearchConditionFactory` to create a custom search condition for a specific property. ```csharp var customCondition = SearchConditionFactory.CreateLeafCondition( "Custom.Property.Name", searchValue, SearchConditionOperation.Equals ); ``` -------------------------------- ### Define SearchResultSortOrder Enumeration Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Source/Samples/Shell/ExplorerBrowserPropertiesDemo/README.md Defines the available sorting criteria for search results within the ExplorerBrowser. ```csharp public enum SearchResultSortOrder { Relevance, // Sort by relevance (default search ranking) NameAscending, // Sort by file name in ascending order NameDescending, // Sort by file name in descending order SizeAscending, // Sort by file size in ascending order SizeDescending, // Sort by file size in descending order DateModifiedAscending, // Sort by date modified in ascending order DateModifiedDescending, // Sort by date modified in descending order TypeAscending, // Sort by file type in ascending order TypeDescending, // Sort by file type in descending order DateCreatedAscending, // Sort by date created in ascending order DateCreatedDescending, // Sort by date created in descending order AuthorAscending, // Sort by author in ascending order AuthorDescending // Sort by author in descending order } ``` -------------------------------- ### Create Date-based Search Condition Source: https://github.com/pwagner1/windows-api-codepack-net/blob/main/Assets/Documents/Readme/ExplorerBrowser Search Implementation.md Generates a search condition to filter files modified after a specific date. ```csharp var dateCondition = SearchConditionFactory.CreateLeafCondition( "System.DateModified", DateTime.Today.AddDays(-7), SearchConditionOperation.GreaterThan ); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.