GenericParameterDeclaration Class |
Represents a generic parameter (GenericParam).
System.Object
PostSharp.Sdk.CodeModel.Element
PostSharp.Sdk.CodeModel.Declaration
PostSharp.Sdk.CodeModel.MetadataDeclaration
PostSharp.Sdk.CodeModel.NamedMetadataDeclaration
PostSharp.Sdk.CodeModel.GenericParameterDeclaration
PostSharp.Sdk.CodeModel.Element
PostSharp.Sdk.CodeModel.Declaration
PostSharp.Sdk.CodeModel.MetadataDeclaration
PostSharp.Sdk.CodeModel.NamedMetadataDeclaration
PostSharp.Sdk.CodeModel.GenericParameterDeclaration
Namespace: PostSharp.Sdk.CodeModel
Assembly: PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
public sealed class GenericParameterDeclaration : NamedMetadataDeclaration, ITypeSignature, IModuleElement, IVisitable<ITypeSignature>, IGeneric, IEquatable<ITypeSignature>, IWriteReflectionName, IPositioned, IGenericParameter, ICloneableModuleElement
The GenericParameterDeclaration type exposes the following members.
Name | Description | |
---|---|---|
GenericParameterDeclaration |
Initializes a new GenericParameterDeclaration.
|
Name | Description | |
---|---|---|
Attributes |
Gets or sets the attributes of the generic parameter.
| |
CustomDebuggingInformation | (Inherited from Declaration.) | |
DeclaringGenericDefinition |
Gets the IGenericDefinition that declares the current
generic parameter.
| |
IsOriginal |
Determines whether the current declaration existed in the source assembly.
(Inherited from MetadataDeclaration.) | |
Kind | ||
MetadataToken |
Gets or sets the token of the current declaration.
(Inherited from MetadataDeclaration.) | |
Name |
Gets or sets the name of the current declaration.
(Inherited from NamedMetadataDeclaration.) | |
Ordinal |
Gets or sets the generic parameter ordinal.
| |
OriginalDeclaration |
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.) | |
OriginalName | (Inherited from NamedMetadataDeclaration.) | |
ParentMember |
Gets the parent member of the current declaration.
(Overrides MetadataDeclaration.ParentMember.) | |
ParentType |
Gets the parent type of the current declaration.
(Overrides MetadataDeclaration.ParentType.) |
Name | Description | |
---|---|---|
ClearCache |
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.
(Inherited from Element.) | |
Clone |
Clones the current instance and makes the clone compatible within a given module.
| |
Dispose | Obsolete. (Inherited from MetadataDeclaration.) | |
Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Equals(ITypeSignature) | Indicates whether the current object is equal to another object of the same type. | |
Equals(GenericParameterDeclaration, Boolean) |
Compares the current GenericParameterDeclaration with an other.
| |
GetCanonicalHashCode |
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).
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetReference |
Gets the GenericParameterTypeSignature that references to the current
instance.
| |
GetSystemType(Type[], Type[]) |
Gets the system, runtime Type corresponding to the current type.
| |
GetSystemType(Type[], Type[], BindingOptions) |
Gets the system, runtime Type corresponding to the current type.
| |
GetTag<T> |
Gets a tag associated with the current declaration.
(Inherited from MetadataDeclaration.) | |
GetTokenType |
Gets the TokenType of the derived declaration.
(Overrides MetadataDeclaration.GetTokenType().) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetValueSize |
Gets the size of the value type.
| |
IsValidArgument | ||
IsValueTypeSafe | ||
MapGenericArguments |
Resolves all generic arguments in the current type signature.
| |
MatchesReference |
Determines whether the current type signature matches a given type signature.
| |
SetTag<T> |
Set a tag to the current declaration.
(Inherited from MetadataDeclaration.) | |
ToString | (Overrides NamedMetadataDeclaration.ToString().) | |
TranslateType |
Translates the current type signature so that it is meaningful in another
module than the one to which it primarily belong.
| |
WriteReflectionName(StringBuilder, ReflectionNameOptions) |
Writes the name of the current declaration to a StringBuilder.
| |
WriteReflectionName(StringBuilder, ReflectionNameOptions, NameMapper) |
Writes the name of the current declaration to a StringBuilder and
specifies a NameMapper.
|
Name | Description | |
---|---|---|
FindMethod(IMethod) | Overloaded. (Defined by TypeSignatureExtensions.) | |
FindMethod(String, IMethodSignature, BindingOptions) | Overloaded. (Defined by TypeSignatureExtensions.) | |
GetAssignmentDistance(ITypeSignature) | Overloaded. (Defined by TypeSignatureExtensions.) | |
GetAssignmentDistance(ITypeSignature, GenericMap) | Overloaded. (Defined by TypeSignatureExtensions.) | |
GetDisplayName |
Gets the name of a given declaration as it should be displayed to the user.
(Defined by WriteReflectionNameExtensions.) | |
GetReflectionName() | 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.) | |
GetReflectionName(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.) | |
GetReflectionName(ReflectionNameOptions, NameMapper) | Overloaded.
Gets the name of a given declaration, constructed using given options.
(Defined by WriteReflectionNameExtensions.) | |
Is<T> | (Defined by TypeSignatureExtensions.) | |
IsAbstract | (Defined by TypeSignatureExtensions.) | |
IsAssignableFromRuntimeType | (Defined by TypeSignatureExtensions.) | |
IsAssignableFromRuntimeValue |
Determines whether a given type signature can be assigned a given runtime value.
(Defined by TypeSignatureExtensions.) | |
IsAssignableTo(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.) | |
IsAssignableTo(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.) | |
IsAssignableToRuntimeType | (Defined by TypeSignatureExtensions.) | |
IsByRef | (Defined by TypeSignatureExtensions.) | |
IsDelegate | (Defined by TypeSignatureExtensions.) | |
IsEnum | (Defined by TypeSignatureExtensions.) | |
IsInterface | (Defined by TypeSignatureExtensions.) | |
IsIntrinsic | (Defined by TypeSignatureExtensions.) | |
IsNullable |
Determines whether a given type signature can be assigned a null value.
(Defined by TypeSignatureExtensions.) | |
IsPointer(Nullable<Boolean>) | Overloaded. (Defined by TypeSignatureExtensions.) | |
IsPointer(Nullable<Boolean>, PointerTypeSignature) | Overloaded. (Defined by TypeSignatureExtensions.) | |
IsValueType |
Returns true if the type signature is a value type; false if it's a reference type; and throws a NullReferenceException if it's
a generic parameter or if for some other reason we don't know if it's value or reference type. Consider using IsValueTypeSafe() == true instead.
(Defined by TypeSignatureExtensions.) | |
ToType | (Defined by TypeSignatureExtensions.) |
Generic parameters
are owned by types (TypeDefDeclaration) or
methods (MethodDefDeclaration).