Friday, April 29, 2011

How do i add a IDisposable + delegate obj to an existing class

I'm told what i want to do is impossible. What i want to do is extend a class so it has an IDisposable obj which will call a delegate obj. The new class should work exactly like the base class (obj.BaseMethod() i dont want to do obj.theobj.BaseMethod()). Basically all i will be getting is the manager will know if an object that it has given a thread is out of scope or not in use anymore. How can i do this? (refer to this thread on what i am trying to do http://stackoverflow.com/questions/748591/how-should-i-track-objs-in-use-c)

From stackoverflow
  • You could use AOP for this, such as Spring.NET, and just add the IDisposable interface and the necessary functions to your class.

0 comments:

Post a Comment