/// <summary> /// Loads users to UI. /// </summary> /// <param name="selectedUserID">Selects specified user, if exists.</param> private void LoadUsers(string selectedUserID) { m_pUsers.Items.Clear(); m_pVirtualServer.Users.Refresh(); foreach (User user in m_pVirtualServer.Users) { if (m_pFilter.Text == "" || IsAstericMatch(m_pFilter.Text, user.UserName.ToLower())) { ListViewItem it = new ListViewItem(); // Make disabled rules red and striked out if (user.Enabled) { it.ImageIndex = 0; } else { it.ForeColor = Color.Purple; it.Font = new Font(it.Font.FontFamily, it.Font.Size, FontStyle.Strikeout); it.ImageIndex = 1; } it.Tag = user; it.Text = user.UserName; it.SubItems.Add(user.Description); m_pUsers.Items.Add(it); if (user.UserID == selectedUserID) { it.Selected = true; } } } m_pUsers.SortItems(); m_pUsers_SelectedIndexChanged(this, new EventArgs()); }
/// <summary> /// Loads domains to UI. /// </summary> private void LoadDomains() { m_pDomains.Items.Clear(); m_pVirtualServer.Domains.Refresh(); foreach (Domain domain in m_pVirtualServer.Domains) { ListViewItem it = new ListViewItem(); it.ImageIndex = 0; it.Tag = domain; it.Text = domain.DomainName; it.SubItems.Add(domain.Description); m_pDomains.Items.Add(it); } m_pDomains.SortItems(); m_pDomains_SelectedIndexChanged(this, new EventArgs()); }