Ejemplo n.º 1
0
 // Connections
 public void SendTag(string id, Tags.Tag tag)
 {
     if (_backendRuntime._connections != null)
     {
         _backendRuntime._connections.Send(id, tag);
     }
 }
Ejemplo n.º 2
0
        public bool Send(Tags.Tag tag)
        {
            if (_XMPP.Connected)
            {
                _XMPP.Send(tag);
                return(true);
            }

            PushEvent(ErrorType.NotConnected, ErrorPolicyType.Informative);
            return(false);
        }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 6
0
 private void PushEvent(Tags.Tag tag)
 {
     PushEvent(new BackendEventMessage(Id, tag));
 }
Ejemplo n.º 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;
 }