Table of Contents

Class TypeNameOptions

Namespace
Cuemon.Reflection
Assembly
Cuemon.Core.dll
public sealed class TypeNameOptions : FormattingOptions, IValidatableParameterObject, IParameterObject
Inheritance
TypeNameOptions
Implements
Inherited Members

Constructors

TypeNameOptions()

Initializes a new instance of the TypeNameOptions class.

public TypeNameOptions()

Remarks

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

PropertyInitial Value
ExcludeGenericArgumentsfalse
FullNamefalse
FormatProviderInvariantCulture
FriendlyNameStringConverter
(type, provider, fullname) =>
{
   var typeName = fullname ? type.FullName?.ToString(provider) ?? type.Name.ToString(provider) : type.Name.ToString(provider);
   var indexOfGraveAccent = typeName.IndexOf('`');
   return indexOfGraveAccent >= 0 ? typeName.Remove(indexOfGraveAccent) : typeName;
};

Properties

ExcludeGenericArguments

Gets or sets a value indicating whether to exclude generic arguments from a Type.

public bool ExcludeGenericArguments { get; set; }

Property Value

Boolean

true to exclude generic arguments from a Type; otherwise, false.

FriendlyNameStringConverter

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

public Func<Type, IFormatProvider, bool, string> FriendlyNameStringConverter { get; set; }

Property Value

Func<Type, IFormatProvider, Boolean, String>

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

Exceptions

ArgumentNullException

value cannot be null.

FullName

Gets or sets a value indicating whether to use the fully qualified name of a Type.

public bool FullName { get; set; }

Property Value

Boolean

true to use the fully qualified name of a Type; otherwise, false.

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.