Peter,
You can't really. I mean, you seem to have a string representing the
property already (if you can type "phone" in the code, then you can create a
constant string called "phone" and use that). Other than that, there is no
intrinsic way (a la typeof) that you can use to get a property descriptor.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Peter" <pR****@procom-gmbh.com> wrote in message
news:c4**************************@posting.google.c om...
Hi
i have a class eg.
class Person
{
public string surname...
public string phone....
}
i know, its possible to get a propertydescriptor with the name
(string) or index (int)
o = new person()
propertydescriptor pd =TypeDescriptor.GetProperties(o)["phone"]
OK
but how can i get the propertydescriptor directly (without the name
oder index)
like " propertydescriptor pd = ....GetPropertyDescriptor(o.phone) "
thanks
Peter