Ejemplo n.º 1
0
 object Convert(TaskArgument arg, int position, ParameterInfo parameter)
 {
     try
     {
         return arg.Convert(parameter.ParameterType);
     }
     catch (InvalidCastException e)
     {
         throw new TaskArgumentException(task, parameter.Name, position, e.Message);
     }
     catch (FormatException e)
     {
         throw new TaskArgumentException(task, parameter.Name, position, e.Message);
     }
     catch (ArgumentException e)
     {
         throw new TaskArgumentException(task, parameter.Name, position, e.Message);
     }
     catch (OverflowException e)
     {
         throw new TaskArgumentException(task, parameter.Name, position, e.Message);
     }
 }