Ejemplo n.º 1
0
        TypeTypeParameter[] MakeTypeParameters()
        {
            var newTypeParams = new TypeTypeParameter[ThisTypeParameters];

            for (int i = 0; i < newTypeParams.Length; ++i)
            {
                newTypeParams[i] = new TypeTypeParameter(this, this, i);
            }
            return(newTypeParams);
        }
        public static TypeTypeParameter[] MakeTypeParameters(Type container, int count)
        {
            var newTypeParams = new TypeTypeParameter[count];

            for (var i = 0; i < newTypeParams.Length; ++i)
            {
                newTypeParams[i] = new TypeTypeParameter(container, i);
            }
            return(newTypeParams);
        }
Ejemplo n.º 3
0
        IEnumerable <TypeTypeParameter> MakeTypeParameters()
        {
            if (ThisTypeParameters == 0)
            {
                return(Enumerable.Empty <TypeTypeParameter>());
            }

            var newTypeParams = new TypeTypeParameter[ThisTypeParameters];
            var genericParams = td.GetGenericParameters();
            int toSkip        = genericParams.Count - newTypeParams.Length;

            // Two-phase population because type parameters can be mutually dependent
            for (int i = 0; i < newTypeParams.Length; ++i)
            {
                newTypeParams[i] = cx.Populate(new TypeTypeParameter(this, this, i));
            }
            for (int i = 0; i < newTypeParams.Length; ++i)
            {
                newTypeParams[i].PopulateHandle(this, genericParams[i + toSkip]);
            }
            return(newTypeParams);
        }