Interface ITypeDefinition
- Namespace
- ICSharpCode.Decompiler.TypeSystem
- Assembly
- ICSharpCode.Decompiler.dll
Represents a class, enum, interface, struct, delegate, record or VB module. For partial classes, this represents the whole class.
public interface ITypeDefinition : ITypeDefinitionOrUnknown, IType, IEquatable<IType>, IEntity, INamedElement, ISymbol, ICompilationProvider
- Inherited Members
- Extension Methods
Properties
DeclaringType
Gets/Sets the declaring type (incl. type arguments, if any). This property will return null for top-level types.
IType? DeclaringType { get; }
Property Value
EnumUnderlyingType
For enums: returns the underlying primitive type. For all other types: returns null.
IType? EnumUnderlyingType { get; }
Property Value
Events
IEnumerable<IEvent> Events { get; }
Property Value
Fields
IEnumerable<IField> Fields { get; }
Property Value
HasExtensionMethods
Gets whether this type contains extension methods.
bool HasExtensionMethods { get; }
Property Value
Remarks
This property is used to speed up the search for extension methods.
IsReadOnly
For structs: returns whether this is a readonly struct. For all other types: returns false.
bool IsReadOnly { get; }
Property Value
IsRecord
Gets whether the type has the necessary members to be considered a C# 9 record or C# 10 record struct type.
bool IsRecord { get; }
Property Value
KnownTypeCode
Gets the known type code for this type definition.
KnownTypeCode KnownTypeCode { get; }
Property Value
Members
IReadOnlyList<IMember> Members { get; }
Property Value
MetadataName
Gets the short type name as stored in metadata. That is, the short type name including the generic arity (`N) appended.
string MetadataName { get; }
Property Value
Remarks
"Int32" for int
"List1" for List<T> "List
1" for List<string>
Methods
IEnumerable<IMethod> Methods { get; }
Property Value
NestedTypes
IReadOnlyList<ITypeDefinition> NestedTypes { get; }
Property Value
NullableContext
The nullability specified in the [NullableContext] attribute on the type. This serves as default nullability for members of the type that do not have a [Nullable] attribute.
Nullability NullableContext { get; }
Property Value
Properties
IEnumerable<IProperty> Properties { get; }