Exemplo n.º 1
0
        private void HandleSendPackageRequest(SendPackageRequestArgs args)
        {
            AbonentType target = args.Target ?? _target;

            Send(target, args.Message);

            _eventAggregator.GetEvent <PackageTransmittedEvent>().Publish(new PackageTransmittedArgs(AbonentType.WebSocketTransceiver, target, args.Message));
        }
Exemplo n.º 2
0
        private void Send(AbonentType target, string message)
        {
            switch (target)
            {
            case AbonentType.Client:
                _wsServer.SendMessage(message);
                break;

            case AbonentType.Server:
                _wsClient.SendMessage(message);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(target), target, null);
            }
        }
Exemplo n.º 3
0
 public void SetTarget(AbonentType target)
 {
     _target = target;
 }
Exemplo n.º 4
0
 private void AddMessage(AbonentType source, AbonentType target, string message)
 {
     Messages.Add(new ChatItemViewModel(source, target, message, _eventAggregator));
 }
Exemplo n.º 5
0
 public MessageReceivedEventArgs(AbonentType source, string jsonString)
 {
     Source     = source;
     JsonString = jsonString;
 }
 public PackageTransmittedArgs(AbonentType source, AbonentType target, string messsage)
 {
     Source  = source;
     Target  = target;
     Message = messsage;
 }