Is there a way to refer to a property name with a variable?
Scenario: Object A have public integer property X an Z, so...
public void setProperty(in
It's hard for me to understand what you're trying to achieve... if you're trying to determine the property and value separately, and at different times, you can wrap the act of setting the property inside a delegate.
public void setProperty(int index, int value)
{
Action setValue;
if (index == 1)
{
// set property X
setValue = x => A.X = x;
}
else
{
// set property Z
setValue = z => A.Z = z;
}
setValue(value);
}