ShellBrowser .Net Edition
Compare Method (x, y)
NamespacesJam.ShellCustomFileList<(Of <(LIST_ITEM>)>)Compare(Object, Object)
Implement this method to compare objects given the SortColumn. It's best to start like this
CopyC#
LIST_ITEM item1 = x as LIST_ITEM;
LIST_ITEM item2 = y as LIST_ITEM;
if (item1 == null || item2 == null) return 0;
if (SortColumn < NumColumns)
{
    // the shell is asked
    ShellBrowser.SpecialFolder = ShellFolder.Desktop;
    if (Sorting == SortOrder.Ascending)
        return ShellBrowser.CompareIDs(item1.RelativeItemIdList, item2.RelativeItemIdList, sortColumn);
    else
        return ShellBrowser.CompareIDs(item2.RelativeItemIdList, item1.RelativeItemIdList, sortColumn);
}
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);
}
Declaration Syntax
C#Visual BasicVisual C++
public abstract int Compare(
	Object x,
	Object y
)
Public MustOverride Function Compare ( _
	x As Object, _
	y As Object _
) As Integer
public:
virtual int Compare(
	Object^ x, 
	Object^ y
) abstract
Parameters
x (Object)
First LIST_ITEM
y (Object)
Second LIST_ITEM, which will be compared with first one.
Return Value
Returns a value less than 0 if x is less than y, 0 if x is equal to y and a value greater than 0 if x is greater than y.
See Also

Assembly: ShellBrowser (Module: ShellBrowser) Version: 4.2.1.45 (4.2.1.45)