My current method of making a call to WCF is the bog standard event, async style (for example)
foo.EventArgs += Foo_EventArgsCompleted
foo.EventArgsAsync(params...)
this works fine, but is hideously slow sometimes and is also cumbersome as you then need another method to deal with the results.
Is there a way to code this closer to the way it’s done on Win8?
private async foo<bool>()
{
try
{
await foo.EventArgsAsync(params...)
}
catch
{
// catch here
}
// deal with the code back
return true;
}
Thanks
Paul
You can write your own
*TaskAsyncextension methods.If your proxy has
*Begin/*Endmethods, you can useTaskFactory.FromAsync:Otherwise, you have to use
TaskCompletionSource: