Another solution:
Try Type.GetProperties() to retrieve all properties for a class and iterate
to find your property.
myPropertyInfo = Type.GetType("someClass").GetProperties();
for(int i=0;i<myPropertyInfo.Length;i++)
{
PropertyInfo myPropInfo = (PropertyInfo)myPropertyInfo[i];
Console.WriteLine("The property name is {0}.",
myPropInfo.Name);
Console.WriteLine("The property type is {0}.",
myPropInfo.PropertyType);
}
I hope it helps.
Lionel.
"Jon Skeet [C# MVP]" <sk***@pobox.com> a écrit dans le message de news:
MP***********************@msnews.microsoft.com...
tolisss <no****@devdex.com> wrote: Hi is it possible to get a property name like
someMethod(someClass.SomeProperty)=="SomeProperty"
No. someClass.SomeProperty would always be treated as an expression,
and evaluated rather than treated just as a name.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too