Created
May 26, 2011 06:45
-
-
Save HEskandari/992665 to your computer and use it in GitHub Desktop.
Abstracted Async model in Silverlight 4.0
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> LoadLookupCache() | |
{ | |
yield return ProgressResult.Show("Loading Cache..."); | |
var masterDataService = new MasterDataServiceClient(); | |
var therapyService = new TherapyServiceClient(); | |
masterDataService.getAllHealthFundsCompleted += (o, e) => _serviceHandler.AddTo(e, _lookups.HealthFunds); | |
masterDataService.getAllPatientCompleted += (o, e) => _serviceHandler.AddTo(e, _lookups.Patients); | |
therapyService.getTherapyTypesCompleted += (o, e) => _serviceHandler.AddTo(e, _lookups.TherapyTemplateTypes).Apply(x => x.Type = TemplateTypes.Therapy); | |
yield return new ServiceResult(masterDataService.getAllHealthFundsAsync); | |
yield return new ServiceResult(masterDataService.getAllPatientAsync); | |
yield return new ServiceResult(therapyService.getTherapyTypesAsync); | |
yield return ProgressResult.Hide(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment