PJ6,
Unfortunately AddressOf only works on Subs & Functions not properties.
As Cor suggests, I too wonder what specifically you are doing that requires
the use of the underlying delegates.
If your design truely needs the delegates & using a string to retrieve them
is undesirable. Have you considered a design that uses a Get function & a
Set sub instead?
In other words, instead of:
Public Property Name As String
...
Use:
Public Function GetName() As String
...
Public Sub SetName(value As String)
...
Alternatively I would consider a design that each "property" was actually an
object instead, then instead of relying on delegates to the "properties"
method, I would use simply pass the "property" object instead. I would
consider using Generics to define the "property" object...
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"PJ6" <no***@nowhere.net> wrote in message
news:Om**************@TK2MSFTNGP05.phx.gbl...
|I would like to refer to properties in code without having to resort to
| using a string for the name. AddessOf gives me this ability for methods,
but
| I can't find a single way to point that at the Get or Set methods of
| properties directly.
|
| Why don't I want to use a string? Well, I want to know at design time that
| my property references aren't broken, much the same way I can have this
when
| using regular delegates.
|
| Is this possible?
|
| Paul
|
|