public void CreateErrorNotification(Exception exception)
{
if (_scheduler == null)
return;
Task.Factory.StartNew(() =>
{
if (exception is System.Net.WebException)
{
ToastPrompt toast = new ToastPrompt();
toast.Title = "Baconography";
toast.Message = "We're having a hard time connecting to reddit";
toast.ImageSource = new BitmapImage(new Uri("Assets\\ApplicationIconSmall.png", UriKind.RelativeOrAbsolute));
toast.TextWrapping = System.Windows.TextWrapping.Wrap;
toast.Show();
Messenger.Default.Send<ConnectionStatusMessage>(new ConnectionStatusMessage { IsOnline = false, UserInitiated = false });
}
else if (exception.Message == "NotFound")
{
CreateNotification("There doesnt seem to be anything here");
}
else
{
ToastPrompt toast = new ToastPrompt();
toast.Title = "Baconography";
toast.Message = "We're having a hard time connecting to reddit, you might want to try again later";
toast.ImageSource = new BitmapImage(new Uri("Assets\\ApplicationIconSmall.png", UriKind.RelativeOrAbsolute));
toast.TextWrapping = System.Windows.TextWrapping.Wrap;
toast.Show();
}
}, System.Threading.CancellationToken.None, TaskCreationOptions.None, _scheduler);
}