Besides how the specified functionality should be implemented, consider using asynchronous method calls if you want to be able to call a method and continue execution without waiting for it to return and be automatically notified when it does.
You can call every .NET method asynchronously by simply defining a delegate of the same signature as the method that is to be called asynchronously. After instantiating the delegate, you'll notice that for each method of your class, there's a pair of methods BeginXXX and EndXXX, where XXX is the name of the methods. These methods are used to asynchronously invoke and end the XXX method. When an asynchronous method call returns, you will be notified by means of a specified callback method.
Of course this is rather superficial discussion. I just wanted to point you to the right direction. Plz see the .NET documentation to learn how to implement this functionality.
Regards,
ejan
|