Say we have some code like this:
public class FeatureAnalysis
{
private float errorLevel;
public float ErrorLevel
{
get { return errorLevel; }
set
{
this.errorLevel = value;
// Something here?
}
}
public int MeasurementTime { get; set; }
}
public class TestStep
{
public FeatureAnalysis FeatureAnalysis { get; set; }
}
public class Test
{
public TestStep TestStep { get; set; }
}
Suppose we have another class that has a member of type Test. I know it is possible to get the value from ErrorLevel
using a string like this "TestStep.FeatureAnalysis.ErrorLevel". (I call it the propertypath, don't know if this is the correct term though). The problem I'm facing seems to require to build this string somehow.
We would like to log changes to every property that is somehow under the Test class, or its members, or its members, ... So the path should go up to Test and no further. I'm also thinking of situations where we have "TestStep.FeatureAnalysis[0].ErrorLevel"
I'm hoping that we don't have to pass the 'parent path' all over.
Alternative ideas are more than welcome.
Aucun commentaire:
Enregistrer un commentaire