Beispiel #1
0
        /// <summary>
        /// Determines whether this instance of <see cref="FieldId"/> refers to the same field as <paramref name="other"/>.
        /// </summary>
        public bool Equals(FieldId?other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(other != null &&
                   DefiningType.Equals(other.DefiningType) &&
                   StringComparer.Ordinal.Equals(Name, other.Name));
        }
Beispiel #2
0
        /// <summary>
        /// Determines whether this instance of <see cref="PropertyId"/> refers to the same property of indexer as <paramref name="other"/>.
        /// </summary>
        public bool Equals(PropertyId?other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (other == null)
            {
                return(false);
            }

            return(DefiningType.Equals(other.DefiningType) &&
                   StringComparer.Ordinal.Equals(Name, other.Name) &&
                   Parameters.Count == other.Parameters.Count &&
                   Parameters.SequenceEqual(other.Parameters));
        }
Beispiel #3
0
        /// <summary>
        /// Determines whether this instance of <see cref="MethodId"/> refers to the same method as <paramref name="other"/>.
        /// </summary>
        public bool Equals(MethodId?other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (other == null)
            {
                return(false);
            }

            return(DefiningType.Equals(other.DefiningType) &&
                   StringComparer.Ordinal.Equals(Name, other.Name) &&
                   Arity == other.Arity &&
                   Parameters.SequenceEqual(other.Parameters) &&
                   (
                       (ReturnType == null && other.ReturnType == null) ||
                       (ReturnType != null && ReturnType.Equals(other.ReturnType))
                   ));
        }