Beispiel #1
0
        /// <inheritdoc/>
        internal override MemberDataBase ReplaceGenericTypeParameters(GenericTypeParameterCollection genericParameters, GenericTypeArgumentCollection genericArguments)
        {
            List <TypeData> replacedGenericArguments = null;

            for (int i = 0; i < GenericArguments.Count; i++)
            {
                var currentArgument  = GenericArguments[i];
                var replacedArgument = (TypeData)currentArgument.ReplaceGenericTypeParameters(genericParameters, genericArguments);
                if (replacedArgument == currentArgument)
                {
                    continue;
                }

                if (replacedGenericArguments == null)
                {
                    replacedGenericArguments = new List <TypeData>(GenericArguments);
                }

                replacedGenericArguments[i] = replacedArgument;
            }

            if (replacedGenericArguments != null)
            {
                return(GenericTypeDefinition.GetConstructedGenericTypeData(replacedGenericArguments));
            }

            return(this);
        }