Bloom.Edit.SortListViewItemByIndex.Compare C# (CSharp) Method

Compare() public method

public Compare ( object x, object y ) : int
x object
y object
return int
        public int Compare(object x, object y)
        {
            ListViewItem X = x as ListViewItem;
            ListViewItem Y = y as ListViewItem;
            ListView listView = X.ListView;
            if (listView != null && X != null && Y != null)
            {
                return listView.Items.IndexOf(X) - listView.Items.IndexOf(Y);
            }
            return 0;
        }
SortListViewItemByIndex