Esempio n. 1
0
        public int CompareTo(object obj)
        {
            BandwidthData data = obj as BandwidthData;

            if (data == null)
            {
                return(1);
            }

            if ((int)state != (int)data.State)
            {
                return((int)state - (int)data.State);
            }

            switch (state)
            {
            case BandwidthState.Ready:
                return(0);

            case BandwidthState.Progress:
                return(data.Progress - Progress);

            case BandwidthState.Completed:
                if (Bandwidth == data.Bandwidth)
                {
                    return(0);
                }

                if (Bandwidth < data.Bandwidth)
                {
                    return(1);
                }

                return(-1);

            case BandwidthState.Error:
                return(0);
            }

            throw new NotSupportedException();
        }
Esempio n. 2
0
 public ProxyInfo(IPAddress address, ushort port)
     : base(address, port)
 {
     BandwidthData = new BandwidthData();
 }
Esempio n. 3
0
 public ProxyInfo(string ipPort)
     : base(ipPort)
 {
     BandwidthData = new BandwidthData();
 }