// Connections public void SendTag(string id, Tags.Tag tag) { if (_backendRuntime._connections != null) { _backendRuntime._connections.Send(id, tag); } }
public bool Send(Tags.Tag tag) { if (_XMPP.Connected) { _XMPP.Send(tag); return(true); } PushEvent(ErrorType.NotConnected, ErrorPolicyType.Informative); return(false); }
public BackendEventMessage(string id, Tags.Tag tag, string uuid = "") : base(id, EventType.Message) { Tag = tag; if (uuid == "") { UUID = Guid.NewGuid().ToString(); } else { UUID = uuid; } }
public bool Send(string id, Tags.Tag tag) { Connection connection = _connectionList[id]; if (connection != null) { connection.Send(tag); return(true); } else { return(false); } }
//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)); }
private void PushEvent(Tags.Tag tag) { PushEvent(new BackendEventMessage(Id, tag)); }
public BackendEventMessage(string id, Tags.Tag tag, string uuid = "") : base(id, EventType.Message) { Tag = tag; if (uuid == "") UUID = Guid.NewGuid().ToString(); else UUID = uuid; }