System.Collections.SortedList.GetKeyList C# (CSharp) Method

GetKeyList() public method

public GetKeyList ( ) : IList
return IList
        public virtual IList GetKeyList()
        {
            if (_keyList == null) _keyList = new KeyList(this);
            return _keyList;
        }

Same methods

SortedList::GetKeyList ( ) : System.Collections.IList

Usage Example

 /// <summary>
 /// GetStudentUserListByYear take StudentByYear sorted list created in the main program and the student years checkedlistbox and creates a hashtable
 /// that will be used to look up the user list to display in the combolistbox display. 
 /// This does not use wmi service, but is the logical place add this method. 
 /// </summary>
 /// <param name="slIn"></param>
 /// <param name="checkListBox"></param>
 /// <returns>sortlist</returns>
 public Hashtable GetStudentUserListByYear(SortedList slIn, CheckedListBox checkListBox)
 {
     Hashtable ht = new Hashtable();
     try
     {
         foreach (object itemChecked in checkListBox.CheckedItems)
         {
             ICollection keys = slIn.GetKeyList();
             foreach (string s in keys)
             {
                 if (s == itemChecked.ToString())
                 {
                     //this is the sortedlist of students for a given year
                     IList values = ((SortedList)slIn[s]).GetValueList();
                     //create the hashtable entries available students - this will be used to lookup and match students by year
                     foreach (string name in values)
                     {
                         ht.Add(name.ToUpper(), name.ToUpper());
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         //re-throw exception for main calling
         throw new Exception("WMIPropertiesHelper", e);
     }
     return (ht);
 }
All Usage Examples Of System.Collections.SortedList::GetKeyList