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