c# - Castle.DynamicProxy2 and Adding a Property at Run Time -


I am using Castle.DynamicProxy2 and I am immediately converting my proxy:

  Private Static T Generate Process () {ARE LIST addtlInterfaces = new array list (); AddtlInterfaces.Add (type (INotifyPropertyChanged)); AddtlInterfaces.Add (EntityStatus); Object Entity Proxy Generator. Secret Class Proxy (Typef (T), Adult Interface .Ore (Type) Type [], ProxyGenction Option Default, New Inteceptor [] {New Leggie Interceptor ()}); Return (t) unit proxy; }  

My interface of IEntityStatus looks like this:

  Public Interface IEtityStatus {bool IsDirty {get; Set up;}}  

I need to be able to use that property during runtime so that when an asset has been changed in my DTO, then the event will make DTO dirty Can be set for. However, because it is an interface and it has no clear implementation, how can I harm it. Is there an option to get a set and method for the set method that I would like to save, can I gain another way of achieving it?

I know that I can establish a collection of all my active DTOs and when I have a property fire on one of the DTOs, I can update it to show the collection that this special DTO is dirty, but I would really like to be a part of the proxy DTO for ease of pure syntax for this information.

Look at the reactions!

I do not know how you handle INotifyPropertyChanged but I used the mixin for both interfaces. I subscribe to anyone else's event. Is this a viable solution?


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -