avidgoffer
08-10-2007, 07:00 PM
Hello everybody,
I am working with a proxy that tells me if my class has been modified or not and am having trouble with the Equals method. I have a collection that when I call Add does the following:
public IDriver Add()
{
IDriver result = new Driver(this);
ProxyFactoryObject pf = new ProxyFactoryObject();
pf.Target = result;
pf.AddAdvisor(new ModificationAdvisor(result.GetType()));
pf.AddIntroduction(new IsModifiedAdvisor());
pf.ProxyTargetType = false;
return (IDriver)List[List.Add(pf.GetObject())];
}
In the next code when I call Equals it skips the call to Debug.WriteLine.
IDriver driver = Drivers.Add();
if (driver.Equals(driver))
{
Debug.WriteLine("driver = driver")
}
Can anyone help with this?
thanks
Aaron
I am working with a proxy that tells me if my class has been modified or not and am having trouble with the Equals method. I have a collection that when I call Add does the following:
public IDriver Add()
{
IDriver result = new Driver(this);
ProxyFactoryObject pf = new ProxyFactoryObject();
pf.Target = result;
pf.AddAdvisor(new ModificationAdvisor(result.GetType()));
pf.AddIntroduction(new IsModifiedAdvisor());
pf.ProxyTargetType = false;
return (IDriver)List[List.Add(pf.GetObject())];
}
In the next code when I call Equals it skips the call to Debug.WriteLine.
IDriver driver = Drivers.Add();
if (driver.Equals(driver))
{
Debug.WriteLine("driver = driver")
}
Can anyone help with this?
thanks
Aaron