Beispiel #1
0
        ///<summary>Fills the User list with non-hidden, non-CEMT user names.  Only shows non-hidden CEMT users if Show CEMT users is checked.</summary>
        private void FillListBox()
        {
            listUser.BeginUpdate();
            listUser.Items.Clear();
            List <string> listUserNames = Userods.GetUserNamesNoCache(checkShowCEMTUsers.Checked);

            foreach (string userName in listUserNames)
            {
                listUser.Items.Add(userName);
                if (_userNameAutoSelect != null && _userNameAutoSelect.Trim().ToLower() == userName.Trim().ToLower())
                {
                    listUser.SelectedIndex = listUser.Items.Count - 1;
                }
            }
            if (listUser.SelectedIndex == -1 && listUser.Items.Count > 0)        //It is possible there are no users in the list if all users are CEMT users.
            {
                listUser.SelectedIndex = 0;
            }
            listUser.EndUpdate();
        }