Skip to content

Instantly share code, notes, and snippets.

@coldacid
Created April 7, 2012 20:46
Show Gist options
  • Save coldacid/2332024 to your computer and use it in GitHub Desktop.
Save coldacid/2332024 to your computer and use it in GitHub Desktop.
Generic AsyncCompletedEventArgs class for simple EAP async return values
namespace System.ComponentModel
{
public class AsyncCompletedEventArgs<T> : AsyncCompletedEventArgs
{
private T result;
public AsyncCompletedEventArgs(Exception error, bool cancelled, object userState)
: base(error, cancelled, userState)
{ }
public AsyncCompletedEventArgs(T result, object userState)
: base(null, false, userState)
{
this.result = result;
}
public T Result
{
get { return result; }
}
}
}
@coldacid
Copy link
Author

Update: forgot that having the result constructor on its own would hide the base constructor. That problem's been fixed with this newer version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment