Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo n.º 5
0
        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);
            }
        }