Skip to content
Concord

Class SliceAttribute

Namespace
Concord
Assembly
Concord.Emit.dll

Bounds an invoke or construction search to the code between two member-access anchors. The by ordinal on the injection then counts matches inside that range only.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class SliceAttribute : Attribute
Inheritance
SliceAttribute
Inherited Members

Constructors

SliceAttribute(Type?, string?, uint, Type?, string?, uint)

Declares a range that starts after the opening anchor and ends before the closing anchor. Leave both an anchor's type and its member null to extend to that end of the body; naming one without the other is an error.

public SliceAttribute(Type? fromType = null, string? fromMember = null, uint fromBy = 1, Type? toType = null, string? toMember = null, uint toBy = 1)

Parameters

fromType Type

The declaring type of the opening anchor.

fromMember string

The member name of the opening anchor.

fromBy uint

The 1-based occurrence of the opening anchor, counted across the whole body.

toType Type

The declaring type of the closing anchor.

toMember string

The member name of the closing anchor.

toBy uint

The 1-based occurrence of the closing anchor, counted across the whole body.

Properties

FromBy

The 1-based occurrence of the opening anchor.

public uint FromBy { get; }

Property Value

uint

FromMember

The member name of the opening anchor.

public string? FromMember { get; }

Property Value

string

FromType

The declaring type of the opening anchor.

public Type? FromType { get; }

Property Value

Type

ToBy

The 1-based occurrence of the closing anchor.

public uint ToBy { get; }

Property Value

uint

ToMember

The member name of the closing anchor.

public string? ToMember { get; }

Property Value

string

ToType

The declaring type of the closing anchor.

public Type? ToType { get; }

Property Value

Type