Custom Dynamic Objects with DynamicObject
So far, we haven’t had a chance to control any of the binding logic that happens at runtime when invoking dynamic operations on an object. The flexible infrastructure of the DLR provides a way to create objects that participate in those operations. To achieve this, the simplest route is the use of
System.Dynamic.DynamicObject, which is defined as shown in Figure 22.17.
As you can see, this base class contains
Try methods for every dynamic operation that’s supported by the DLR. The
Binder objects passed as the first argument correspond ...