Open GoogleCodeExporter opened 9 years ago
Hi Stefan,
Although I couldn't find a way to directly make the interface properties
visible in
the test, here is a simple workaround that you can use if you're working with
interface properties:
var proxyFactory = new ProxyFactory();
var wrapper = new InvokeWrapper();
var customer = proxyFactory.CreateProxy<ICustomer>(wrapper,
typeof(INotifyPropertyChanged));
BindingFlags flags = BindingFlags.Public | BindingFlags.Instance;
Type proxyType = customer.GetType();
var typeProperties = proxyType.GetProperties();
var allProperties = (from currentInterface in proxyType.GetInterfaces()
from property in currentInterface.GetProperties()
select property).ToList();
allProperties.AddRange(typeProperties);
// Do something with the interface properties here...
Original comment by Philip.L...@gmail.com
on 22 Mar 2010 at 9:23
Hi Philip,
thanks for the suggested workaround!
The problem is, I'm not the one who consumes the proxies. It is WPF when I
databind the objects ;-) WPF does not
look into all interfaces, obviously.
I have found another sort of workaround: with Castle DynamicProxy it works. I
don't know how they implement it of
course.
Regards
Stefan Lieser
Original comment by stefan.l...@googlemail.com
on 24 Mar 2010 at 8:13
Original issue reported on code.google.com by
stefan.l...@googlemail.com
on 22 Mar 2010 at 5:05Attachments: