IExtenderProvider - a curious query

P

Phill. W

[I think] I understand how to use the IExtenderProvider Interface
to add a "dynamic" property to a Control, but is there any
equivalent "mechanism" for using this extendability with just /any-old/
class, which might /not/ be a Control, something like:

Class Zebedee
Inherits SomethingThatIsNotAControl

.. . .

<ProvideProperty("X", GetType(Zebedee))> _
Class NewProperty

Function GetNewProperty( byval ctrl as Object ) as Integer
. . .
Sub SetNewProperty( byval ctrl as Object, byval Value as Integer)
. . .
End Class

For example, I /might/ want to create a wrapper class for, say, a
DataRow and allow some, all or none of the Items within it to be
mapped to a strongly typed properties, but controlled by the
Developer /using/ that class. Yes, they could just inherit from my
class and add the extra properties, but I'm curious if it can be done
using this Extender model.

So; how [or, indeed] can[?] I "plug" these two together at run-time?

TIA,
Phill W.
 
A

Atul

AFAIK, the classes that can be extended have to be inherited from Component.

----------------
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For .Net & ActiveX
Windows Explorer GUI Controls
&
Quick-Launch Like Appbars, MSN/Office2003 Style Popups,
System Tray Icons and Shortcuts/Internet Shortcuts
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top