Table of Contents

ObjectPortrayal Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/Generate.cs

ObjectPortrayal(object, Action<ObjectPortrayalOptions>)

Generates a portrayal of the specified instance that might contain information about the instance state.

public static string ObjectPortrayal(object instance, Action<ObjectPortrayalOptions> setup = null)

Parameters

instance object

The instance of an Object to convert.

setup Action<ObjectPortrayalOptions>

The ObjectPortrayalOptions which may be configured.

Returns

string

A string that represents the specified instance.

Remarks

When determining the representation of the specified instance, these default rules applies: 1: if the ToString() method has been overridden, any further processing is skipped (the assumption is, that a custom representation is already in place) 2: any public properties having index parameters is skipped 3: any public properties is appended to the result if ToString() has not been overridden Note: do not call this method from an overridden ToString(..) method without setting BypassOverrideCheck to true; otherwise a StackOverflowException will occur.