Created
September 29, 2011 19:50
-
-
Save HEskandari/1251743 to your computer and use it in GitHub Desktop.
Async Abstraction Usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IEnumerable<IResult> LoadReport(int reportId) | |
{ | |
yield return Display.Busy(); | |
var service = new ReportingServiceClient(); | |
yield return Display.ChangeStatus("Preparing Reports..."); | |
yield return new WebServiceResult().Invoke(service.PrepareReports); | |
ReportInfo report = null; | |
yield return new WebServiceResult().InvokeWithParam(service.GetReportInfoAsync, reportId).WhenCompleted(result => result.ResultAs<ReportInfo>()); | |
yield return new ActionResult(() => DisplayReport(report)); | |
yield return Display.NotBusy(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment