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