Make feed read on error dialog async and preserve selection

This commit is contained in:
2015-11-16 11:05:55 -05:00
parent 040147cb4a
commit 9a73709c7f
2 changed files with 18 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace FeedCenter
{
@@ -93,6 +94,11 @@ namespace FeedCenter
return result;
}
public async Task<FeedReadResult> ReadAsync(FeedCenterEntities database, bool forceRead = false)
{
return await Task.Run(() => Read(database, forceRead));
}
private Tuple<FeedReadResult, string> RetrieveFeed()
{
try
@@ -320,7 +326,7 @@ namespace FeedCenter
var lastReadResult = LastReadResult;
// Build the name of the resource using the enum name and the value
var resourceName = $"{typeof (FeedReadResult).Name}_{lastReadResult}";
var resourceName = $"{typeof(FeedReadResult).Name}_{lastReadResult}";
// Try to get the value from the resources
var resourceValue = Properties.Resources.ResourceManager.GetString(resourceName);