I think I've been waiting for this day.
I have the name of a public property stored to a private field. I want to obtain the value stored in the public property. How can I evaluate the contents of the private field to query the correct public property?
Here's an example of what I'm trying to do:
public class Class1
{
private string Property_Name = "MyValue";
public string MyValue
{
get
{
return "Radiohead"
}
}
public void ShowPropertyValue()
{
Console.WriteLine("The value of {0} is {1}",
this.Property_Name,
<<WHAT GOES HERE??>>);
}
}
Note the "WHAT GOES HERE??" in the ShowPropertyValue() method.
Note too that I'm going to need to *reverse* this operation - store a new value to the specified property.
Thanks.
>>-Steve->>
Steve Sawyer
Geeks and Gurus, Inc.