private void removeFromBlackListMenuItem_Click(object sender, EventArgs e)
        {
            MemberItem item = this.memberListView.SelectedItem;

            if (item != null)
            {
                this.currentUser.RemoveFromBlackList(item.Member);
            }
        }
        private void copyAddressMenuItem_Click(object sender, EventArgs e)
        {
            MemberItem item = this.memberListView.SelectedItem;

            if (item != null && !string.IsNullOrEmpty(item.Member.Address))
            {
                Clipboard.SetText(item.Member.Address);
            }
        }
 private void Members_Removed(object sender, Member e)
 {
     Utils.Invoke(this, delegate
     {
         MemberItem item = this.FindMemberItem(e);
         if (item != null)
         {
             this.memberListView.Items.Remove(item);
         }
     });
 }
        private void Tab_SelectedIndexChanged(object sender, EventArgs e)
        {
            TabControl  tab  = sender as TabControl;
            MessagePage page = tab.SelectedTab as MessagePage;

            if (page != null)
            {
                this.recipLabel.Text = page.Text;
                MemberItem item = this.FindMemberItem(page.Member);
                if (item != null)
                {
                    this.memberListView.SelectedItem = item;
                }
            }
            else
            {
                this.recipLabel.Text = "";
            }
        }
        private void memberListView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            MemberItem item = this.memberListView.SelectedItem;

            if (item != null)
            {
                if (e.Button == MouseButtons.Left)
                {
                    Member member = item.Member;
                    if (member.MessagePage == null)
                    {
                        member.MessagePage = new MessagePage(member);
                        this.currentUser.TabControl.TabPages.Add(member.MessagePage);
                        Message[] msgs = member.Messages.Select();
                        foreach (Message message in msgs)
                        {
                            this.AddMessage(member.MessageView, member, message);
                        }
                        if (member.MessageView.Items.Count > 0)
                        {
                            member.MessageView.EnsureVisible(member.MessageView.Items.Count - 1);
                        }
                    }
                    if (!this.currentUser.TabControl.TabPages.Contains(member.MessagePage))
                    {
                        this.currentUser.TabControl.TabPages.Add(member.MessagePage);
                    }
                    this.currentUser.TabControl.SelectedTab = member.MessagePage;
                    this.sendTextBox.Enabled = true;
                    this.recipLabel.Text     = item.Member.Name;
                }
            }
            bool enabled = item != null;

            this.sendGrammsMenuItem.Enabled          = enabled;
            this.copyAddressMenuItem.Enabled         = enabled;
            this.removeMemberMenuItem.Enabled        = enabled;
            this.deleteAllMessagesMenuItem.Enabled   = !enabled;
            this.addToBlackListMenuItem.Enabled      = enabled;
            this.removeFromBlackListMenuItem.Enabled = enabled;
        }