Ejemplo n.º 1
0
        public void Handle(Join cmd)
        {
            var firstTimeJoined = members.Add(cmd.User);
            if (firstTimeJoined)
                Send(cmd.User, string.Format("{1} joined the room {0} ...", Id, cmd.User));

            IObserverCollection connections;
            if (!online.TryGetValue(cmd.User, out connections))
            {
                connections = new ObserverCollection();
                online.Add(cmd.User, connections);
            }

            connections.Add(cmd.Client);
        }
Ejemplo n.º 2
0
        public void Handle(Join cmd)
        {
            var firstTimeJoined = members.Add(cmd.User);

            if (firstTimeJoined)
            {
                Send(cmd.User, string.Format("{1} joined the room {0} ...", Id, cmd.User));
            }

            IObserverCollection connections;

            if (!online.TryGetValue(cmd.User, out connections))
            {
                connections = new ObserverCollection();
                online.Add(cmd.User, connections);
            }

            connections.Add(cmd.Client);
        }
Ejemplo n.º 3
0
 Task On(Join x) => Send(x.Room, $"{Id} joined the room {x.Room} ...");
Ejemplo n.º 4
0
 Task On(Join x)   => Send(x.Room, $"{Id} joined the room {x.Room} ...");