TimSmithSK
Programmer
Given a class declaration such as:
public class MyClass
{
public System.String prop1 { get; set; }
public System.String prop2 { get; set; }
}
and code like:
MyClass c = new MyClass();
c.prop1 = "Value of property 1";
c.prop2 = "Value of property 2";
System.String s = "MyClass.prop1";
Is there a way to use the value of the string variable s to get the value of the MyClass.prop1 property - something along the lines of GetObject("MyClass").GetProperty("prop1") -- where the result would be the "Value of property 1".
Thanks
Tim
public class MyClass
{
public System.String prop1 { get; set; }
public System.String prop2 { get; set; }
}
and code like:
MyClass c = new MyClass();
c.prop1 = "Value of property 1";
c.prop2 = "Value of property 2";
System.String s = "MyClass.prop1";
Is there a way to use the value of the string variable s to get the value of the MyClass.prop1 property - something along the lines of GetObject("MyClass").GetProperty("prop1") -- where the result would be the "Value of property 1".
Thanks
Tim