Mono.Cecil.ImportGenericContext.Push C# (CSharp) Method

Push() public method

public Push ( IGenericParameterProvider provider ) : void
provider IGenericParameterProvider
return void
        public void Push(IGenericParameterProvider provider)
        {
            if (stack == null)
                stack = new Collection<IGenericParameterProvider> (1) { provider };
            else
                stack.Add (provider);
        }

Usage Example

Esempio n. 1
0
        private TypeReference ImportGenericInstance(Type type, ImportGenericContext context)
        {
            TypeReference       reference2;
            TypeReference       reference = this.ImportType(type.GetGenericTypeDefinition(), context, ImportGenericKind.Definition);
            GenericInstanceType type2     = new GenericInstanceType(reference);

            Type[] genericArguments = type.GetGenericArguments();
            Collection <TypeReference> collection = type2.GenericArguments;

            context.Push(reference);
            try
            {
                int index = 0;
                while (true)
                {
                    if (index >= genericArguments.Length)
                    {
                        reference2 = type2;
                        break;
                    }
                    collection.Add(this.ImportType(genericArguments[index], context));
                    index++;
                }
            }
            finally
            {
                context.Pop();
            }
            return(reference2);
        }
All Usage Examples Of Mono.Cecil.ImportGenericContext::Push