Пример #1
0
    protected override int Compare(UIViewSortKind kind, object a, object b)
    {
        int result = 0;

        left  = a as IShip;
        right = b as IShip;
        switch (kind)
        {
        case UIViewSortKind.GetTime:
            result = (int)(right.GetCreatTime() - left.GetCreatTime());
            break;

        default:
            return(base.Compare(kind, left.GetBaseConfig(), right.GetBaseConfig()));
        }
        if (result == 0)
        {
            result = right.GetBaseConfig().Order - left.GetBaseConfig().Order;
        }
        if (result == 0)
        {
            result = (int)(right.GetBaseConfig().Id - left.GetBaseConfig().Id);
        }
        return(result);
    }