Table of Contents

Class Recorder

Namespace
Dynamitey.DynamicObjects
Assembly
Dynamitey.Community.dll

Proxy that Records Dynamic Invocations on an object

public class Recorder : BaseForwarder, IDynamicMetaObjectProvider, IEquivalentType, IForwarder
Inheritance
Recorder
Implements
Inherited Members

Constructors

Recorder()

Initializes a new instance of the Recorder class.

[RequiresDynamicCode("Constructing any BaseForwarder-derived type (and the Dummy target) instantiates System.Dynamic.DynamicObject, whose default constructor requires the DLR's runtime code generation; not supported when AOT-compiled.")]
public Recorder()

Recorder(object)

Initializes a new instance of the Recorder class.

[RequiresDynamicCode("Constructing any BaseForwarder-derived type instantiates System.Dynamic.DynamicObject, whose default constructor requires the DLR's runtime code generation; not supported when AOT-compiled.")]
public Recorder(object target)

Parameters

target object

The target.

Properties

Recording

Gets or sets the recording.

public IList<Invocation> Recording { get; protected set; }

Property Value

IList<Invocation>

The recording.

Methods

ReplayOn<T>(T)

Replays the recording on target.

[RequiresUnreferencedCode("Calls the annotated Invocation.InvokeWithStoredArgs, which resolves a member via the DLR binder; trimming can remove the member being resolved.")]
[RequiresDynamicCode("Invocation.InvokeWithStoredArgs requires the DLR's runtime code generation; not supported when AOT-compiled.")]
public T ReplayOn<T>(T target)

Parameters

target T

The target.

Returns

T

Type Parameters

T

TryGetIndex(GetIndexBinder, object?[]?, out object)

Tries the index of the get.

public override bool TryGetIndex(GetIndexBinder binder, object?[]? indexes, out object result)

Parameters

binder GetIndexBinder

The binder.

indexes object[]

The indexes.

result object

The result.

Returns

bool

TryGetMember(GetMemberBinder, out object?)

Provides the implementation for operations that get member values. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as getting a value for a property.

public override bool TryGetMember(GetMemberBinder binder, out object? result)

Parameters

binder GetMemberBinder

Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the DynamicObject class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive.

result object

The result of the get operation. For example, if the method is called for a property, you can assign the property value to result.

Returns

bool

true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.)

TryInvokeMember(InvokeMemberBinder, object?[]?, out object?)

Tries the invoke member.

public override bool TryInvokeMember(InvokeMemberBinder binder, object?[]? args, out object? result)

Parameters

binder InvokeMemberBinder

The binder.

args object[]

The args.

result object

The result.

Returns

bool

TrySetIndex(SetIndexBinder, object?[]?, object?)

Tries the index of the set.

public override bool TrySetIndex(SetIndexBinder binder, object?[]? indexes, object? value)

Parameters

binder SetIndexBinder

The binder.

indexes object[]

The indexes.

value object

The value.

Returns

bool

TrySetMember(SetMemberBinder, object?)

Tries the set member.

public override bool TrySetMember(SetMemberBinder binder, object? value)

Parameters

binder SetMemberBinder

The binder.

value object

The value.

Returns

bool