[damn, i pressed the wrong button, maybe double posting]
Then do it in the setter of the property and only when needed. so:
Code:
private bool isPropertyXProxy = true;
public int PropertyX
{
get {return propertyX; } // nice and fast
set { if(isPropertyXProxy) // check if it is still so
{
isPropertyXProxy = this.gettype().equals(typeof(myClass));
}
propertyX = value;
}
This way, once the property is set to be not a proxy, you loose the reflection hit.
Now you can change the getter to do:
if(!isPropertyXProxy)
ValidateTheHellOutOfMe();
Let me know if this solution would make you happy.
You can also store the booleans in a list, if you don't like all the loose boolean-fields.
Code: