public HandlerParameterCodec(IEmittingContext emittingContext, MethodParameterDescription description)
 {
     this.emittingContext = emittingContext;
     type = description.Type;
     way = description.Way;
     codec = new IndirectCodec(type);
     if (IsResponseParameter)
         local = emittingContext.IL.DeclareLocal(type);
 }
 public ProxyMethodParameterCodec(MethodParameterDescription description)
 {
     type     = description.Type;
     way      = description.Way;
     argIndex = description.Index + 1;
     codec    = new IndirectCodec(type);
     emitLoad = description.Way == MethodParameterWay.Val
         ? Loaders.Argument(argIndex)
         : Loaders.ArgumentRef(argIndex, description.Type);
 }
 public ProxyMethodParameterCodec(MethodParameterDescription description)
 {
     type = description.Type;
     way = description.Way;
     argIndex = description.Index + 1;
     codec = new IndirectCodec(type);
     emitLoad = description.Way == MethodParameterWay.Val
         ? Loaders.Argument(argIndex)
         : Loaders.ArgumentRef(argIndex, description.Type);
 }
 public MethodParameterDescription(int index, Type type, string name, MethodParameterWay way = MethodParameterWay.Val)
 {
     Index = index;
     if (type == null)
         throw new ArgumentNullException("type");
     if (string.IsNullOrWhiteSpace(name))
         throw new ArgumentException("Method parameter name cannot be null, empty, or consist of whitespace characters");
     Type = type;
     Name = name;
     Way = way;
 }
Beispiel #5
0
 public HandlerParameterCodec(IEmittingContext emittingContext, MethodParameterDescription description)
 {
     this.emittingContext = emittingContext;
     type  = description.Type;
     way   = description.Way;
     codec = new IndirectCodec(type);
     if (IsResponseParameter)
     {
         local = emittingContext.IL.DeclareLocal(type);
     }
 }
 public MethodParameterDescription(Type type, string name, MethodParameterWay way = MethodParameterWay.Val)
 {
     if (type == null)
         throw new ArgumentNullException("type");
     if (string.IsNullOrWhiteSpace(name))
         throw new ArgumentException("Method parameter name cannot be null, empty, or consist of whitespace characters");
     if (!Expressions.Name.IsMatch(name))
         throw new ArgumentException(string.Format("'{0}' is not a valid method parameter name", name), "name");
     Type = type;
     Name = name;
     Way = way;
 }
Beispiel #7
0
 public MethodParameterDescription(Type type, string name, MethodParameterWay way = MethodParameterWay.Val)
 {
     if (type == null)
     {
         throw new ArgumentNullException("type");
     }
     if (string.IsNullOrWhiteSpace(name))
     {
         throw new ArgumentException("Method parameter name cannot be null, empty, or consist of whitespace characters");
     }
     Type = type;
     Name = name;
     Way  = way;
 }