ARCed.Controls.ImageTextComparer.Compare C# (CSharp) Метод

Compare() публичный Метод

public Compare ( object x, object y ) : int
x object
y object
Результат int
        public int Compare(object x, object y)
        {
            //int compareResult;

            // Cast the objects to be compared to ListViewItem objects
            var listviewX = (ListViewItem)x;
            int image1 = listviewX.ImageIndex;
            var listviewY = (ListViewItem)y;
            int image2 = listviewY.ImageIndex;

            if (image1 < image2)
            {
                return -1;
            }
            else if (image1 == image2)
            {
                return this.ObjectCompare.Compare(listviewX.Text, listviewY.Text);
            }
            else
            {
                return 1;
            }
        }