Esempio n. 1
0
        public bool Equals(ITypeMemberReference x, ITypeMemberReference y)
        {
            if (x == y)
            {
                return(true);
            }

            if (x.GetContainingType(_metadataWriter.Context) != y.GetContainingType(_metadataWriter.Context))
            {
                if (_metadataWriter.GetMemberRefParentCodedIndex(x) != _metadataWriter.GetMemberRefParentCodedIndex(y))
                {
                    return(false);
                }
            }

            if (x.Name != y.Name)
            {
                return(false);
            }

            IFieldReference /*?*/ xf = x as IFieldReference;
            IFieldReference /*?*/ yf = y as IFieldReference;

            if (xf != null && yf != null)
            {
                return(_metadataWriter.GetFieldSignatureIndex(xf) == _metadataWriter.GetFieldSignatureIndex(yf));
            }

            IMethodReference /*?*/ xm = x as IMethodReference;
            IMethodReference /*?*/ ym = y as IMethodReference;

            if (xm != null && ym != null)
            {
                return(_metadataWriter.GetMethodSignatureIndex(xm) == _metadataWriter.GetMethodSignatureIndex(ym));
            }

            return(false);
        }