Esempio n. 1
0
        private void UserListBox_DoubleClick(object sender, EventArgs e)
        {
            PeerUser selectedPeerUser = this.userListBox.SelectedItem as PeerUser;
            if (selectedPeerUser == null)
            {
                MessageBox.Show(
                        Resources.SelectUserMessage,
                        this.Text,
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Information,
                        MessageBoxDefaultButton.Button1,
                        (MessageBoxOptions)0);
                return;
            }

            if (selectedPeerUser.ChatWindowExists)
            {
                ShowChatWindow(selectedPeerUser);
            }
            else
            {
                ChatWindow newChatWindow = new ChatWindow(this, selectedPeerUser);
                selectedPeerUser.ChatWindow = newChatWindow;
                ShowChatWindow(selectedPeerUser);
            }
        }
Esempio n. 2
0
 public PeerUser(string userName, EndpointAddress address, ChatWindow chatWindow)
 {
     this.userName = userName;
     this.address = address;
     this.chatWindow = chatWindow;
 }