Exemplo n.º 1
0
        public int CompareTo(Metrics other)
        {
            if (!(OS == null && other.OS == null))
            {
                if (OS == null)
                {
                    return(-1);
                }
                if (other.OS == null)
                {
                    return(1);
                }
                if (!OS.Equals(other.OS))
                {
                    return(OS.CompareTo(other.OS));
                }
            }

            if (!(OSVersion == null && other.OSVersion == null))
            {
                if (OSVersion == null)
                {
                    return(-1);
                }
                if (other.OSVersion == null)
                {
                    return(1);
                }
                if (!OSVersion.Equals(other.OSVersion))
                {
                    return(OSVersion.CompareTo(other.OSVersion));
                }
            }

            if (!(Device == null && other.Device == null))
            {
                if (Device == null)
                {
                    return(-1);
                }
                if (other.Device == null)
                {
                    return(1);
                }
                if (!Device.Equals(other.Device))
                {
                    return(Device.CompareTo(other.Device));
                }
            }

            if (!(Resolution == null && other.Resolution == null))
            {
                if (Resolution == null)
                {
                    return(-1);
                }
                if (other.Resolution == null)
                {
                    return(1);
                }
                if (!Resolution.Equals(other.Resolution))
                {
                    return(Resolution.CompareTo(other.Resolution));
                }
            }

            if (!(Carrier == null && other.Carrier == null))
            {
                if (Carrier == null)
                {
                    return(-1);
                }
                if (other.Carrier == null)
                {
                    return(1);
                }
                if (!Carrier.Equals(other.Carrier))
                {
                    return(Carrier.CompareTo(other.Carrier));
                }
            }

            if (!(AppVersion == null && other.AppVersion == null))
            {
                if (AppVersion == null)
                {
                    return(-1);
                }
                if (other.AppVersion == null)
                {
                    return(1);
                }
                if (!AppVersion.Equals(other.AppVersion))
                {
                    return(AppVersion.CompareTo(other.AppVersion));
                }
            }

            return(0);
        }