Reputation: 1093
I have a change tracking framework that tracks changed made to domain objects on the client. It uses Castle.Windsor as the tool for creating proxy objects. After I changed Castle to version 3.0 calls of properties inside methods that are not intercepted are not forwarded to the target object anymore.
sequence diagram http://www.pictureupload.de/originals/pictures/200312135214_ct.png
ChangeTracker is a class of my own that handles the tracking of the changed made to the inner object.
A custom ProxyGenerationHook is used, which worked correctly with Castle 2.5:
private sealed class ProxyGenerationHook : IProxyGenerationHook
{
public void MethodsInspected()
{ }
public void NonProxyableMemberNotification(Type type, MemberInfo memberInfo)
{ }
public bool ShouldInterceptMethod(Type type, MethodInfo methodInfo)
{
if (methodInfo == null)
{
throw ExceptionBuilder.ArgumentNull("methodInfo");
}
string methodName = methodInfo.Name;
bool result = methodName.StartsWith("set_", StringComparison.OrdinalIgnoreCase) ||
methodName.StartsWith("get_", StringComparison.OrdinalIgnoreCase);
return result;
}
}
This is the domain class used:
public class Person
{
public virtual int Id { set; get; }
public virtual string Name { set; get; }
protected virtual int Age { set; get; }
public void SetAgeTo(int value)
{
Age = value;
}
}
Is this now the intended behaviour or is this a bug of Castle 3.0?
Upvotes: 2
Views: 229
Reputation: 27374
This is a regression bug. It will be fixed in version 3.1
Upvotes: 2