Пример #1
0
        //
        // Compare endpoints for sorting purposes
        //
        public override int CompareTo(IceInternal.EndpointI obj)
        {
            if (!(obj is EndpointI))
            {
                return(type() < obj.type() ? -1 : 1);
            }

            EndpointI p = (EndpointI)obj;

            if (this == p)
            {
                return(0);
            }

            if (_timeout < p._timeout)
            {
                return(-1);
            }
            else if (p._timeout < _timeout)
            {
                return(1);
            }

            if (!_compress && p._compress)
            {
                return(-1);
            }
            else if (!p._compress && _compress)
            {
                return(1);
            }

            return(base.CompareTo(p));
        }
Пример #2
0
        //
        // Compare endpoints for sorting purposes
        //
        public override int CompareTo(IceInternal.EndpointI obj)
        {
            if (!(obj is EndpointI))
            {
                return(type() < obj.type() ? -1 : 1);
            }

            EndpointI p = (EndpointI)obj;

            if (this == p)
            {
                return(0);
            }
            else
            {
                int r = base.CompareTo(p);
                if (r != 0)
                {
                    return(r);
                }
            }

            if (_port < p._port)
            {
                return(-1);
            }
            else if (p._port < _port)
            {
                return(1);
            }

            if (_timeout < p._timeout)
            {
                return(-1);
            }
            else if (p._timeout < _timeout)
            {
                return(1);
            }

            if (!connectionId_.Equals(p.connectionId_))
            {
                return(string.Compare(connectionId_, p.connectionId_, StringComparison.Ordinal));
            }

            if (!_compress && p._compress)
            {
                return(-1);
            }
            else if (!p._compress && _compress)
            {
                return(1);
            }

            return(string.Compare(_host, p._host, StringComparison.Ordinal));
        }
Пример #3
0
        //
        // Compare endpoints for sorting purposes
        //
        public override int CompareTo(IceInternal.EndpointI obj)
        {
            if (!(obj is EndpointI))
            {
                return(type() < obj.type() ? -1 : 1);
            }

            EndpointI p = (EndpointI)obj;

            if (this == p)
            {
                return(0);
            }

            return(_delegate.CompareTo(p._delegate));
        }