Selective recording - Whitelisting
Choose which parts of code you want to record with RevDeBug
By default, RevDeBug parses and processes all available code within project. Whitelist allows you to choose praticular parts of your code. This means - if you enable whitelisting, anything that is not whitelisted, will not be recorded.
Enabling whitelist modeTo enable RevDeBug Whitelist, you must add to your project a reference to RevDeBug.Config library. You can find it by opening RevDeBug Compiler directory. It is easly accessed through RevDeBug Menu (RevDeBug > Advanced > Open RevDeBug Compiler directory).
RevDeBug.Config.dll provides access to RevDeBug.Config.Filter namespace, in which there are two attributes defined: * EnableWhitelistAttribute – assembly wide attribute, enables RevDeBug Whitelist * WhitelistAttribute – can be used on declared types and methods (including properties and methods).
To enable RevDeBug Whitelist, you must first declare EnableWhitelist attribute within your project. The best place to do this is AssemblyInfo.cs created automatically by Visual Studio. You can find it in your project’s Properties node in Solution Explorer view.
Add this line of code, at the end of the file:
Now you can add Whitelist attribute to any type or method declarator you want. Just write this line above something you want to whitelist:
Whitelisting is inheritable, so if you whitelist a class, then all its methods and nested types will be whitelisted too.
Do not forget to compile the project using RevDeBug and run it to receive desirable states.
Disabling Whitelist mode
To temporarily disable Whitelist mode, just comment or remove previously added RevDeBug attributes and recompile your project.
To completely remove Whitelist mode, follow these four steps: * Remove RevDeBug.Config.dll from project References * Delete line associated with RevDeBug from AssemblyInfo project file * Comment or remove all Whitelist attributes from classes and methods * Compile project using RevDeBug to record all states, or without to get regular output file
Go to the next chapter, to learn how to disable recording for specific files.