コード例 #1
0
ファイル: WindowChat.xaml.cs プロジェクト: pzwwei/MyICQ
        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();
        }
コード例 #2
0
ファイル: WindowChat.xaml.cs プロジェクト: pzwwei/MyICQ
        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);
            }
        }
コード例 #3
0
ファイル: WindowChat.xaml.cs プロジェクト: pzwwei/MyICQ
        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();
        }
コード例 #4
0
ファイル: WindowChat.xaml.cs プロジェクト: pzwwei/MyICQ
        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);
            }
        }