Recording the properties of complex user-defined objects

Learn how to record complex user-defined object's properties

RevDeBug by default records deltas of changes to complex objects (non-deterministic data). Data processed while object’s creation (ie inside constructor) is preserved as a usual sequential recording of executed source code. In case there is a need to record a custom or serialized content of object’s at points where it is referenced in source code or content for objects originated from external sources to RevDeBug instrumentation, you would need to define a RDBDisplay configuration.

Example - recording complex objects

The idea behind complex objects’ recording is very simple: you just need to call RevDeBugAPI.RecordObject on that object and all its properties will be automatically inspected and stored in the recording.

Here is an example made on our Demo application. In the MainWindow() of this application we will create a brush, and try to get it’s property value with the use of RevDeBug API.MainWindow.xaml.cs

public MainWindow(){ InitializeComponent(); var converter = new BrushConverter(); RdbRedBrush = (Brush)converter.ConvertFromString("#b01f1c"); RevDeBugAPI.RecordObject(RdbRedBrush);}

To check, if this code worked, you can open it in Visual Studio with RevDeBug IDE Extension installed. If you run it, and open the recording, you should get a similar result:

Value prompts - values overlayed on code