private async void Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { rootPage.NotifyUser("Connection Error Occured: " + args.Message, NotifyType.ErrorMessage); }); }
private async void Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { // handle CastingConnectionErrorStatus }); }
private async void Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) { if (args.ErrorStatus != CastingConnectionErrorStatus.Succeeded) { try { sender.StateChanged -= Connection_StateChanged; sender.ErrorOccurred -= Connection_ErrorOccurred; } catch (Exception) { //We already unhooked. } await sender.DisconnectAsync(); sender.Dispose(); MediaCastingConnection = null; //IsPlaying = false; //ShutdownPreviousPlaybackSession(); await NepApp.UI.ShowInfoDialogAsync("Uh-Oh!", "An error occurred while casting: " + args.Message); if (!await App.GetIfPrimaryWindowVisibleAsync()) { var currentStation = await NepApp.Stations.GetStationByNameAsync(CurrentStream.ParentStation); NepApp.UI.Notifier.ShowErrorToastNotification(currentStation, "Uh-Oh!", "An error occurred while casting: " + args.Message); } } }
// </SnippetStateChanged> // <SnippetErrorOccurred> private async void Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { //Clear the selection in the listbox on an error ShowMessageToUser("Casting Error: " + args.Message); castingDevicesListBox.SelectedItem = null; }); }
private async void Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { rootPage.NotifyUser("Casting Error Occured: " + args.Message, NotifyType.ErrorMessage); disconnectButton.IsEnabled = false; activeDevice = null; activeCastConnectionHandler = null; }); }
private async void OnCastingError(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { LoadingBar.Visibility = Visibility.Collapsed; LoadingPane.Visibility = Visibility.Visible; LoadingTitle.Text = "Error"; LoadingText.Text = args.Message; LoadingCancelButton.Visibility = Visibility.Visible; LoadingCancelButton.Content = "Close"; }); }
private async void Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { rootPage.NotifyUser("Casting Error Occured: " + args.Message, NotifyType.ErrorMessage); }); }
private async void Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { //Clear the selection in the listbox on an error rootPage.NotifyUser("Casting Error: " + args.Message, NotifyType.ErrorMessage); castingDevicesList.SelectedItem = null; }); }
private void Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) { MainPage.Current.PopMessage($"Casting Error: {args.ErrorStatus.ToString()}\r\n{args.Message}"); }
private async void Connection_ErrorOccurred(CastingConnection sender, CastingConnectionErrorOccurredEventArgs args) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { // handle CastingConnectionErrorStatus }); }