public int CompareTo()

in Source/Tx.Network/Snmp/ObjectIdentifier.cs [147:181]


        public int CompareTo(ObjectIdentifier other)
        {
            if(other.Oids ==null && this.Oids == null)
            {
                return 0;
            }

            if (other.Oids == null )
            {
                return 1;
            }

            if (this.Oids == null)
            {
                return -1;
            }

            int length = other.Oids.Count - this.Oids.Count;
            if(length != 0)
            {
                return length;
            }

            for(int i = 0; i < this.Oids.Count; i++)
            {
                if (other.Oids[i] != this.Oids[i])
                {
                    return (other.Oids[i] > this.Oids[i]) ? 
                        (int)(other.Oids[i] - this.Oids[i]) : 
                        -1 * (int)(this.Oids[i] - other.Oids[i]);
                }
            }

            return 0;
        }