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

TypeParameter() public method

public TypeParameter ( string type, int position ) : TypeReference
type string
position int
return TypeReference
        public TypeReference TypeParameter(string type, int position)
        {
            for (int i = stack.Count - 1; i >= 0; i--) {
                var candidate = GenericTypeFor (stack [i]);

                if (candidate.FullName != type)
                    continue;

                return candidate.GenericParameters [position];
            }

            throw new InvalidOperationException ();
        }

Usage Example

Esempio n. 1
0
 private static TypeReference ImportGenericParameter(Type type, ImportGenericContext context)
 {
     if (context.IsEmpty)
     {
         throw new InvalidOperationException();
     }
     if (type.DeclaringMethod != null)
     {
         return(context.MethodParameter(type.DeclaringMethod.Name, type.GenericParameterPosition));
     }
     if (type.DeclaringType == null)
     {
         throw new InvalidOperationException();
     }
     return(context.TypeParameter(NormalizedFullName(type.DeclaringType), type.GenericParameterPosition));
 }
All Usage Examples Of Mono.Cecil.ImportGenericContext::TypeParameter