Exemple #1
0
        public static void DisableNotification()
        {
            _channel = null;
            var ns = new NotificationServiceClient();

            ns.UnregisterEndpointAsync(_username);
        }
Exemple #2
0
        public static void EnableNotifications(string username)
        {
            _username = username;
            if (_channel != null)
            {
                return;
            }

            _channel = HttpNotificationChannel.Find(CHANNEL);

            if (_channel == null)
            {
                _channel = new HttpNotificationChannel(CHANNEL);
                WireChannel(_channel);
                _channel.Open();
            }
            else
            {
                WireChannel(_channel);
            }

            if (!_channel.IsShellToastBound)
            {
                _channel.BindToShellToast();
            }

            if (_channel.ChannelUri != null)
            {
                var ns = new NotificationServiceClient();
                ns.RegisterEndpointAsync(username, _channel.ChannelUri.ToString());
            }
        }
Exemple #3
0
        private static void ChannelUpdated(object sender, NotificationChannelUriEventArgs args)
        {
            var ns = new NotificationServiceClient();

            ns.RegisterEndpointAsync(_username, args.ChannelUri.ToString());
        }