MethodDefDeclaration Class |
Represents a method definition (MethodDef).
System.Object
PostSharp.Sdk.CodeModel.Element
PostSharp.Sdk.CodeModel.Declaration
PostSharp.Sdk.CodeModel.MetadataDeclaration
PostSharp.Sdk.CodeModel.NamedMetadataDeclaration
PostSharp.Sdk.CodeModel.NamedPositionedMetadataDeclaration
PostSharp.Sdk.CodeModel.MethodDefDeclaration
PostSharp.Sdk.CodeModel.Element
PostSharp.Sdk.CodeModel.Declaration
PostSharp.Sdk.CodeModel.MetadataDeclaration
PostSharp.Sdk.CodeModel.NamedMetadataDeclaration
PostSharp.Sdk.CodeModel.NamedPositionedMetadataDeclaration
PostSharp.Sdk.CodeModel.MethodDefDeclaration
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 MethodDefDeclaration : NamedPositionedMetadataDeclaration, IMethod, IMethodSignature, IModuleElement, IEquatable<IMethodSignature>, IMember, IMetadataDeclaration, IDeclaration, IElement, ITaggable, IWriteReflectionName, INamed, IGeneric, IEquatable<IMethod>, IMemberRefResolutionScope, ISecurable, IGenericMethodDefinition, IGenericDefinition, IGenericDefinitionDefinition, IVisitable<ITypeSignature>, IRemovable
The MethodDefDeclaration type exposes the following members.
Name | Description | |
---|---|---|
MethodDefDeclaration |
Initializes a new MethodDefDeclaration.
|
Name | Description | |
---|---|---|
Attributes |
Gets or sets the method attributes.
| |
CallingConvention |
Gets or sets the method calling convention.
| |
CustomDebuggingInformation | (Inherited from Declaration.) | |
HasBody |
Determines whether the method currently has a body.
| |
ImplementationAttributes |
Gets or sets the method implementation attributes.
| |
IsAbstract |
Determines whether the method is abstract.
| |
IsGenericDefinition |
Determines whether the current instance is a generic definition, i.e. whether it can
be used to construct generic instances.
| |
IsNew |
Determines whether the method takes a new slot.
| |
IsOriginal |
Determines whether the current declaration existed in the source assembly.
(Inherited from MetadataDeclaration.) | |
IsSealed |
Determines whether the method is sealed.
| |
IsVirtual |
Determines whether the method is virtual.
| |
MayHaveBody |
Determines whether this method may have a body.
| |
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 | (Inherited from NamedPositionedMetadataDeclaration.) | |
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.) | |
PInvokeMap |
Gets the P-Invoke map.
| |
ReturnParameter |
Gets the return parameter.
| |
Visibility |
Gets the visibility of the current method.
|
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.) | |
Dispose | Obsolete. (Inherited from MetadataDeclaration.) | |
Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Equals(IMethod) | Indicates whether the current object is equal to another object of the same type. | |
Equals(IMethodSignature) | Indicates whether the current object is equal to another object of the same type. | |
FindOverride |
Finds the override method that should be called when the current
virtual method is called with an instance of a given type.
| |
FindParentMethodGroup |
Finds the parent PropertyDeclaration or EventDeclaration of the current method.
| |
GetGenericContext |
Gets the GenericMap of the current method.
| |
GetGenericInstance(GenericMap) |
Gets a generic instance of the current method.
| |
GetGenericInstance(IList<ITypeSignature>, BindingOptions) |
Finds or construct a specific generic instance of the current generic method definition.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetParentDefinition() |
When the current method overrides a method in a parent type, returns
the overridden method.
| |
GetParentDefinition(Boolean) |
When the current method overrides a method in a parent type, returns
the overridden method, and specifies whether the method should recurse
to the root definition of the method.
| |
GetSystemMethod(Type[], Type[]) |
Gets the system runtime method corresponding to the current method.
| |
GetSystemMethod(Type[], Type[], BindingOptions) |
Gets the system runtime method corresponding to the current method.
| |
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.) | |
MapGenericArguments |
Resolves all generic arguments in the current method signature.
| |
ReferencesAnyGenericArgument |
Determines whether generic arguments are used in the current signature.
| |
ReleaseBody |
Indicates that the body is no more needed in memory, so that
it is marked for garbage collection.
| |
Remove |
Remove the current declaration from its parent.
| |
SetTag<T> |
Set a tag to the current declaration.
(Inherited from MetadataDeclaration.) | |
ToString | (Inherited from NamedMetadataDeclaration.) | |
Translate | ||
TranslateMethodSignature |
Translates the current method signature so that it is meaningful in another
module than the one to which it primarily belong.
| |
Visit | ||
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 | |
---|---|---|
CreateMethodBodyRestructurer | (Defined by MethodBodyRestructureExtensions.) | |
DefinitionMatchesReference(IMethod, BindingOptions) | Overloaded. (Defined by CompareExtensions.) | |
DefinitionMatchesReference(IMethodSignature, BindingOptions) | Overloaded. (Defined by CompareExtensions.) | |
FindGenericInterfaceOverride | (Defined by MethodExtensions.) | |
FindOverride | (Defined by MethodExtensions.) | |
GetCallOpCode | (Defined by MethodExtensions.) | |
GetCanonicalGenericInstance |
Gets the canonical generic instance of a generic method.
(Defined by GenericHelper.) | |
GetDisplayName |
Gets the name of a given declaration as it should be displayed to the user.
(Defined by WriteReflectionNameExtensions.) | |
GetGenericInstance | (Defined by GenericHelper.) | |
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.) | |
IsExternallyVisible |
Determines whether a member is visible outside its assembly.
(Defined by VisibilityHelper.) | |
IsPublic() | Overloaded.
Determines whether a member is visible outside its assembly.
(Defined by VisibilityHelper.) | |
IsPublic() | Overloaded.
Determines whether a method is visible outside its assembly.
(Defined by VisibilityHelper.) | |
IsPublicOrInternal |
Determines whether a method is visible outside class hierarchy.
(Defined by VisibilityHelper.) | |
IsVisible |
Determines whether a member is visible from a given scope.
(Defined by VisibilityHelper.) |