I use a library that has an asynchronous method called DoWork(...) that will raise a WorkDone event when the operation completes.
I would like to write a method that
You can use TaskCompletionSource:
public async Task SomeMethod() { var result = new TaskCompletionSource(); library.WorkDone += (data) => { result.SetResult(data); }; library.DoWork(); return await result.Task; }