public virtual void LoadContacts() { ReadOnlyCollection<ContactInfo> contacts = MirandaContext.Current.MirandaDatabase.GetContacts(false); Items.Clear(); ContactFilterEventArgs e = new ContactFilterEventArgs(); for (int i = 0; i < contacts.Count; i++) InsertContact(contacts[i], e); }
private void InsertContact(ContactInfo contact, ContactFilterEventArgs e) { if (contact == null) throw new ArgumentNullException("contact"); if (e != null && FilterContact != null) { e.Contact = contact; e.Skip = false; FilterContact(this, e); if (e.Skip) return; } object tag = CreateItemTag(contact); if (tag != null) { ListViewItem item = new ListViewItem(CreateItemText(contact, tag), GetImageIndex(contact, tag)); item.Tag = tag; Items.Add(item); } }