Initial commit
This commit is contained in:
commit
1be1863b20
50 changed files with 6449 additions and 0 deletions
24
MeetTheTeacher/Model/Comparison/ComparerBase.cs
Normal file
24
MeetTheTeacher/Model/Comparison/ComparerBase.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
namespace MeetTheTeacher.Model.Comparison;
|
||||
|
||||
/// <summary>
|
||||
/// Base class for comparers which allow switching between ascending and descending mode
|
||||
/// </summary>
|
||||
public abstract class ComparerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="ComparerBase" /> configured to sort in ascending or descending order
|
||||
/// </summary>
|
||||
/// <param name="ascending">Flag indicating if items should be sorted in ascending order; descending if false</param>
|
||||
protected ComparerBase(bool ascending)
|
||||
{
|
||||
Ascending = ascending;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets if the comparer is configured to sort in ascending order; descending if false
|
||||
/// </summary>
|
||||
protected bool Ascending { get; }
|
||||
|
||||
// TODO: consider moving the basic RefEquals code of CompareTo from the subclasses here
|
||||
// maybe also rename this to SortOrderComparerBase or something and introduce another, common base class for all three?
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue