What is the purpose of `AsyncCallback` and `@object` in regards to delegates in .Net
.net, asynchronous, c#, delegates
Solution
`AsyncCallback` is a delegate type that acts as a callback function.
If you pass a function as this parameter, .Net will call your callback after the delegate finishes executing asynchronously.
The second parameter allows you to pass state to the AsyncCallback so that your callback function can know what it's coming from.
Problem
I know that in C# (and VB.Net) I can create a delegate, point this at a method and then use this delegate to run my method either synchronously or asynchronously. I know how to do this. Sometimes I use a delegate to run a method asynchronously, and sometimes these methods have input parameters. To run my method asynchronously I call the delegates `BeginInvoke` method, providing my input parameters, followed by "null, null". I supply "null, null" as the final two parameters although Visual Studio's intellisense is suggesting I instead supply an `AsyncCallback` object named callback followed by a second object simply named `@object` as shown below. What is an `AsyncCallback` and how is it used, and what is the purpose of the other object named `@object` suggested by intellisense? Thanks