private void RemoveClient(Package e) { Client client = GetClientByConnectionContext(e.ClientContext); if(client != null) { OnClientLeftEvent(this, new ClientLeftEventArgs(client.Id)); Action action = () => { if (Clients.Contains(client)) { Clients.Remove(client); } }; if (App.Current != null && App.Current.Dispatcher != null) { App.Current.Dispatcher.BeginInvoke(action); } } }
private void NewOrder(Package e) { Client client = GetClientByConnectionContext(e.ClientContext); if (client != null) { OnNewOrderEvent(this, new NewOrderEventArgs(client.Id, e.AuthenticationCode, e.NewOrder)); } }
private void AckTimeUpdate(Package e) { Client client = GetClientByConnectionContext(e.ClientContext); if(client != null) { OnCurrentTimeAckEvent(this,new BasicAuthAckEventArgs(client.Id,e.AuthenticationCode)); } }
protected void OnPackageReceived(object sender,Package e) { if(NewPackageReceived != null) { NewPackageReceived(sender, e); } }