MethodElement Class
A method, a constructor, or the accessor of a property or an event.
public sealed class MethodElement : MemberElement- Inheritance
MemberElementMethodElement
Properties
| Name | Description |
|---|---|
| Accessibility | Gets the declared accessibility of the member. |
| Attributes | Gets the attributes applied to the member. |
| GenericParameters | Gets the names of the generic parameters of the method. |
| IsAbstract | Gets a value indicating whether the method is abstract, including the methods of an interface that have no default implementation. |
| IsAsync | Gets a value indicating whether the method is async. |
| IsConstructor | Gets a value indicating whether the method is an instance or a static constructor. |
| IsExtension | Gets a value indicating whether the method is an extension method. |
| IsStatic | Gets a value indicating whether the member is static. |
| IsVirtual | Gets a value indicating whether the method can be overridden: it is virtual or abstract, and not sealed. |
| Location | Gets the first statement of the member when the PDB is available, or null. |
| Parameters | Gets the parameters of the method. |
| ReturnType | Gets the return type of the method (System.Void when it returns nothing). |
Accessibility
MethodElement.csGets the declared accessibility of the member.
public override ElementAccessibility Accessibility { get; }Property value
Attributes
MethodElement.csGets the attributes applied to the member.
public override IReadOnlyList<AttributeElement> Attributes { get; }Property value
GenericParameters
MethodElement.csGets the names of the generic parameters of the method.
public IReadOnlyList<string> GenericParameters { get; }Property value
IsAbstract
MethodElement.csIsAsync
MethodElement.csIsConstructor
MethodElement.csIsExtension
MethodElement.csIsStatic
MethodElement.csIsVirtual
MethodElement.csLocation
MethodElement.csGets the first statement of the member when the PDB is available, or null.
public override SourceLocation? Location { get; }Property value
Parameters
MethodElement.csGets the parameters of the method.
public IReadOnlyList<ParameterElement> Parameters { get; }Property value
ReturnType
MethodElement.csGets the return type of the method (System.Void when it returns nothing).
public TypeReference ReturnType { get; }Property value
Methods
| Name | Description |
|---|---|
| ToString() | Returns the method as DeclaringType.Name(ParameterTypes). |