public static MethodDefinition WithParameter(this MethodDefinition method, SystemTypeOrTypeReference paramType, string name = null)
        {
            var param = new ParameterDefinition(paramType.GetTypeReference(method.GetModule()));

            if (!string.IsNullOrEmpty(name))
            {
                param.Name = name;
            }
            method.Parameters.Add(param);
            return(method);
        }
Example #2
0
 public static TypeDefinition WithField(this TypeDefinition member, string name, SystemTypeOrTypeReference fieldType, FieldAttributes?attributes = null)
 {
     return(member.WithFieldInternal(name, fieldType, attributes));
 }