Recording complex objects

How to record complex objects in C#

It is possible to control how a complex object would be serialized while being recorded by RevDeBug. It may be accomplished by attaching information about RevDeBug Display methods within the application. Each RevDeBug Display method should be parameterless, and it should return a string representation of complex object. There are no limitations for the contents of the returned string, although user should consider both space that might be required and real-time slot needed for processing and serialization. RevDeBug Display method is executed each time an object is stored.

To attach RevDeBug Display method, user must create a new file with .rdbdisplay extension, which should be located in a .NET project. The easiest way to do this is by creating a new text file in a project, and then changing its name and extension. This file’s Build action must be set to C# analyzer additional file (file will be added as AdditionalFiles ItemGroup in project file). Each line within this file will should contain information about a single RevDeBug Display method. User must include type name with a full namespace path and name of a RevDeBug Display method that is separated with dash from type name: Starter.MainWindow-RdbString

where MainWindow is a name of the type, Starter. is a full namespace path that leads to the type and RdbString is the name of a parameterless method that returns a string.MainWindow.xaml.cs

namespace Starter
    public partial class MainWindow
        public Brush RdbRedBrush;
        public Brush RdbGrayBrush;
        public string RdbString()
            return $"{RdbRedBrush.ToString()} - {RdbGrayBrush.ToString()}";

Last updated