Exemplo n.º 1
0
        /// <summary>
        /// Compares the specified object with this message for equality.
        /// Returns true iff the given object is a message of the same type
        /// (as defined by DescriptorForType) and has identical values
        /// for all its fields.
        /// </summary>
        public override bool Equals(object other)
        {
            if (other == this)
            {
                return(true);
            }
            IMessage otherMessage = other as IMessage;

            if (otherMessage == null || otherMessage.DescriptorForType != DescriptorForType)
            {
                return(false);
            }
            return(Dictionaries.Equals(AllFields, otherMessage.AllFields) && UnknownFields.Equals(otherMessage.UnknownFields));
        }