Ejemplo n.º 1
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as PropertyData;

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

            if (GetMethodAccessibility != otherTyped.GetMethodAccessibility)
            {
                return(false);
            }

            if (SetMethodAccessibility != otherTyped.SetMethodAccessibility)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as MethodData;

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

            if (GenericParameters.DoesMatch(otherTyped.GenericParameters) == false)
            {
                return(false);
            }

            if (IsExtensionMethod != otherTyped.IsExtensionMethod)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as ConstructedGenericTypeData;

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

            if (GenericArguments.DoesMatch(otherTyped.GenericArguments) == false)
            {
                return(false);
            }

            if (GenericTypeDefinition.DisplayName != otherTyped.GenericTypeDefinition.DisplayName)
            {
                return(false);
            }

            if (_isNullable != otherTyped._isNullable)
            {
                return(false);
            }

            return(true);
        }
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as TypedMemberDataBase;

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

            if (this.IsTypeDynamic != otherTyped.IsTypeDynamic)
            {
                return(false);
            }

            if (this.Type.DisplayName != otherTyped.Type.DisplayName)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 5
0
        internal virtual bool DoesMatch(MetadataItemBase other)
        {
            if (this.DisplayName != other.DisplayName)
            {
                return(false);
            }

            if (this.MetadataItemKind != other.MetadataItemKind)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 6
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as ParameterData;

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

            if (_flags != otherTyped._flags)
            {
                return(false);
            }

            if (this.DeclaringMemberKind != otherTyped.DeclaringMemberKind)
            {
                return(false);
            }

            if (Object.Equals(this.DefaultValue, otherTyped.DefaultValue) == false)
            {
                return(false);
            }

            if (this.Modifer != otherTyped.Modifer)
            {
                return(false);
            }

            if (this.Name != otherTyped.Name)
            {
                return(false);
            }

            if (this.Type.DisplayName != otherTyped.DisplayName)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 7
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as GenericTypeParameterData;

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

            if (Constraints.Count != otherTyped.Constraints.Count)
            {
                return(false);
            }

            for (int i = 0; i < Constraints.Count; i++)
            {
                if (Constraints[i].DisplayName != otherTyped.Constraints[i].DisplayName)
                {
                    return(false);
                }
            }

            if (GenericDeclaringMember.DisplayName != otherTyped.GenericDeclaringMember.DisplayName)
            {
                return(false);
            }

            if (GenericParameterAttributes != otherTyped.GenericParameterAttributes)
            {
                return(false);
            }

            if (GenericParameterPosition != otherTyped.GenericParameterPosition)
            {
                return(false);
            }

            return(true);
        }
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as MemberDataBase;

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

            if (this.Accessibility != otherTyped.Accessibility)
            {
                return(false);
            }

            if (this.DeclaringType == null ^ otherTyped.DeclaringType == null)
            {
                return(false);
            }

            if (this.DeclaringType != null && this.DeclaringType.DisplayName != otherTyped.DeclaringType.DisplayName)
            {
                return(false);
            }

            if (this.MemberFlags != otherTyped.MemberFlags)
            {
                return(false);
            }

            if (this.Name != otherTyped.Name)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 9
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as TypeDefinitionData;

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

            if (this.FullName != otherTyped.FullName)
            {
                return(false);
            }

            if (this.GenericParameters.DoesMatch(otherTyped.GenericParameters) == false)
            {
                return(false);
            }

            if (this.NameForComparison != otherTyped.NameForComparison)
            {
                return(false);
            }

            if (this.OldName != otherTyped.OldName)
            {
                return(false);
            }

            if (this.TypeDefinitionFlags != otherTyped.TypeDefinitionFlags)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 10
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as ConstructorData;

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

            if (this.Parameters.DoesMatch(otherTyped.Parameters) == false)
            {
                return(false);
            }

            return(true);
        }
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as ConstantData;

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

            if (Object.Equals(this.Value, otherTyped.Value))
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 12
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as TypeWithElementData;

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

            if (this.ElementType.DisplayName != otherTyped.ElementType.DisplayName)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 13
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as ArrayTypeData;

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

            if (this.ArrayRank != otherTyped.ArrayRank)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 14
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as FieldData;

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

            if (this.IsReadOnly != otherTyped.IsReadOnly)
            {
                return(false);
            }

            return(true);
        }
 /// <summary>
 /// The default visit implementation for all items.
 /// </summary>
 public virtual void DefaultVisit(MetadataItemBase item)
 {
 }
Ejemplo n.º 16
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as DeclaringTypeData;

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

            if (BaseType == null ^ otherTyped.BaseType == null)
            {
                return(false);
            }

            if (BaseType != null && BaseType.DisplayName != otherTyped.BaseType.DisplayName)
            {
                return(false);
            }

            if (DelegateParameters == null ^ otherTyped.DelegateParameters == null)
            {
                return(false);
            }

            if (DelegateParameters != null && DelegateParameters.DoesMatch(otherTyped.DelegateParameters) == false)
            {
                return(false);
            }

            if (DelegateReturnType == null ^ otherTyped.DelegateReturnType == null)
            {
                return(false);
            }

            if (DelegateReturnType != null && DelegateReturnType.DisplayName != otherTyped.DelegateReturnType.DisplayName)
            {
                return(false);
            }

            if (DelegateReturnTypeIsDynamic != DelegateReturnTypeIsDynamic)
            {
                return(false);
            }

            if (GenericArity != otherTyped.GenericArity)
            {
                return(false);
            }

            if (_membersByName.Count != otherTyped._membersByName.Count)
            {
                return(false);
            }

            foreach (var pair in _membersByName)
            {
                var value = pair.Value;
                if (otherTyped._membersByName.TryGetValue(pair.Key, out List <MemberDataBase> otherValue) == false)
                {
                    return(false);
                }

                if (value.Count != otherValue.Count)
                {
                    return(false);
                }

                for (int i = 0; i < value.Count; i++)
                {
                    if (value[i].DoesMatch(otherValue[i]) == false)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 17
0
        internal override bool DoesMatch(MetadataItemBase other)
        {
            if (base.DoesMatch(other) == false)
            {
                return(false);
            }

            var otherTyped = other as AssemblyData;

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

            if (this.FullName != otherTyped.FullName)
            {
                return(false);
            }

            if (this.Name != otherTyped.Name)
            {
                return(false);
            }

            if (this.VersionComparisonName != otherTyped.VersionComparisonName)
            {
                return(false);
            }

            if (_typeDefinitions.Count != otherTyped._typeDefinitions.Count)
            {
                return(false);
            }

            foreach (var pair in _typeDefinitions)
            {
                var type = pair.Value;
                TypeDefinitionData otherType;
                if (otherTyped._typeDefinitions.TryGetValue(pair.Key, out otherType) == false)
                {
                    return(false);
                }

                if (type.DoesMatch(otherType) == false)
                {
                    return(false);
                }
            }

            if (_typeOwnedGenericParameters.Count != otherTyped._typeOwnedGenericParameters.Count)
            {
                return(false);
            }

            foreach (var pair in _typeOwnedGenericParameters)
            {
                var type = pair.Value;
                GenericTypeParameterData otherType;
                if (otherTyped._typeOwnedGenericParameters.TryGetValue(pair.Key, out otherType) == false)
                {
                    return(false);
                }

                if (type.DoesMatch(otherType) == false)
                {
                    return(false);
                }
            }

            if (_methodOwnedGenericParameters.Count != otherTyped._methodOwnedGenericParameters.Count)
            {
                return(false);
            }

            foreach (var pair in _methodOwnedGenericParameters)
            {
                var type = pair.Value;
                GenericTypeParameterData otherType;
                if (otherTyped._methodOwnedGenericParameters.TryGetValue(pair.Key, out otherType) == false)
                {
                    return(false);
                }

                if (type.DoesMatch(otherType) == false)
                {
                    return(false);
                }
            }

            if (_namespaceRenames.Count != otherTyped._namespaceRenames.Count)
            {
                return(false);
            }

            foreach (var pair in _namespaceRenames)
            {
                var newName      = pair.Value;
                var otherNewName = otherTyped._namespaceRenames[pair.Key];

                if (newName != otherNewName)
                {
                    return(false);
                }
            }

            var referenceNames      = _referencedAssemblies.Select(a => a.FullName).OrderBy(n => n).ToArray();
            var otherReferenceNames = otherTyped._referencedAssemblies.Select(a => a.FullName).OrderBy(n => n).ToArray();

            if (referenceNames.Length != otherReferenceNames.Length)
            {
                return(false);
            }

            for (int i = 0; i < referenceNames.Length; i++)
            {
                if (referenceNames[i] != otherReferenceNames[i])
                {
                    return(false);
                }
            }

            if (_forwardedTypeSources.Count != otherTyped._forwardedTypeSources.Count)
            {
                return(false);
            }

            foreach (var pair in _forwardedTypeSources)
            {
                var assemblies      = pair.Value;
                var otherAssemblies = otherTyped._forwardedTypeSources[otherTyped.GetTypeDefinitionData(pair.Key.FullName)];

                if (assemblies.Count != otherAssemblies.Count)
                {
                    return(false);
                }

                for (int i = 0; i < assemblies.Count; i++)
                {
                    if (assemblies[i].FullName != otherAssemblies[i].FullName)
                    {
                        return(false);
                    }
                }
            }

            if (_forwardedTypeSourcesOnTarget.Count != otherTyped._forwardedTypeSourcesOnTarget.Count)
            {
                return(false);
            }

            foreach (var pair in _forwardedTypeSourcesOnTarget)
            {
                var fullName      = pair.Value;
                var otherFullName = otherTyped._forwardedTypeSourcesOnTarget[otherTyped.GetTypeDefinitionData(pair.Key.FullName)];

                if (fullName != otherFullName)
                {
                    return(false);
                }
            }

            return(true);
        }