Skip to content
Concord

Class InjectAt.Invoke

Namespace
Concord.Emit
Assembly
Concord.Emit.dll

Targets a named method or property call inside the target body. Head and Tail also target field reads.

public sealed record InjectAt.Invoke : InjectAt, IEquatable<InjectAt>, IEquatable<InjectAt.Invoke>
Inheritance
InjectAt.Invoke
Implements
Inherited Members

Constructors

Invoke(Type, string, At, uint, Type[]?, uint)

Targets a named method or property call inside the target body. Head and Tail also target field reads.

public Invoke(Type DeclaringType, string Method, At Shift, uint By = 0, Type[]? ParameterTypes = null, uint Arg = 0)

Parameters

DeclaringType Type

The declaring type of the member access to match.

Method string

The method, property, or field name to match.

Shift At

Where the injection method runs relative to the matched access: Head before it, Tail after it, or Around wrapping a method or property call. Field reads support Head and Tail only.

By uint

The 1-based occurrence of the matched access to target, or 0 to target every matching access.

ParameterTypes Type[]

For method or property calls, restricts matches by parameter types. Leave this null or empty when matching a field read.

Arg uint

The 1-based argument to rewrite for At.Argument, or 0 to infer by unique type match.

Properties

Arg

The 1-based argument to rewrite for At.Argument, or 0 to infer by unique type match.

public uint Arg { get; init; }

Property Value

uint

By

The 1-based occurrence of the matched access to target, or 0 to target every matching access.

public uint By { get; init; }

Property Value

uint

DeclaringType

The declaring type of the member access to match.

public Type DeclaringType { get; init; }

Property Value

Type

Method

The method, property, or field name to match.

public string Method { get; init; }

Property Value

string

ParameterTypes

For method or property calls, restricts matches by parameter types. Leave this null or empty when matching a field read.

public Type[]? ParameterTypes { get; init; }

Property Value

Type[]

Shift

Where the injection method runs relative to the matched access: Head before it, Tail after it, or Around wrapping a method or property call. Field reads support Head and Tail only.

public At Shift { get; init; }

Property Value

At

Slice

Bounds matching and By counting to a range of the target body.

public SliceRange? Slice { get; init; }

Property Value

SliceRange