VAGSuite.GenericComparer.Compare C# (CSharp) Méthode

Compare() public méthode

Compare interface implementation
public Compare ( object x, object y ) : int
x object Object 1
y object Object 2
Résultat int
        public int Compare(object x, object y)
        {
            //Dynamically get the protery info based on the protery name
            PropertyInfo propertyInfo = ObjectType.GetProperty(sortcolumn);
            //Get the value of the instance
            IComparable obj1 = (IComparable)propertyInfo.GetValue(x,null) ;
            IComparable obj2 = (IComparable)propertyInfo.GetValue(y,null) ;
            //Compare based on the sorting order.
            if(sortingOrder == 0)
                return ( obj1.CompareTo(obj2) );
            else
                return ( obj2.CompareTo(obj1) );
        }
GenericComparer