Created
September 18, 2013 14:23
-
-
Save daanl/6609916 to your computer and use it in GitHub Desktop.
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
class Program | |
{ | |
public static List<string> ScreenInformation = new List<string> | |
{ | |
"hi", | |
"oi", | |
"whats", | |
"up" | |
}; | |
static void Main(string[] args) | |
{ | |
var task = LoadRecordScreenAsync(); | |
task.Wait(); | |
var result = task.Result; | |
} | |
private static async Task<IEnumerable<ScreenViewModel>> LoadRecordScreenAsync() | |
{ | |
List<ScreenViewModel> screens = new List<ScreenViewModel>(); | |
foreach (var info in ScreenInformation) | |
{ | |
ScreenViewModel vm = await GetScreenViewModelAsync(info); | |
screens.Add(vm); | |
} | |
return screens; | |
} | |
public static Task<ScreenViewModel> GetScreenViewModelAsync(string screenInfo) | |
{ | |
return Task<ScreenViewModel>.Factory.StartNew(() => | |
{ | |
return new ScreenViewModel(); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment