I have an event delegate that is defined as follows:
public delegate void CallbackDelegate(Data data);
public event CallbackDelegate OnDataComplete;
I raise the event asynchronously:
// Raise the OnDataComplete event
OnDataComplete.BeginInvoke(new Data(), null, null);
Subsequently, the signature of BeginInvoke
looks like:
IAsyncResult CallbackDelegate.BeginInvoke(Data data, AsyncCallback callback, object @object)
In most examples I've seen BeginInvoke
is called with the @object
parameter being null
, but I can't find the documentation which explains what is the purpose of that parameter.
So what is the purpose of that parameter? What can we use it for?