Skip to content
Concord

Class InjectAt.NewObj

Namespace
Concord.Emit
Assembly
Concord.Emit.dll

Targets a newobj instruction inside the target body.

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

Constructors

NewObj(Type, At, uint, Type[]?, uint)

Targets a newobj instruction inside the target body.

public NewObj(Type ConstructedType, At Shift, uint By = 0, Type[]? ParameterTypes = null, uint Arg = 0)

Parameters

ConstructedType Type

The type being constructed.

Shift At

Where the injection method runs relative to the construction.

By uint

The 1-based occurrence to target, or 0 to target every match.

ParameterTypes Type[]

Restricts matches to one constructor overload by parameter types.

Arg uint

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

Properties

Arg

The 1-based constructor 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 to target, or 0 to target every match.

public uint By { get; init; }

Property Value

uint

ConstructedType

The type being constructed.

public Type ConstructedType { get; init; }

Property Value

Type

ParameterTypes

Restricts matches to one constructor overload by parameter types.

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

Property Value

Type[]

Shift

Where the injection method runs relative to the construction.

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