JamBaseShellListViewCompare Method |
public override int Compare(object x, object y) { ShellListBaseItem item1 = x as ShellListBaseItem; ShellListBaseItem item2 = y as ShellListBaseItem; if (item1 == null || item2 == null) return 0; if (!SortColumnShellID.IsCustomId()) { // the shell is asked ShellBrowser.SpecialFolder = ShellFolder.Desktop; if (Sorting == SortOrder.Ascending) return ShellBrowser.CompareIDs(item1.RelativeItemIdList, item2.RelativeItemIdList, m_SortColumnShellIndex); else return ShellBrowser.CompareIDs(item2.RelativeItemIdList, item1.RelativeItemIdList, m_SortColumnShellIndex); } else { // perform a normal alphanumeric compare if (Sorting == SortOrder.Ascending) return item1.SubItems[SortColumn].Text.CompareTo(item2.SubItems[SortColumn].Text); else return item2.SubItems[SortColumn].Text.CompareTo(item1.SubItems[SortColumn].Text); } }
Namespace: Jam.Shell