@@ -19,6 +19,7 @@ internal class MethodBinder
19
19
public MethodBase [ ] methods ;
20
20
public bool init = false ;
21
21
public bool allow_threads = true ;
22
+ readonly IPyArgumentConverter pyArgumentConverter = DefaultPyArgumentConverter . Instance ;
22
23
23
24
internal MethodBinder ( )
24
25
{
@@ -326,7 +327,7 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth
326
327
continue ;
327
328
}
328
329
var outs = 0 ;
329
- var margs = TryConvertArguments ( pi , paramsArray , args , pynargs , kwargDict , defaultArgList ,
330
+ var margs = this . TryConvertArguments ( pi , paramsArray , args , pynargs , kwargDict , defaultArgList ,
330
331
needsResolution : _methods . Length > 1 ,
331
332
outs : out outs ) ;
332
333
@@ -382,7 +383,7 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth
382
383
/// <param name="needsResolution"><c>true</c>, if overloading resolution is required</param>
383
384
/// <param name="outs">Returns number of output parameters</param>
384
385
/// <returns>An array of .NET arguments, that can be passed to a method.</returns>
385
- static object [ ] TryConvertArguments ( ParameterInfo [ ] pi , bool paramsArray ,
386
+ object [ ] TryConvertArguments ( ParameterInfo [ ] pi , bool paramsArray ,
386
387
IntPtr args , int pyArgCount ,
387
388
Dictionary < string , IntPtr > kwargDict ,
388
389
ArrayList defaultArgList ,
@@ -423,7 +424,9 @@ static object[] TryConvertArguments(ParameterInfo[] pi, bool paramsArray,
423
424
}
424
425
425
426
bool isOut ;
426
- if ( ! TryConvertArgument ( op , parameter . ParameterType , needsResolution , out margs [ paramIndex ] , out isOut ) )
427
+ if ( ! this . pyArgumentConverter . TryConvertArgument (
428
+ op , parameter . ParameterType , needsResolution ,
429
+ out margs [ paramIndex ] , out isOut ) )
427
430
{
428
431
return null ;
429
432
}
@@ -445,7 +448,7 @@ static object[] TryConvertArguments(ParameterInfo[] pi, bool paramsArray,
445
448
return margs ;
446
449
}
447
450
448
- static bool TryConvertArgument ( IntPtr op , Type parameterType , bool needsResolution ,
451
+ internal static bool TryConvertArgument ( IntPtr op , Type parameterType , bool needsResolution ,
449
452
out object arg , out bool isOut )
450
453
{
451
454
arg = null ;
0 commit comments