Ejemplo n.º 1
0
        private object ProcessRequest(object res, object state)
        {
            var message = utility.DeserializeFromObject <NotificationMessage>(res);

            if (message == null)
            {
                return(null);
            }

            iconState = (message.TurnOn) ? IconState.On : IconState.Off;

            if (iconState == IconState.On)
            {
                ni.Icon = onIcon;

                var title = message.WindowsNotification.Title;
                var text  = message.WindowsNotification.Text;

                windowsNotificationService.ShowNotification(title, text);
            }
            else
            {
                ni.Icon = offIcon;
            }

            return(null);
        }
Ejemplo n.º 2
0
        private PingResponse HandlePing(object res, object state)
        {
            var pingReq = utility.DeserializeFromObject <PingRequest>(res);

            if (pingReq == null)
            {
                return(null);
            }

            var pingResponse = new PingResponse
            {
                Address = networkService.GetIpString(),
            };

            return(pingResponse);
        }