diff --git a/products/ASC.Files/Core/Core/Entries/OrderBy.cs b/products/ASC.Files/Core/Core/Entries/OrderBy.cs index d33238fb7b..4c174df0ad 100644 --- a/products/ASC.Files/Core/Core/Entries/OrderBy.cs +++ b/products/ASC.Files/Core/Core/Entries/OrderBy.cs @@ -37,7 +37,8 @@ public enum SortedByType New, DateAndTimeCreation, RoomType, - Tags + Tags, + Room } [DebuggerDisplay("{SortedBy} {IsAsc}")] diff --git a/products/ASC.Files/Core/Utils/EntryManager.cs b/products/ASC.Files/Core/Utils/EntryManager.cs index 234358311a..06298741cc 100644 --- a/products/ASC.Files/Core/Utils/EntryManager.cs +++ b/products/ASC.Files/Core/Utils/EntryManager.cs @@ -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)x).OriginRoomTitle; + var x2 = ((FileEntry)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), };