Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
 private void NewOrder(Package e)
 {
     Client client = GetClientByConnectionContext(e.ClientContext);
     if (client != null)
     {
         OnNewOrderEvent(this, new NewOrderEventArgs(client.Id, e.AuthenticationCode, e.NewOrder));
     }
 }
Exemplo n.º 3
0
 private void AckTimeUpdate(Package e)
 {
     Client client = GetClientByConnectionContext(e.ClientContext);
     if(client != null)
     {
         OnCurrentTimeAckEvent(this,new BasicAuthAckEventArgs(client.Id,e.AuthenticationCode));
     }
 }
Exemplo n.º 4
0
 protected void OnPackageReceived(object sender,Package e)
 {
     if(NewPackageReceived != null)
     {
         NewPackageReceived(sender, e);
     }
 }