/// <summary> /// Displays information found by a person search. /// </summary> /// <param name="searchResults">Result state of a SearchForPersons search.</param> private void DisplayPersonSearchResults(PersonSearchResultsState searchResults) { //Declare a person. PersonState person; //Clear ResultBox. ResultBox.Items.Clear(); //See remark (1) at the bottom of this file. //Search through the result list. foreach (Entry singleEntry in searchResults.Results.Entries ?? new List <Entry>()) { //Get a person. person = searchResults.ReadPerson(singleEntry); //Person could be null, it does happen. if (person.Person != null) { //Display some person info. ResultBox.Items.Add(person.Person.DisplayExtension.Name + " " + person.Person.Id); } else { //Show off the rare occasion of a null person. ResultBox.Items.Add("null"); } //Display it right away, we are inpatient. ResultBox.Update(); } }