Table of Contents

Class TypeNameOptions

Namespace
Cuemon.Reflection
Assembly
Cuemon.Core.dll
public sealed class TypeNameOptions : FormattingOptions, IValidatableParameterObject, IParameterObject
Inheritance
Object
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
FormatProviderSystem.Globalization.CultureInfo.InvariantCulture
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 System.Type.

public bool ExcludeGenericArguments { get; set; }

Property Value

Boolean

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

FriendlyNameStringConverter

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

Exceptions

System.ArgumentNullException

value cannot be null.

FullName

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

public bool FullName { get; set; }

Property Value

Boolean

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

Methods

ValidateOptions()

public override void ValidateOptions()