Skip to content

Adding a New Search Condition to FileSharper

Andrew Vardeman edited this page Feb 17, 2018 · 6 revisions

Adding a new search condition to FileSharper is relatively simple. It typically only requires you to add two classes: one implementing ICondition and one with public properties for any parameters used by the condition. It's not necessary to add anything manually to the user interface; FileSharper uses reflection to build a user interface at runtime for any conditions it finds in the FileSharperCore assembly.

This tutorial will walk through the process of adding a "File Date" condition from scratch. (This condition already exists in the repository but will be recreated for purposes of explanation.)

Load FileSharper.sln in Visual Studio 2017+

If you don't already have the FileSharper source, download or clone it from https://github.com/adv12/FileSharper. If you downloaded a zip, unzip it. Open the src/FileSharper directory and double-click FileSharper.sln to open it in Visual Studio. Solution Explorer should look something like this:

Initial Solution Explorer

FileSharper should be set as the startup project. The business logic is all in FileSharperCore. Expand FileSharperCore:

FileSharperCore expanded

Clone this wiki locally