Interface DebugPrint
Apply this interface to an object to added .Debug support to that object. Otherwise .ToString will be used instead.
public interface DebugPrint
- Extension Methods
Methods
DeregisterCustomType<T>()
Remove custom type from Debug Print.
public static void DeregisterCustomType<T>()
Type Parameters
T
EnumerateFields()
Should return a list of field names and their values so that they can be included in the .Debug output.
IEnumerable<(string, object)> EnumerateFields()
Returns
- IEnumerable<(string, object)>
EnumerateWithAttributes(object)
Enumerate fields that have the DebugFieldAttribute
public static IEnumerable<(string, object)> EnumerateWithAttributes(object source)
Parameters
sourceobject
Returns
- IEnumerable<(string, object)>
EnumerateWithAttributes(object, Type)
Enumerate fields that have the DebugFieldAttribute
public static IEnumerable<(string, object)> EnumerateWithAttributes(object source, Type type)
Parameters
Returns
- IEnumerable<(string, object)>
EnumerateWithReflection(object)
Enumerate the fields of a type using reflection.
public static IEnumerable<(string, object)> EnumerateWithReflection(object source)
Parameters
sourceobject
Returns
- IEnumerable<(string, object)>
EnumerateWithReflection(object, Type)
Enumerate the fields of a type using reflection.
public static IEnumerable<(string, object)> EnumerateWithReflection(object source, Type type)
Parameters
Returns
- IEnumerable<(string, object)>
RegisterCustomType<T>(CustomDebugPrint<T>)
Register custom enumeration method for Debug Print.
public static void RegisterCustomType<T>(DebugPrint.CustomDebugPrint<T> enumerateField)
Parameters
enumerateFieldDebugPrint.CustomDebugPrint<T>
Type Parameters
T
RegisterCustomType<T>(CustomDebugStringPrint<T>)
Register custom string print method for Debug Print.
public static void RegisterCustomType<T>(DebugPrint.CustomDebugStringPrint<T> stringPrinter)
Parameters
stringPrinterDebugPrint.CustomDebugStringPrint<T>
Type Parameters
T