Blame | Last modification | View Log | RSS feed
#pragma onceusing namespace System;using namespace System::Collections;using namespace System::Windows::Forms;ref class ListViewItemComparer : IComparer {private:int col;bool reverse;public:ListViewItemComparer() {col=0;reverse = false;}ListViewItemComparer(int column, bool rev){reverse = rev;col=column;}virtual int Compare(System::Object ^x, System::Object ^y){int returnVal = -1;if ( reverse )returnVal = String::Compare(((ListViewItem ^)y)->SubItems[col]->Text, ((ListViewItem ^)x)->SubItems[col]->Text);elsereturnVal = String::Compare(((ListViewItem ^)x)->SubItems[col]->Text, ((ListViewItem ^)y)->SubItems[col]->Text);return returnVal;}};