public override bool Equals()

in Source/Tx.Network/Snmp/ObjectIdentifier.cs [188:220]


        public override bool Equals(object anotherObj)
        {
            if (typeof(ObjectIdentifier) != anotherObj.GetType())
            {
                return false;
            }
            ObjectIdentifier otherObj = (ObjectIdentifier)anotherObj;
            if (this.Oids == null && otherObj.Oids == null)
            {
                return true;
            }

            if (this.Oids == null && otherObj.Oids != null)
            {
                return false;
            }

            if (this.Oids != null && otherObj.Oids == null)
            {
                return false;
            }

            for (int i = 0; i < this.Oids.Count; i++)
            {
                int length = (int)(otherObj.Oids[i] - this.Oids[i]);
                if (length != 0)
                {
                    return false;
                }
            }

            return true;
        }