16using System.Collections.Generic;
213 string message =
string.Format(
"Unrecognized sort option: {0}", sortOption);
214 throw new ApplicationException(message);
static EntryInformation entries[]
List of individuals to play around with in the Strategy exercise.
Represents an individual with a Name, Age, and Height.
int Age
Age of this individual, in years.
string Name
Name of this individual.
int Height
Height of this individual, in inches.
Represents a way of displaying a list of EntryInformation objects in a particular order....
SortOptions
Identifies the different sorting strategies available.
Strategy for sorting the ages in ascending (or descending) order.
bool _reversedSort
Controls order of sort: true for descending, false for ascending.
Strategy_SortEntries_ByAge(bool reversedSort)
Constructor.
void Sort(List< EntryInformation > entries)
Sort the specified list of entries in place. A list is used here so we can leverage the List's sortin...
Strategy for sorting the heights in ascending (or descending) order.
bool _reversedSort
Controls order of sort: true for descending, false for ascending.
Strategy_SortEntries_ByHeight(bool reversedSort)
Constructor.
void Sort(List< EntryInformation > entries)
Sort the specified list of entries in place. A list is used here so we can leverage the List's sortin...
Strategy for sorting the names in ascending (or descending) order.
bool _reversedSort
Controls order of sort: true for descending, false for ascending.
void Sort(List< EntryInformation > entries)
Sort the specified list of entries in place. A list is used here so we can leverage the List's sortin...
Strategy_SortEntries_ByName(bool reversedSort)
Constructor.
Class constructor for the sorting strategies.
static ISortEntries Create(Strategy_ShowEntries_Class.SortOptions sortOption, bool reversedSort)
Generate an instance of a sorting strategy based on the given sorting option and reversed sort flag....
Represents a sorting strategy.
void Sort(List< EntryInformation > entries)
Sort the specified list of entries in place. A list is used here so we can leverage the List's sortin...
The namespace containing all Design Pattern Examples implemented in C#.