Creating Extender Providers

Extender Providers are created by implementing the IExtenderProvider interface. This interface has only a single method: bool CanExtend( object target ). This method is used to determine whether the provider can extend the target object. Generally, Extender Providers are designed to work only with specific types of components as in the case of the ToolTip Extender Provider. The ToolTip will only add the ToolTip property to Control-derived objects and will not extend MenuItems.

Adding properties to objects being extended is twofold. First the Extender Provider must use the ProvideProperty attribute. This attribute is applied to the Extender Provider class. Listing A.1 shows an example based on the ToolTip extender provider. ...

Get .NET Windows® Forms Custom Controls 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.