private void UpdateServerInfo() { try { var pushService = new PushServiceClient(); pushService.GetServerInfoCompleted += (s1, e1) => { try { pushService.CloseAsync(); if (e1.Result != null) { Dispatcher.BeginInvoke(() => { PushPattern = e1.Result.PushPattern; Counter = e1.Result.Counter; }); } } catch (Exception ex) { ex.Show(); } }; pushService.GetServerInfoAsync(); } catch (Exception ex) { ex.Show(); } }
private void RegisterClient(Uri channelUri) { // Register the URI with 3rd party web service. try { var pushService = new PushServiceClient(); pushService.RegisterCompleted += (s, e) => { pushService.CloseAsync(); Completed(e.Error); }; pushService.RegisterAsync(UserName, channelUri); } catch (Exception ex) { Completed(ex); } }
private void ButtonTestNow_Click(object sender, RoutedEventArgs e) { try { var pushService = new PushServiceClient(); pushService.UpdateTileCompleted += (s1, e1) => { try { pushService.CloseAsync(); } catch (Exception ex) { ex.Show(); } }; pushService.UpdateTileAsync(PushContext.Current.NotificationChannel.ChannelUri, SelectedServerImage); } catch (Exception ex) { ex.Show(); } }