Exemplo n.º 1
0
        private void listBoxItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var newConversation = ((ListBoxItem)sender).Content.ToString();

            if (newConversation == mainWindow.username)
            {
                MessageBox.Show("You can't talk to yourself", "Error!");
                return;
            }

            var windowDialog = new WindowDialog();

            this.currentConversations.Add(newConversation, windowDialog);

            windowDialog.Owner = this;
            windowDialog.Show();
        }
Exemplo n.º 2
0
        private void privateMessagesTimer_Tick(object sender, EventArgs e)
        {
            var privateMessages = mainWindow.proxy.Receive(mainWindow.username);

            foreach (var message in privateMessages)
            {
                if (!this.currentConversations.ContainsKey(message.From))
                {
                    var newConversation = message.From;
                    var windowDialog    = new WindowDialog();
                    this.currentConversations.Add(newConversation, windowDialog);

                    windowDialog.Owner = this;
                    windowDialog.Show();
                }

                this.currentConversations[message.From].listBoxConversation.Items.Add(message.From + ": " + message.Text);
            }
        }
Exemplo n.º 3
0
        private void listBoxItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var newConversation = ((ListBoxItem)sender).Content.ToString();
            if (newConversation == mainWindow.username)
            {
                MessageBox.Show("You can't talk to yourself", "Error!");
                return;
            }

            var windowDialog = new WindowDialog();
            this.currentConversations.Add(newConversation, windowDialog);

            windowDialog.Owner = this;
            windowDialog.Show();
        }
Exemplo n.º 4
0
        private void privateMessagesTimer_Tick(object sender, EventArgs e)
        {
            var privateMessages = mainWindow.proxy.Receive(mainWindow.username);
            foreach (var message in privateMessages)
            {
                if (!this.currentConversations.ContainsKey(message.From))
                {
                    var newConversation = message.From;
                    var windowDialog = new WindowDialog();
                    this.currentConversations.Add(newConversation, windowDialog);

                    windowDialog.Owner = this;
                    windowDialog.Show();
                }

                this.currentConversations[message.From].listBoxConversation.Items.Add(message.From + ": " + message.Text);
            }
        }