Class Dummy
- Namespace
- Dynamitey.DynamicObjects
- Assembly
- Dynamitey.Community.dll
Dummy that just returns null or default for everything.
public class Dummy : BaseObject, IDynamicMetaObjectProvider, IEquivalentType
- Inheritance
-
Dummy
- Implements
- Inherited Members
Constructors
Dummy()
Initializes a new instance of the Dummy class.
[RequiresDynamicCode("Constructing any BaseObject-derived type instantiates System.Dynamic.DynamicObject, whose default constructor requires the DLR's runtime code generation; not supported when AOT-compiled.")]
public Dummy()
Methods
TryGetIndex(GetIndexBinder, object?[]?, out object)
Tries the index of the get.
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Calls the annotated MassageResultBasedOnInterface. This is a DynamicObject.TryGetIndex override: it can't carry [RequiresUnreferencedCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic indexer access already triggered the framework's warning.")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Same MassageResultBasedOnInterface call as above; see the IL2026 suppression on this member.")]
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.
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Calls the annotated MassageResultBasedOnInterface. This is a DynamicObject.TryGetMember override: it can't carry [RequiresUnreferencedCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic member access already triggered the framework's warning.")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Same MassageResultBasedOnInterface call as above; see the IL2026 suppression on this member.")]
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?)
Provides the implementation for operations that invoke a member. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as calling a method.
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Calls the annotated MassageResultBasedOnInterface. This is a DynamicObject.TryInvokeMember override: it can't carry [RequiresUnreferencedCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic call site already triggered the framework's warning.")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Same MassageResultBasedOnInterface call as above; see the IL2026 suppression on this member.")]
public override bool TryInvokeMember(InvokeMemberBinder binder, object?[]? args, out object? result)
Parameters
binderInvokeMemberBinderProvides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the DynamicObject class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive.
argsobject[]The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the DynamicObject class,
args[0] is equal to 100.resultobjectThe result of the member invocation.
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 language-specific run-time exception is thrown.)
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?)
Provides the implementation for operations that set member values. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as setting a value for a property.
public override bool TrySetMember(SetMemberBinder binder, object? value)
Parameters
binderSetMemberBinderProvides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned. For example, for the statement sampleObject.SampleProperty = "Test", 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.
valueobjectThe value to set to the member. For example, for sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the DynamicObject class, the
valueis "Test".
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 language-specific run-time exception is thrown.)