Files: added sorting by origin room
This commit is contained in:
parent
b63bfc4de5
commit
91d1b4e422
@ -37,7 +37,8 @@ public enum SortedByType
|
||||
New,
|
||||
DateAndTimeCreation,
|
||||
RoomType,
|
||||
Tags
|
||||
Tags,
|
||||
Room
|
||||
}
|
||||
|
||||
[DebuggerDisplay("{SortedBy} {IsAsc}")]
|
||||
|
@ -943,6 +943,28 @@ public class EntryManager
|
||||
return c * (isNewSortResult == 0 ? DateTime.Compare(x.ModifiedOn, y.ModifiedOn) : isNewSortResult);
|
||||
}
|
||||
,
|
||||
SortedByType.Room => (x, y) =>
|
||||
{
|
||||
var x1 = ((FileEntry<T>)x).OriginRoomTitle;
|
||||
var x2 = ((FileEntry<T>)y).OriginRoomTitle;
|
||||
|
||||
if (x1 == null && x2 == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (x1 == null)
|
||||
{
|
||||
return c * 1;
|
||||
}
|
||||
|
||||
if (x2 == null)
|
||||
{
|
||||
return c * -1;
|
||||
}
|
||||
|
||||
return c * x1.EnumerableComparer(x2);
|
||||
},
|
||||
_ => (x, y) => c * x.Title.EnumerableComparer(y.Title),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user