Show / Hide Table of Contents

Class ObjectPortrayalOptions

Configuration options for ObjectPortrayal(Object, Action<ObjectPortrayalOptions>).

Inheritance
Object
FormattingOptions<CultureInfo>
ObjectPortrayalOptions
Implements
IParameterObject
Inherited Members
FormattingOptions<CultureInfo>.FormatProvider
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public sealed class ObjectPortrayalOptions : FormattingOptions<CultureInfo>, IParameterObject

Constructors

| Improve this Doc View Source

ObjectPortrayalOptions()

Initializes a new instance of the ObjectPortrayalOptions class.

Declaration
public ObjectPortrayalOptions()
Remarks

The following table shows the initial property values for an instance of ObjectPortrayalOptions.

PropertyInitial Value
BypassOverrideCheckfalse
NullValue<null>
NoGetterValue<no getter>
FormatProviderInvariantCulture
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

| Improve this Doc View Source

BypassOverrideCheck

Gets or sets a value indicating whether an overriden method will return without further processing.

Declaration
public bool BypassOverrideCheck { get; set; }
Property Value
Type Description
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.

| Improve this Doc View Source

Delimiter

Gets or sets the delimiter specification that is used together with PropertyConverter.

Declaration
public string Delimiter { get; set; }
Property Value
Type Description
String

The delimiter specification that is used together with PropertyConverter.

Exceptions
Type Condition
ArgumentNullException

value cannot be null.

ArgumentException

value cannot be empty.

| Improve this Doc View Source

NoGetterValue

Gets or sets the string representation of a missing getter method of a property.

Declaration
public string NoGetterValue { get; set; }
Property Value
Type Description
String

The string representation of a missing getter method of a property.

Exceptions
Type Condition
ArgumentNullException

value cannot be null.

ArgumentException

value cannot be empty.

| Improve this Doc View Source

NullValue

Gets or sets the string representation of a null value.

Declaration
public string NullValue { get; set; }
Property Value
Type Description
String

The string representation of a null value.

Exceptions
Type Condition
ArgumentNullException

value cannot be null.

ArgumentException

value cannot be empty.

| Improve this Doc View Source

PropertiesPredicate

Gets or sets the function delegate that defines a set of criteria and determines whether the specified PropertyInfo meets those criteria.

Declaration
public Func<PropertyInfo, bool> PropertiesPredicate { get; set; }
Property Value
Type Description
Func<PropertyInfo, Boolean>

The function delegate that defines a set of criteria and determines whether the specified PropertyInfo meets those criteria.

Exceptions
Type Condition
ArgumentNullException

value cannot be null.

| Improve this Doc View Source

PropertyConverter

Gets or sets the function delegate that convert a PropertyInfo object into a human-readable string.

Declaration
public Func<PropertyInfo, object, IFormatProvider, string> PropertyConverter { get; set; }
Property Value
Type Description
Func<PropertyInfo, Object, IFormatProvider, String>

The function delegate that convert a PropertyInfo object into a human-readable string.

Exceptions
Type Condition
ArgumentNullException

value cannot be null.

Implements

IParameterObject

See Also

FormattingOptions<T>
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright 2008-2022 Geekle. All rights reserved. Code with passion and love; deploy with confidence. 👨‍💻️🔥❤️🚀😎
Generated by DocFX