Open sandboxFocus

Interface IMethodBuilder

Allows to complete the construction of a method that has been created by the IntroduceMethod(IAdviser<INamedType>, string, IntroductionScope, OverrideStrategy, Action<IMethodBuilder>?, object?, object?) advice.

Namespace: Metalama.Framework.Code.DeclarationBuilders
Assembly: Metalama.Framework.dll
Syntax
public interface IMethodBuilder : IMethod, IGeneric, IMethodInvoker, IMethodBaseBuilder, IMethodBase, IHasParametersBuilder, IHasParameters, IMemberBuilder, IMember, IMemberOrNamedTypeBuilder, IMemberOrNamedType, INamedDeclaration, IDeclarationBuilder, IDeclaration, IDisplayable, IDiagnosticLocation, ICompilationElement, IMeasurable, IEquatable<IDeclaration>

Properties

Name Description
IsReadOnly

Gets or sets a value indicating whether the method is read-only (applicable to struct methods).

OperatorKind

Gets or sets the operator kind. When set to a value other than None, the method becomes an operator. The name and IsStatic properties are automatically set based on the operator kind. This property can only be set once.

ReturnParameter

Gets an object allowing to read and modify the method return type and custom attributes, or null for methods that don't have return types: constructors and finalizers.

ReturnType

Gets or sets the method return type.

TypeParameters

Gets the type parameters of the method, as builders that can be changed.

Methods

Name Description
AddTypeParameter(ITypeParameter, bool)

Adds a type parameter that copies an existing type parameter: its name, its variance, its kind constraints and its type constraints.

AddTypeParameter(string)

Adds a generic parameter to the method.

Extension Methods

See Also