예제 #1
0
        void Sort()
        {
            try {
                int columnIndex = prevSortCol_;
                if (columnIndex == COrder.Index || prevSortCol_ == -1)
                {
                    ModList.DefaultSort();
                }
                else if (columnIndex == CIsIncluded.Index)
                {
                    ModList.SortItemsBy(item => item.IsIncludedPending, sortAssending_);
                }
                else if (columnIndex == CEnabled.Index)
                {
                    ModList.SortItemsBy(item => item.IsEnabledPending, sortAssending_);
                }
                else if (columnIndex == CModID.Index)
                {
                    ModList.SortItemsBy(item => item.PublishedFileId.AsUInt64, sortAssending_);
                }
                else if (columnIndex == CDescription.Index)
                {
                    ModList.SortItemsBy(item => item.DisplayText, sortAssending_);
                }
                else if (columnIndex == CAuthor.Index)
                {
                    ModList.SortItemsBy(item => item.Author, sortAssending_);
                }
                else if (columnIndex == this.CDateUpdated.Index)
                {
                    ModList.SortItemsBy(item => item.DateUpdatedUTC, sortAssending_);
                }
                else if (columnIndex == this.CDateDownloaded.Index)
                {
                    ModList.SortItemsBy(item => item.DateDownloadedUTC, sortAssending_);
                }
                else if (columnIndex == CStatus.Index)
                {
                    ModList.SortItemsBy(item => item.SteamCache?.Status ?? default, sortAssending_);
                }

                RefreshModList(sort: false);
            } catch (Exception ex) {
                Log.Exception(ex);
            }
        }