Exemple #1
0
 internal GenericParameter(int position, Mono.Cecil.GenericParameterType type, ModuleDefinition module) : base(string.Empty, string.Empty)
 {
     if (module == null)
     {
         throw new ArgumentNullException();
     }
     this.position = position;
     this.type     = type;
     this.etype    = GenericParameter.ConvertGenericParameterType(type);
     this.module   = module;
     this.token    = new Mono.Cecil.MetadataToken(Mono.Cecil.TokenType.GenericParam);
 }
Exemple #2
0
 private static ElementType ConvertGenericParameterType(Mono.Cecil.GenericParameterType type)
 {
     if (type == Mono.Cecil.GenericParameterType.Type)
     {
         return(ElementType.Var);
     }
     if (type != Mono.Cecil.GenericParameterType.Method)
     {
         throw new ArgumentOutOfRangeException();
     }
     return(ElementType.MVar);
 }
Exemple #3
0
 public GenericParameter(string name, IGenericParameterProvider owner) : base(string.Empty, name)
 {
     if (owner == null)
     {
         throw new ArgumentNullException();
     }
     this.position = -1;
     this.owner    = owner;
     this.type     = owner.GenericParameterType;
     this.etype    = GenericParameter.ConvertGenericParameterType(this.type);
     this.token    = new Mono.Cecil.MetadataToken(Mono.Cecil.TokenType.GenericParam);
 }