Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            IMemberId memberId = obj as IMemberId;

            if (memberId == null)
            {
                return(false);
            }
            PlatformNeutralPropertyId platformNeutralPropertyId = memberId as PlatformNeutralPropertyId;

            if (platformNeutralPropertyId != null)
            {
                if (!string.Equals(platformNeutralPropertyId.Name, this.Name, StringComparison.Ordinal))
                {
                    return(false);
                }
                return(platformNeutralPropertyId.DeclaringTypeId.Equals(this.DeclaringTypeId));
            }
            if (!string.Equals(memberId.UniqueName, this.UniqueName, StringComparison.Ordinal) || !memberId.DeclaringTypeId.Equals(this.DeclaringTypeId))
            {
                return(false);
            }
            return(memberId.MemberType == this.MemberType);
        }
Esempio n. 2
0
        public virtual IProperty ResolveProperty(IPropertyId propertyId)
        {
            IProperty property = this.PlatformMetadata.ResolveProperty(propertyId);

            if (property != null)
            {
                return(property);
            }
            PlatformNeutralPropertyId platformNeutralPropertyId = propertyId as PlatformNeutralPropertyId;

            if (platformNeutralPropertyId == null)
            {
                return(null);
            }
            IType type = this.ResolveType(platformNeutralPropertyId.DeclaringTypeId);

            if (this.PlatformMetadata.IsNullType(type))
            {
                return(null);
            }
            return(type.GetMember(platformNeutralPropertyId.MemberType, platformNeutralPropertyId.Name, platformNeutralPropertyId.MemberAccessTypes) as IProperty);
        }