Class ObjectPortrayalOptions
- Namespace
- Cuemon
- Assembly
- Cuemon.Core.dll
Configuration options for ObjectPortrayal(Object, Action<ObjectPortrayalOptions>).
public sealed class ObjectPortrayalOptions : FormattingOptions, IValidatableParameterObject, IParameterObject
- Inheritance
-
ObjectPortrayalOptions
- Implements
- Inherited Members
Constructors
ObjectPortrayalOptions()
Initializes a new instance of the ObjectPortrayalOptions class.
public ObjectPortrayalOptions()
Remarks
The following table shows the initial property values for an instance of ObjectPortrayalOptions.
Property | Initial Value |
---|---|
BypassOverrideCheck | false |
NullValue | <null> |
NoGetterValue | <no getter> |
FormatProvider | InvariantCulture |
Delimiter | , |
PropertyConverter |
|
PropertiesPredicate | property => property.PropertyType.IsPublic && property.GetIndexParameters().Length == 0 |
Properties
BypassOverrideCheck
Gets or sets a value indicating whether an overriden method will return without further processing.
public bool BypassOverrideCheck { get; set; }
Property Value
- Boolean
true
to bypass the check that evaluates if a ToString() method is overriden; otherwise,false
.
Remarks
If ObjectPortrayal(Object, Action<ObjectPortrayalOptions>) is called from within an overriden ToString() method, this property should have a value of true
to avoid StackOverflowException.
Delimiter
Gets or sets the delimiter specification that is used together with PropertyConverter.
public string Delimiter { get; set; }
Property Value
- String
The delimiter specification that is used together with PropertyConverter.
NoGetterValue
Gets or sets the string representation of a missing getter
method of a property.
public string NoGetterValue { get; set; }
Property Value
- String
The string representation of a missing
getter
method of a property.
NullValue
Gets or sets the string representation of a null
value.
public string NullValue { get; set; }
Property Value
- String
The string representation of a
null
value.
PropertiesPredicate
Gets or sets the function delegate that defines a set of criteria and determines whether the specified PropertyInfo meets those criteria.
public Func<PropertyInfo, bool> PropertiesPredicate { get; set; }
Property Value
- Func<PropertyInfo, Boolean>
The function delegate that defines a set of criteria and determines whether the specified PropertyInfo meets those criteria.
PropertyConverter
Gets or sets the function delegate that convert a PropertyInfo object into a human-readable string.
public Func<PropertyInfo, object, IFormatProvider, string> PropertyConverter { get; set; }
Property Value
- Func<PropertyInfo, Object, IFormatProvider, String>
The function delegate that convert a PropertyInfo object into a human-readable string.
Methods
ValidateOptions()
Determines whether the public read-write properties of this instance are in a valid state.
public override void ValidateOptions()
Remarks
This method is expected to throw exceptions when one or more conditions fails to be in a valid state.