Пример #1
0
 // Connections
 public void SendTag(string id, Tags.Tag tag)
 {
     if (_backendRuntime._connections != null)
     {
         _backendRuntime._connections.Send(id, tag);
     }
 }
Пример #2
0
        public bool Send(Tags.Tag tag)
        {
            if (_XMPP.Connected)
            {
                _XMPP.Send(tag);
                return(true);
            }

            PushEvent(ErrorType.NotConnected, ErrorPolicyType.Informative);
            return(false);
        }
Пример #3
0
 public BackendEventMessage(string id, Tags.Tag tag, string uuid = "") : base(id, EventType.Message)
 {
     Tag = tag;
     if (uuid == "")
     {
         UUID = Guid.NewGuid().ToString();
     }
     else
     {
         UUID = uuid;
     }
 }
Пример #4
0
        public bool Send(string id, Tags.Tag tag)
        {
            Connection connection = _connectionList[id];

            if (connection != null)
            {
                connection.Send(tag);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #5
0
        //public void OnBackgroundTaskCanceled(IBackgroundTaskInstance instance, string name, BackgroundTaskCancellationReason reason)
        //{
        //    var canceled = true;
        //    var strreason = reason.ToString();
        //    switch (name)
        //    {
        //        case "ControlChannelReset": PushEvent(WindowsType.ControlChannelReset, canceled, strreason); break;
        //        case "InternetAvailable": PushEvent(WindowsType.InternetAvailable, canceled, strreason); break;
        //        case "InternetNotAvailable": PushEvent(WindowsType.InternetNotAvailable, canceled, strreason); break;
        //        case "ServicingComplete": PushEvent(WindowsType.ServicingComplete, canceled, strreason); break;
        //        case "SessionConnected": PushEvent(WindowsType.SessionConnected, canceled, strreason); break;
        //        case "UserAway": PushEvent(WindowsType.UserAway, canceled, strreason); break;
        //        case "UserPresent": PushEvent(WindowsType.UserPresent, canceled, strreason); break;
        //        case "LockScreenApplicationAdded": PushEvent(WindowsType.LockScreenApplicationAdded, canceled, strreason); break;
        //        case "LockScreenApplicationRemoved": PushEvent(WindowsType.LockScreenApplicationRemoved, canceled, strreason); break;
        //        case "TimeZoneChange": PushEvent(WindowsType.TimeZoneChange, canceled, strreason); break;
        //    }
        //}

        #endregion

        #region helper

        private void PushEvent(Tags.Tag tag)
        {
            OnEvent(new BackendEventMessage("", tag));
        }
Пример #6
0
 private void PushEvent(Tags.Tag tag)
 {
     PushEvent(new BackendEventMessage(Id, tag));
 }
Пример #7
0
 public BackendEventMessage(string id, Tags.Tag tag, string uuid = "") : base(id, EventType.Message) 
 { 
     Tag = tag;
     if (uuid == "")
         UUID = Guid.NewGuid().ToString();
     else
         UUID = uuid;
 }