PostSharp SDK 6.9 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / IMethod Interface

IMethod Interface

Defines the functionalities that are common to all representations of a method (MethodDefDeclaration, MethodRefDeclaration, MethodSpecDeclaration).

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.9.11.0 (6.9.11.0)
Syntax
C#
public interface IMethod : IMethodSignature, 
	IModuleElement, IEquatable<IMethodSignature>, IMember, IMetadataDeclaration, 
	IDeclaration, IElement, ITaggable, IWriteReflectionName, INamed, 
	IGeneric, IEquatable<IMethod>

The IMethod type exposes the following members.

Properties
  NameDescription
Public propertyAttributes
Gets the attributes of the method.
Public propertyCallingConvention
Gets the method calling convention.
(Inherited from IMethodSignature.)
Public propertyCustomAttributes
Gets the collection of custom attributes.
(Inherited from IMetadataDeclaration.)
Public propertyDeclaringAssembly
Gets the declaring assembly.
(Inherited from IModuleElement.)
Public propertyDeclaringType
Gets the declaring type.
(Inherited from IMember.)
Public propertyDomain
Gets the Domain to which the current element belongs.
(Inherited from IElement.)
Public propertyGenericParameterCount
Gets the number of generic parameters or arguments (i.e. the arity).
(Inherited from IMethodSignature.)
Public propertyIsAbstract
Determines whether the method is abstract.
Public propertyIsGenericDefinition
Determines whether the current instance is a generic definition, i.e. whether it can be used to construct generic instances.
(Inherited from IGeneric.)
Public propertyIsGenericInstance
Determines whether the current instance is a generic instance, i.e. whether it has been constructed from a generic definition.
(Inherited from IGeneric.)
Public propertyIsNew
Determines whether the method takes a new slot.
Public propertyIsSealed
Determines whether the method is sealed.
Public propertyIsStatic
Determines whether the current member is static.
(Inherited from IMember.)
Public propertyIsVirtual
Determines whether the method is virtual.
Public propertyMetadataToken
Gets the metadata token of the current declaration.
(Inherited from IMetadataDeclaration.)
Public propertyModule
Gets the declaring module.
(Inherited from IModuleElement.)
Public propertyName (Inherited from INamed.)
Public propertyParameterCount
Gets the number of parameters.
(Inherited from IMethodSignature.)
Public propertyParent
Gets the direct parent of the current element.
(Inherited from IElement.)
Public propertyParentMember
Gets the parent member of the current declaration.
(Inherited from IMetadataDeclaration.)
Public propertyParentType
Gets the parent type of the current declaration.
(Inherited from IMetadataDeclaration.)
Public propertyReturnType
Gets the return type.
(Inherited from IMethodSignature.)
Public propertyVisibility
Gets the Visibility of the current member.
(Inherited from IMember.)
Methods
  NameDescription
Public methodContainsGenericArguments (Inherited from IGeneric.)
Public methodEquals(T)
Indicates whether the current object is equal to another object of the same type.
(Inherited from IEquatable<IMethod>.)
Public methodEquals(T) (Inherited from IEquatable<IMethodSignature>.)
Public methodGetGenericContext
Gets the generic context inside the scope of the generic instance.
(Inherited from IGeneric.)
Public methodGetGenericMethod
If this is a MethodDefDeclaration or a MethodRefDeclaration, returns itself.

If this is a MethodSpecDeclaration, returns the method-def-declaration or the method-ref-declaration that it's derived from.

Public methodGetMethodDefinition()
Finds in the current domain the MethodDefDeclaration corresponding to the current method with default BindingOptions.
Public methodGetMethodDefinition(BindingOptions)
Finds in the current domain the MethodDefDeclaration corresponding to the current method and specifies BindingOptions.
Public methodGetParameterType
Gets the type of a parameter given its position.
(Inherited from IMethodSignature.)
Public methodGetReflectionObject
Gets the system, runtime object (Type, FieldInfo, MethodInfo, ParameterInfo, ...) corresponding to the current declaration.
(Inherited from IMetadataDeclaration.)
Public methodGetSystemMethod(Type[], Type[])
Gets the system runtime method corresponding to the current method.
Public methodGetSystemMethod(Type[], Type[], BindingOptions)
Gets the system runtime method corresponding to the current method.
Public methodGetTag<T>
Gets a tag associated with the current declaration.
(Inherited from ITaggable.)
Public methodGetTokenType
Gets the metadata token type of the current declaration.
(Inherited from IMetadataDeclaration.)
Public methodMapGenericArguments
Resolves all generic arguments in the current method signature.
(Inherited from IMethodSignature.)
Public methodReferencesAnyGenericArgument
Determines whether generic arguments are used in the current signature.
(Inherited from IMethodSignature.)
Public methodSetTag<T>
Set a tag to the current declaration.
(Inherited from ITaggable.)
Public methodTranslate
Translates the current element so that it can be used in a given module.
(Inherited from IModuleElement.)
Public methodTranslateMethod
Translates the current method so that it is meaningful in another module than the one to which it primarily belong.
Public methodTranslateMethodSignature
Translates the current method signature so that it is meaningful in another module than the one to which it primarily belong.
(Inherited from IMethodSignature.)
Public methodWriteReflectionName(StringBuilder, ReflectionNameOptions)
Writes the name of the current declaration to a StringBuilder.
(Inherited from IWriteReflectionName.)
Public methodWriteReflectionName(StringBuilder, ReflectionNameOptions, NameMapper)
Writes the name of the current declaration to a StringBuilder and specifies a NameMapper.
(Inherited from IWriteReflectionName.)
Extension Methods
  NameDescription
Public Extension MethodDefinitionMatchesReference(IMethod, BindingOptions)Overloaded. (Defined by CompareExtensions.)
Public Extension MethodDefinitionMatchesReference(IMethodSignature, BindingOptions)Overloaded. (Defined by CompareExtensions.)
Public Extension MethodFindOverride (Defined by MethodExtensions.)
Public Extension MethodGetCallOpCode (Defined by MethodExtensions.)
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 MethodIsExternallyVisible
Determines whether a member is visible outside its assembly.
(Defined by VisibilityHelper.)
Public Extension MethodIsPublic
Determines whether a member is visible outside its assembly.
(Defined by VisibilityHelper.)
Public Extension MethodIsVisible
Determines whether a member is visible from a given scope.
(Defined by VisibilityHelper.)
See Also