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.
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.