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
targetobjectThe 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
targetTThe 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
binderGetIndexBinderThe binder.
indexesobject[]The indexes.
resultobjectThe result.
Returns
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
binderGetMemberBinderProvides 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.
resultobjectThe 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
binderInvokeMemberBinderThe binder.
argsobject[]The args.
resultobjectThe result.
Returns
TrySetIndex(SetIndexBinder, object?[]?, object?)
Tries the index of the set.
public override bool TrySetIndex(SetIndexBinder binder, object?[]? indexes, object? value)
Parameters
binderSetIndexBinderThe binder.
indexesobject[]The indexes.
valueobjectThe value.
Returns
TrySetMember(SetMemberBinder, object?)
Tries the set member.
public override bool TrySetMember(SetMemberBinder binder, object? value)
Parameters
binderSetMemberBinderThe binder.
valueobjectThe value.