Reviewing the Binder Class

The Binder class is an abstract class that you must inherit from to use. Binders are used to perform type conversions. The InvokeMember method of Type objects can accept a Binder object that describes how to perform type conversions between the types of arguments passed to InvokeMember and the actual types needed by the member being invoked.

To create a binder you will need to inherit from System.Reflection.Binder and override BindToMethod, BindToField, SelectMethod, SelectProperty, and ChangeType.

TIP

The System.Type class has a DefaultBinder property you can use if you need a binder but don't need special binding behavior.

In addition to being used to bind methods for dynamically invoking members, binders are used ...

Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.