i have a method with the following signature that belongs to a class.
public virtual IAsyncResult DoSomething(CustomOptions options);
I am trying to figure out how exactly do i call the callback.I cannot find anywhere the event on which to give a callback method.
To understand how to use IAsyncResult, you should understand where it would be use. It's normally used for asynchronous call. The most common usage is delegate asynchronous call. In that case, IAsyncResult is a receipt, it is used as an "Infomation carrier", and provides a synchronization object in order to abort the thread when asynchronous operation completes.
Usually you don't need to create an IAsyncResult. IAsyncResult is just a way to implement receipt function. You may not make it so complicated. Just transmit a simple struct to carry infomations you need.
like:
Of course, I did not consider synchronization. But .NET Framework has taken into it. So determine the contents of receipt according to your needs, not need to use IAsyncResult.
See:
Calling Synchronous Methods Asynchronously
IAsyncResult Interface