Table of Contents

Class ObjectPortrayalOptions

Namespace
Cuemon
Assembly
Cuemon.Core.dll
public sealed class ObjectPortrayalOptions : FormattingOptions, IValidatableParameterObject, IParameterObject
Inheritance
Object
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.

PropertyInitial Value
BypassOverrideCheckfalse
NullValue<null>
NoGetterValue<no getter>
FormatProviderSystem.Globalization.CultureInfo.InvariantCulture
Delimiter,
PropertyConverter
(property, instance, provider) =>
{
   if (property.CanRead)
   {
       if (TypeUtility.IsComplex(property.PropertyType))
       {
           return string.Format(provider, "{0}={1}", property.Name, ConvertFactory.UseConverter<TypeRepresentationConverter>().ChangeType(property.PropertyType, o => o.FullName = true));
       }
       var instanceValue = ReflectionUtility.GetPropertyValue(instance, property);
       return string.Format(provider, "{0}={1}", property.Name, instanceValue ?? NullValue);
   }
   return string.Format(provider, "{0}={1}", property.Name, NoGetterValue);
};
PropertiesPredicateproperty => 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 System.Object.ToString() method, this property should have a value of true to avoid System.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 System.Reflection.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 System.Reflection.PropertyInfo meets those criteria.

PropertyConverter

Gets or sets the function delegate that convert a System.Reflection.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 System.Reflection.PropertyInfo object into a human-readable string.

Methods

ValidateOptions()

public override void ValidateOptions()

See Also