Task <List <CharacterExpression> > LoadCharacterExpressions(string characterDirectoryPath) { return(new Task <List <CharacterExpression> >(() => { var characterExpressions = new List <CharacterExpression>(); var characterName = Path.GetFileNameWithoutExtension(characterDirectoryPath); var expressionFiles = Directory.GetFiles(characterDirectoryPath); foreach (var expressionFile in expressionFiles) { var expressionName = Path.GetFileNameWithoutExtension(expressionFile); try { var expressionBitmap = ImageLoader.CreateCroppedBitmapFromFile(expressionFile); characterExpressions.Add(new CharacterExpression(characterName, expressionName, expressionBitmap)); } catch (Exception) { } } return characterExpressions; })); }