Example #1
0
 internal void ApplyEvent(ClientView view, ClientCreated @event)
 {
     view.Id              = @event.ClientId;
     view.Name            = @event.Data.Name;
     view.Email           = @event.Data.Email;
     view.AccountsNumbers = new List <string>();
 }
Example #2
0
        public void sendEvent(ClientItem clientItem)
        {
            Action <DeliveryReportResult <String, ClientCreated> > handler = r =>
                                                                             Console.WriteLine(!r.Error.IsError
                    ? $"Delivered message to {r.TopicPartitionOffset}"
                    : $"Delivery Error: {r.Error.Reason}");

            var clientName = new Name {
                firstname = clientItem.firstname, lastname = clientItem.lastname
            };
            var clientAddress = new Address {
                street = clientItem.street, city = clientItem.city
            };
            var clientCreated = new ClientCreated {
                id = clientItem.id.ToString(), Name = clientName, Address = clientAddress
            };

            producerCreated
            .ProduceAsync("ClientCreated", new Message <String, ClientCreated> {
                Key = clientItem.id.ToString(), Value = clientCreated
            })
            .ContinueWith(task => task.IsFaulted
                            ? $"error producing message: {task.Exception.Message}"
                            : $"produced to: {task.Result.TopicPartitionOffset}");
        }
        private void Handle(ClientCreated cr)
        {
            Log.Information("Added Client: {Id}, {Name}, {Address}, {Email}",
                            cr.Id, cr.FirstName + " " + cr.LastName, cr.Address, cr.Email);

            //handle ClientCreated event
        }
Example #4
0
        private void Handle(ClientCreated evt)
        {
            var ci = indexer.Get <ClientInformation>(evt.ID);

            ClientInformation clientInfo;

            if (ci == null)
            {
                clientInfo = new ClientInformation()
                {
                    ID      = evt.ID,
                    Name    = evt.Name,
                    Balance = 0
                }
            }
            ;
            else
            {
                clientInfo         = ci;
                clientInfo.Balance = 0;
                clientInfo.Name    = evt.Name;
            }



            indexer.Index(clientInfo);
        }
        private void Apply(ClientCreated obj)
        {
            this.ID = obj.ID;

            Name = obj.Name;

            balance = 0;
        }
Example #6
0
        private async void OnNavigationBarAddClicked(object sender, EventArgs e)
        {
            var clientData = await ViewModel.SaveNewClient();

            if (ClientCreated != null)
            {
                ClientCreated.Invoke(clientData);
            }
        }
 public ClientView Create(ClientCreated @event)
 {
     return(new ClientView
     {
         Id = @event.ClientId,
         Name = @event.Data.Name,
         Email = @event.Data.Email,
         AccountsNumbers = new List <string>()
     });
 }
Example #8
0
        public static PrimusClient CreateClient()
        {
            var client = new PrimusClient(Guid.NewGuid());

            _clients.Add(client.Guid, client);

            ClientCreated?.Invoke(client);

            return(client);
        }
Example #9
0
        private void CreateClient(CreateClient createClient)
        {
            logger.Info("Create client (Name: {0})", createClient.Name);

            string id = clientProcessorService.Create(null);

            var clientCreated = new ClientCreated(createClient.ProcessActor, id);

            Sender.Tell(clientCreated);
        }
Example #10
0
        public void Awake()
        {
            instance = this;
            DontDestroyOnLoad(this);
            GetUserInfo.UpdateUserInfo();
            playerInfo = new PlayerInfo(GetUserInfo.GetUserName(), GetUserInfo.GetUserID());
            NetPeerConfiguration Config = new NetPeerConfiguration("BeatSaberMultiplayer")
            {
                MaximumHandshakeAttempts = 2, AutoFlushSendQueue = false
            };

            NetworkClient = new NetClient(Config);
            ClientCreated?.Invoke();
        }
Example #11
0
 public void When(ClientCreated clientCreated)
 {
     ClientId = clientCreated.ClientId;
 }
Example #12
0
 internal void ApplyEvent(ClientCreated @event)
 {
     ClientName = @event.Data.Name;
 }
 internal void ApplyEvent(ClientCreated @event)
 {
     Id        = @event.Id;
     Name      = @event.Data.Name;
     IsDeleted = false;
 }
Example #14
0
        private void ClientCreated(ClientCreated clientCreated)
        {
            var storeClient = new StoreClient(clientCreated.Id);

            clientCreated.ProcessActor.Tell(storeClient);
        }
Example #15
0
 internal static void RaiseClientCreated(ConnectionClient client)
 {
     Log.Out.Info($"Raising 'ClientCreated' event for {client.EndPoint}");
     ClientCreated?.Invoke(new ClientCreatedEventArgs(client));
 }
 private List <Guid> FindClientAccountIds(IDocumentSession session, ClientCreated @event)
 {
     return(FindClientAccountIds(session, @event.ClientId));
 }
Example #17
0
 private static bool OnClientCreated(ClientCreated arg)
 {
     return(true);
 }