public override bool Equals(object obj)
        {
            SpecializedMember other = obj as SpecializedMember;

            if (other == null)
            {
                return(false);
            }
            return(this.baseMember.Equals(other.baseMember) && this.substitution.Equals(other.substitution));
        }
Example #2
0
        public override bool Equals(object obj)
        {
            SpecializedMember other = obj as SpecializedMember;

            if (other == null)
            {
                return(false);
            }
            return(this.declaringType.Equals(other.declaringType) && this.memberDefinition.Equals(other.memberDefinition));
        }
        IList <IMember> FindImplementedInterfaceMembers()
        {
            var definitionImplementations = baseMember.ImplementedInterfaceMembers;

            IMember[] result = new IMember[definitionImplementations.Count];
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = SpecializedMember.Create(definitionImplementations[i], substitution);
            }
            return(result);
        }
        public IMember Resolve(ITypeResolveContext context)
        {
            var memberDefinition = memberDefinitionReference.Resolve(context);

            return(SpecializedMember.Create(
                       memberDefinition,
                       new TypeParameterSubstitution(
                           classTypeArgumentReferences != null ? classTypeArgumentReferences.Resolve(context) : null,
                           methodTypeArgumentReferences != null ? methodTypeArgumentReferences.Resolve(context) : null
                           )
                       ));
        }
        protected SpecializedMember(IMember memberDefinition)
        {
            if (memberDefinition == null)
            {
                throw new ArgumentNullException("memberDefinition");
            }

            SpecializedMember sm = memberDefinition as SpecializedMember;

            if (sm != null)
            {
                this.baseMember   = sm.baseMember;
                this.substitution = sm.substitution;
            }
            else
            {
                this.baseMember   = memberDefinition;
                this.substitution = TypeParameterSubstitution.Identity;
            }
        }