Class AbstractType
- Namespace
- ICSharpCode.Decompiler.TypeSystem.Implementation
- Assembly
- ICSharpCode.Decompiler.dll
Default implementation for IType interface.
public abstract class AbstractType : IType, INamedElement, IEquatable<IType>
- Inheritance
-
AbstractType
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
AbstractType()
protected AbstractType()
Properties
DeclaringType
Gets the parent type, if this is a nested type. Returns null for top-level types.
public virtual IType DeclaringType { get; }
Property Value
DirectBaseTypes
public virtual IEnumerable<IType> DirectBaseTypes { get; }
Property Value
FullName
public virtual string FullName { get; }
Property Value
IsByRefLike
Gets whether this type is "ref-like": a ByReferenceType or "ref struct".
public virtual bool IsByRefLike { get; }
Property Value
IsReferenceType
public abstract bool? IsReferenceType { get; }
Property Value
- bool?
Kind
Gets the type kind.
public abstract TypeKind Kind { get; }
Property Value
Name
public abstract string Name { get; }
Property Value
Namespace
Gets the full name of the namespace containing this entity.
public virtual string Namespace { get; }
Property Value
Nullability
Gets the nullability annotation on this type.
public virtual Nullability Nullability { get; }
Property Value
ReflectionName
public virtual string ReflectionName { get; }
Property Value
TypeArguments
Gets the type arguments passed to this type.
If this type is a generic type definition that is not parameterized, this property returns the type parameters,
as if the type was parameterized with its own type arguments (class C<T> { C<T> field; }
).
public virtual IReadOnlyList<IType> TypeArguments { get; }
Property Value
TypeParameterCount
Gets the number of type parameters.
public virtual int TypeParameterCount { get; }
Property Value
TypeParameters
Gets the type parameters. Returns an empty list if this type is not generic.
public virtual IReadOnlyList<ITypeParameter> TypeParameters { get; }
Property Value
Methods
AcceptVisitor(TypeVisitor)
public virtual IType AcceptVisitor(TypeVisitor visitor)
Parameters
visitor
TypeVisitor
Returns
ChangeNullability(Nullability)
Creates a new type that is a copy of this type, with the changed nullability annotation.
public virtual IType ChangeNullability(Nullability nullability)
Parameters
nullability
Nullability
Returns
Equals(IType)
public virtual bool Equals(IType other)
Parameters
other
IType
Returns
Equals(object)
public override sealed bool Equals(object obj)
Parameters
obj
object
Returns
GetAccessors(Predicate<IMethod>, GetMemberOptions)
public virtual IEnumerable<IMethod> GetAccessors(Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IMethod>options
GetMemberOptions
Returns
GetConstructors(Predicate<IMethod>, GetMemberOptions)
public virtual IEnumerable<IMethod> GetConstructors(Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)
Parameters
filter
Predicate<IMethod>options
GetMemberOptions
Returns
GetDefinition()
Gets the underlying type definition. Can return null for types which do not have a type definition (for example arrays, pointers, type parameters).
public virtual ITypeDefinition GetDefinition()
Returns
GetDefinitionOrUnknown()
Gets the underlying type definition or UnkownType, if unknown. Can return null for types which do not have a type definition (for example arrays, pointers, type parameters).
public virtual ITypeDefinitionOrUnknown GetDefinitionOrUnknown()
Returns
GetEvents(Predicate<IEvent>, GetMemberOptions)
public virtual IEnumerable<IEvent> GetEvents(Predicate<IEvent> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IEvent>options
GetMemberOptions
Returns
GetFields(Predicate<IField>, GetMemberOptions)
public virtual IEnumerable<IField> GetFields(Predicate<IField> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IField>options
GetMemberOptions
Returns
GetHashCode()
public override int GetHashCode()
Returns
GetMembers(Predicate<IMember>, GetMemberOptions)
public virtual IEnumerable<IMember> GetMembers(Predicate<IMember> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IMember>options
GetMemberOptions
Returns
GetMethods(IReadOnlyList<IType>, Predicate<IMethod>, GetMemberOptions)
public virtual IEnumerable<IMethod> GetMethods(IReadOnlyList<IType> typeArguments, Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
typeArguments
IReadOnlyList<IType>filter
Predicate<IMethod>options
GetMemberOptions
Returns
GetMethods(Predicate<IMethod>, GetMemberOptions)
public virtual IEnumerable<IMethod> GetMethods(Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IMethod>options
GetMemberOptions
Returns
GetNestedTypes(IReadOnlyList<IType>, Predicate<ITypeDefinition>, GetMemberOptions)
public virtual IEnumerable<IType> GetNestedTypes(IReadOnlyList<IType> typeArguments, Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
typeArguments
IReadOnlyList<IType>filter
Predicate<ITypeDefinition>options
GetMemberOptions
Returns
GetNestedTypes(Predicate<ITypeDefinition>, GetMemberOptions)
public virtual IEnumerable<IType> GetNestedTypes(Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<ITypeDefinition>options
GetMemberOptions
Returns
GetProperties(Predicate<IProperty>, GetMemberOptions)
public virtual IEnumerable<IProperty> GetProperties(Predicate<IProperty> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IProperty>options
GetMemberOptions
Returns
GetSubstitution()
Gets a type visitor that performs the substitution of class type parameters with the type arguments of this parameterized type. Returns TypeParameterSubstitution.Identity if the type is not parametrized.
public TypeParameterSubstitution GetSubstitution()
Returns
GetSubstitution(IReadOnlyList<IType>)
public TypeParameterSubstitution GetSubstitution(IReadOnlyList<IType> methodTypeArguments)
Parameters
methodTypeArguments
IReadOnlyList<IType>
Returns
ToString()
public override string ToString()
Returns
VisitChildren(TypeVisitor)
public virtual IType VisitChildren(TypeVisitor visitor)
Parameters
visitor
TypeVisitor