PostSharp SDK6.6//Post­Sharp.​Sdk.​Code­Model Namespace/Type­Def­Declaration Class

TypeDefDeclaration Class

Represents a type.
Inheritance Hierarchy

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.6.3.0 (6.6.3.0)
Syntax
C#
public sealed class TypeDefDeclaration : NamedMetadataDeclaration, 
	IGenericDefinitionDefinition, IGenericDefinition, IGeneric, IMetadataDeclaration, IDeclaration, 
	IElement, IModuleElement, ITaggable, IGenericTypeDefinition, INamedType, 
	IType, ITypeSignatureDeclaration, ITypeSignature, IVisitable<ITypeSignature>, 
	IEquatable<ITypeSignature>, IWriteReflectionName, IMember, INamed, 
	ISecurable, ITypeContainer, IRemovable, IMemberRefResolutionScope, ITypeDeclaration, 
	INamedMetadataDeclaration

The TypeDefDeclaration type exposes the following members.

Constructors
  NameDescription
Public methodTypeDefDeclaration
Initializes a new TypeDefDeclaration.
Properties
  NameDescription
Public propertyAttributes
Gets or sets the type attributes.
Public propertyBaseType
Gets or sets the base type, from which the current type derives.
Public propertyBaseTypeDef
Gets the base TypeDefDeclaration, or null if the current type has no parent (typically, with interfaces or System.Object).
Public propertyCustomDebuggingInformation (Inherited from Declaration.)
Public propertyDeclaringType
Gets the declaring type (i.e. the type in which the current type is nested), or null if the current type is not nested.
Public propertyExplicitAlignment
Gets or sets the field alignment (packing size).
Public propertyExplicitTypeSize
Gets or sets the type size.
Public propertyIsGenericDefinition
Determines whether the current instance is a generic definition, i.e. whether it can be used to construct generic instances.
Public propertyIsModuleSpecialType
Determines whether the current type is the special type representing the module.
Public propertyIsOriginal
Determines whether the current declaration existed in the source assembly.
(Inherited from MetadataDeclaration.)
Public propertyIsSealed
Determines whether the type is sealed.
Public propertyIsStatic
Determines whether the current member is static.
Public propertyMetadataToken
Gets or sets the token of the current declaration.
(Inherited from MetadataDeclaration.)
Public propertyName
Gets or sets the name of the current declaration.
(Inherited from NamedMetadataDeclaration.)
Public propertyOriginalDeclaration
When the declaration represents another declaration in the source assembly, this property refers to this declaration. When using GetReflectionObject(Type[], Type[], BindingOptions), the original declaration should actually be retrieved.
(Inherited from MetadataDeclaration.)
Public propertyOriginalName (Inherited from NamedMetadataDeclaration.)
Public propertyParentMember
Gets the parent member of the current declaration.
(Overrides MetadataDeclaration.ParentMember.)
Public propertyParentType
Gets the parent type of the current declaration.
(Overrides MetadataDeclaration.ParentType.)
Public propertyProjectedType
Public propertyShortName
Gets the type name without the namespace and without the arity.
Public propertyTypeIdentifier
Public propertyVisibility
Gets the type visibility.
Methods
  NameDescription
Public methodClearCache
Clear the cache (typically mapping to System.Reflection or, if the current element is a reference, to the related definition) of the current Element and all its children.
(Overrides Element.ClearCache().)
Public methodDispose Obsolete. (Inherited from MetadataDeclaration.)
Public methodEquals(Object)
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodEquals(ITypeSignature)
Indicates whether the current object is equal to another object of the same type.
Public methodFindEvent
Finds an event in the current type or in its parents.
Public methodFindField
Finds a field in the current type or in its parents.
Public methodFindMethod(IMethod)
Public methodFindMethod(String, IMethodSignature, BindingOptions)
Finds a method in the current type or in parent types given its name and signature.
Public methodFindProperty(String)
Finds a property in the current type or in its parents.
Public methodFindProperty(String, IList<ITypeSignature>)
Finds a property in the current type or in its parents.
Public methodGetCanonicalHashCode
Gets a hash code that is invariant under type signature equality (i.e. if two types are equal under IEquatable<T>, they have the same canonical hash code).
Public methodGetGenericContext
Gets the generic context inside the scope of the generic instance.
Public methodGetGenericInstance
Gets a generic instance of this type.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetInterfacesRecursive
Gets the list of interfaces implemented directly or indirectly by the current type.
Public methodGetSystemType(Type[], Type[])
Gets the system, runtime Type corresponding to the current type.
Public methodGetSystemType(Type[], Type[], BindingOptions)
Gets the system, runtime Type corresponding to the current type.
Public methodGetTag<T>
Gets a tag associated with the current declaration.
(Inherited from MetadataDeclaration.)
Public methodGetTokenType
Gets the TokenType of the derived declaration.
(Overrides MetadataDeclaration.GetTokenType().)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValueSize
Gets the size of the value type.
Public methodIsDerivedFrom
Determines whether the current type is derived from a given type.
Public methodIsValueTypeSafe
Public methodMatchesReference
Determines whether the current type signature matches a given type signature.
Public methodRemove
Remove the current declaration from its parent.
Public methodSetTag<T>
Set a tag to the current declaration.
(Inherited from MetadataDeclaration.)
Public methodToString (Inherited from NamedMetadataDeclaration.)
Public methodTranslate
Public methodWriteReflectionName(StringBuilder, ReflectionNameOptions)
Gets the full type name according the conventions of System.Reflection (with the namespace and nesting type but without the assembly name).
Public methodWriteReflectionName(StringBuilder, ReflectionNameOptions, NameMapper)
Writes the name of the current declaration to a StringBuilder and specifies a NameMapper.
Fields
  NameDescription
Public fieldStatic memberAuto
When applied to the ExplicitTypeSize or ExplicitAlignment property, specifies that the type size or alignment (packing size) is determined automatically by the runtime according to the current platform.
Public fieldStatic memberInstanceConstructorName
Method name for instance constructors.
Public fieldStatic memberTypeConstructorName
Method name for type constructors.
Extension Methods
  NameDescription
Public Extension MethodDefinitionMatchesReference (Defined by CompareExtensions.)
Public Extension MethodFindMethod(IMethod)Overloaded. (Defined by TypeSignatureExtensions.)
Public Extension MethodFindMethod(String, IMethodSignature, BindingOptions)Overloaded. (Defined by TypeSignatureExtensions.)
Public Extension MethodGetAssignmentDistance(ITypeSignature)Overloaded. (Defined by TypeSignatureExtensions.)
Public Extension MethodGetAssignmentDistance(ITypeSignature, GenericMap)Overloaded. (Defined by TypeSignatureExtensions.)
Public Extension MethodGetCanonicalGenericInstance
Gets the canonical generic instance of a generic type.
(Defined by GenericHelper.)
Public Extension MethodGetDisplayName
Gets the name of a given declaration as it should be displayed to the user.
(Defined by WriteReflectionNameExtensions.)
Public Extension MethodGetReflectionName()Overloaded.
Gets the name of a given declaration and returns a string that is compatible with the result of the ToString method of system reflection objects.
(Defined by WriteReflectionNameExtensions.)
Public Extension MethodGetReflectionName(ReflectionNameOptions)Overloaded.
Gets the name of a given declaration and returns a string that is compatible with the result of the ToString method of system reflection objects.
(Defined by WriteReflectionNameExtensions.)
Public Extension MethodGetReflectionName(ReflectionNameOptions, NameMapper)Overloaded.
Gets the name of a given declaration, constructed using given options.
(Defined by WriteReflectionNameExtensions.)
Public Extension MethodIs<T> (Defined by TypeSignatureExtensions.)
Public Extension MethodIsAbstract()Overloaded. (Defined by TypeSignatureExtensions.)
Public Extension MethodIsAbstract()Overloaded. (Defined by TypeSignatureExtensions.)
Public Extension MethodIsAssignableFromRuntimeType (Defined by TypeSignatureExtensions.)
Public Extension MethodIsAssignableFromRuntimeValue
Determines whether a given type signature can be assigned a given runtime value.
(Defined by TypeSignatureExtensions.)
Public Extension MethodIsAssignableTo(ITypeSignature)Overloaded.
Determines whether instances of the current type is assignable to locations of a specified type (i.e. whether the current type derives or implements this type).
(Defined by TypeSignatureExtensions.)
Public Extension MethodIsAssignableTo(ITypeSignature, GenericMap)Overloaded.
Determines whether instances of the current type is assignable to locations of a specified type (i.e. whether the current type derives or implements this type) and specifies a GenericMap.
(Defined by TypeSignatureExtensions.)
Public Extension MethodIsAssignableToRuntimeType (Defined by TypeSignatureExtensions.)
Public Extension MethodIsByRef (Defined by TypeSignatureExtensions.)
Public Extension MethodIsDelegate (Defined by TypeSignatureExtensions.)
Public Extension MethodIsEnum (Defined by TypeSignatureExtensions.)
Public Extension MethodIsExternallyVisible()Overloaded. (Defined by VisibilityHelper.)
Public Extension MethodIsExternallyVisible()Overloaded.
Determines whether a member is visible outside its assembly.
(Defined by VisibilityHelper.)
Public Extension MethodIsExternallyVisible()Overloaded.
Determines whether a type is visible outside its assembly.
(Defined by VisibilityHelper.)
Public Extension MethodIsInterface()Overloaded. (Defined by TypeSignatureExtensions.)
Public Extension MethodIsInterface()Overloaded. (Defined by TypeSignatureExtensions.)
Public Extension MethodIsIntrinsic (Defined by TypeSignatureExtensions.)
Public Extension MethodIsNullable
Determines whether a given type signature can be assigned a null value.
(Defined by TypeSignatureExtensions.)
Public Extension MethodIsPointer(Nullable<Boolean>)Overloaded. (Defined by TypeSignatureExtensions.)
Public Extension MethodIsPointer(Nullable<Boolean>, PointerTypeSignature)Overloaded. (Defined by TypeSignatureExtensions.)
Public Extension MethodIsPublic()Overloaded.
Determines whether a member is visible outside its assembly.
(Defined by VisibilityHelper.)
Public Extension MethodIsPublic()Overloaded.
Determines whether a type is visible outside its assembly.
(Defined by VisibilityHelper.)
Public Extension MethodIsPublicOrInternal
Determines whether a type is visible outside its class hierarchy (derived and nested/declaring types).
(Defined by VisibilityHelper.)
Public Extension MethodIsValueType (Defined by TypeSignatureExtensions.)
Public Extension MethodIsVisible
Determines whether a member is visible from a given scope.
(Defined by VisibilityHelper.)
Public Extension MethodToType (Defined by TypeSignatureExtensions.)
Remarks
Types may be contained by other types (TypeDefDeclaration) or modules (ModuleDeclaration).
See Also