Table of Contents

Struct FullTypeName

Namespace
ICSharpCode.Decompiler.TypeSystem
Assembly
ICSharpCode.Decompiler.dll

Holds the full name of a type definition. A full type name uniquely identifies a type definition within a single assembly.

public readonly struct FullTypeName : IEquatable<FullTypeName>
Implements
Inherited Members
Extension Methods

Remarks

A full type name can only represent type definitions, not arbitrary types. It does not include any type arguments, and can not refer to array or pointer types.

A full type name represented as reflection name has the syntax: NamespaceName '.' TopLevelTypeName [''#] { '+' NestedTypeName [''#] }

Constructors

FullTypeName(TopLevelTypeName)

Constructs a FullTypeName representing the given top-level type.

public FullTypeName(TopLevelTypeName topLevelTypeName)

Parameters

topLevelTypeName TopLevelTypeName

Remarks

FullTypeName has an implicit conversion operator from TopLevelTypeName, so you can simply write: FullTypeName f = new TopLevelTypeName(...);

FullTypeName(string)

Constructs a FullTypeName by parsing the given reflection name. Note that FullTypeName can only represent type definition names. If the reflection name might refer to a parameterized type or array etc., use ParseReflectionName(string) instead.

public FullTypeName(string reflectionName)

Parameters

reflectionName string

Remarks

Expected syntax: NamespaceName '.' TopLevelTypeName [''#] { '+' NestedTypeName [''#] } where # are type parameter counts

Properties

IsNested

Gets whether this is a nested type.

public bool IsNested { get; }

Property Value

bool

Name

Gets the name of the type. For nested types, this is the name of the innermost type.

public string Name { get; }

Property Value

string

NestingLevel

Gets the nesting level.

public int NestingLevel { get; }

Property Value

int

ReflectionName

public string ReflectionName { get; }

Property Value

string

TopLevelTypeName

Gets the top-level type name.

public TopLevelTypeName TopLevelTypeName { get; }

Property Value

TopLevelTypeName

TypeParameterCount

Gets the total type parameter count.

public int TypeParameterCount { get; }

Property Value

int

Methods

Equals(FullTypeName)

public bool Equals(FullTypeName other)

Parameters

other FullTypeName

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetDeclaringType()

Gets the declaring type name.

public FullTypeName GetDeclaringType()

Returns

FullTypeName

Examples

new FullTypeName("NS.A+B+C").GetDeclaringType() will return new FullTypeName("NS.A+B")

Exceptions

InvalidOperationException

This is a top-level type name.

GetHashCode()

public override int GetHashCode()

Returns

int

GetNestedTypeAdditionalTypeParameterCount(int)

Gets the number of additional type parameters of the nested type at the given level.

public int GetNestedTypeAdditionalTypeParameterCount(int nestingLevel)

Parameters

nestingLevel int

Returns

int

GetNestedTypeName(int)

Gets the name of the nested type at the given level.

public string GetNestedTypeName(int nestingLevel)

Parameters

nestingLevel int

Returns

string

NestedType(string, int)

Creates a nested type name.

public FullTypeName NestedType(string name, int additionalTypeParameterCount)

Parameters

name string
additionalTypeParameterCount int

Returns

FullTypeName

Examples

new FullTypeName("NS.A+B").NestedType("C", 1) will return new FullTypeName("NS.A+B+C`1")

ToString()

public override string ToString()

Returns

string

Operators

operator ==(FullTypeName, FullTypeName)

public static bool operator ==(FullTypeName left, FullTypeName right)

Parameters

left FullTypeName
right FullTypeName

Returns

bool

implicit operator FullTypeName(TopLevelTypeName)

public static implicit operator FullTypeName(TopLevelTypeName topLevelTypeName)

Parameters

topLevelTypeName TopLevelTypeName

Returns

FullTypeName

operator !=(FullTypeName, FullTypeName)

public static bool operator !=(FullTypeName left, FullTypeName right)

Parameters

left FullTypeName
right FullTypeName

Returns

bool