Example #1
0
        public void Initialize(ChatConnectionHandler connection)
        {
            if (Connection != null)
            {
                Connection.Dispose(false);
                Connection = null;
            }

            Connection = connection;
            Refresh();
        }
        public static void Attach(string id, ChatConnectionHandler client, AccountChatView account)
        {
            ChatUserController controller = null;

            lock (_lock) {
                if (!Players.TryGetValue(id, out controller))
                {
                    Players[id] = controller = new ChatUserController(account);
                }

                client.Controller = controller;
            }

            if (controller != null)
            {
                controller.Initialize(client);
            }
        }