Beispiel #1
0
        public override int Compare(IServiceObject a, IServiceObject b)
        {
            // default implementation: string compare
            object oA = (a == null) ? 0 : a.GetObject(ID);
            object oB = (b == null) ? 0 : b.GetObject(ID);

            if (oA == null)
                oA = 0;
            if (oB == null)
                oB = 0;
            return ((int)oA) - ((int)oB);
        }
        public override int Compare(IServiceObject a, IServiceObject b)
        {
            // default implementation: string compare
            object oA = (a == null) ? new TimeSpan() : a.GetObject(ID);
            object oB = (b == null) ? new TimeSpan() : b.GetObject(ID);

            if (oA == null)
                oA = new TimeSpan();
            if (oB == null)
                oB = new TimeSpan();
            return ((TimeSpan)oA).CompareTo(oB);
        }
        public override int Compare(IServiceObject a, IServiceObject b)
        {
            // default implementation: string compare
            object oA = (a == null) ? 0L : a.GetObject(ID);
            object oB = (b == null) ? 0L : b.GetObject(ID);

            if (oA == null)
                oA = 0L;
            if (oB == null)
                oB = 0L;
            long delta = (long)oA - (long)oB;
            if (delta > 0)
                return 1;
            if (delta < 0)
                return -1;
            return 0;
        }
        public override int Compare(IServiceObject a, IServiceObject b)
        {
            // default implementation: string compare
            object oA = (a == null) ? (uint)0 : a.GetObject(ID);
            object oB = (b == null) ? (uint)0 : b.GetObject(ID);

            if (oA == null)
                oA = (uint)0;
            if (oB == null)
                oB = (uint)0;

            uint A = (uint)oA;
            uint B = (uint)oB;

            if (A == B)
                return 0;

            if( A < B )
                return 1;

            return -1;
        }