C# Class IronPython.Runtime.Binding.BindingHelpers

Common helpers used by the various binding logic.
Mostrar archivo Open project: jschementi/iron Class Usage Examples

Public Methods

Method Description
Invoke ( Expression codeContext, PythonContext binder, Type resultType, CallSignature signature ) : Expression

Private Methods

Method Description
AddDynamicTestAndDefer ( DynamicMetaObjectBinder operation, DynamicMetaObject res, DynamicMetaObject args, ValidationInfo typeTest ) : DynamicMetaObject
AddDynamicTestAndDefer ( DynamicMetaObjectBinder operation, DynamicMetaObject res, DynamicMetaObject args, ValidationInfo typeTest, Type deferType ) : DynamicMetaObject
AddPythonBoxing ( DynamicMetaObject res ) : DynamicMetaObject
AddPythonBoxing ( Expression res ) : Expression
AddRecursionCheck ( PythonContext pyContext, Expression expr ) : Expression

Adds a try/finally which enforces recursion limits around the target method.

CallInfoToSignature ( CallInfo callInfo ) : CallSignature
CheckLightThrow ( DynamicMetaObjectBinder call, DynamicMetaObject res, BindingTarget target ) : IronPython.Runtime.Types.BuiltinFunction.BindingResult
CheckLightThrowMO ( DynamicMetaObjectBinder call, DynamicMetaObject res, BindingTarget target ) : DynamicMetaObject
CheckTypeVersion ( Expression tested, int version ) : MethodCallExpression
CreateBinderStateExpression ( ) : Expression
FilterShowCls ( DynamicMetaObject codeContext, DynamicMetaObjectBinder action, DynamicMetaObject res, Expression failure ) : DynamicMetaObject
GenericInvokeMember ( InvokeMemberBinder action, ValidationInfo valInfo, DynamicMetaObject target, DynamicMetaObject args ) : DynamicMetaObject

Transforms an invoke member into a Python GetMember/Invoke. The caller should verify that the given attribute is not resolved against a normal .NET class before calling this. If it is a normal .NET member then a fallback InvokeMember is preferred.

GetCallSignature ( DynamicMetaObjectBinder action ) : CallSignature

Gets the best CallSignature from a MetaAction. The MetaAction should be either a Python InvokeBinder, or a DLR InvokeAction or CreateAction. For Python we can use a full-fidelity

GetComArgument ( DynamicMetaObject arg ) : DynamicMetaObject

Converts a single argument into a form which can be used for COM interop. The argument is only converted if we have an IronPython specific conversion when calling COM methods.

GetComArguments ( DynamicMetaObject args ) : System.Dynamic.DynamicMetaObject[]

Converts arguments into a form which can be used for COM interop. The argument is only converted if we have an IronPython specific conversion when calling COM methods.

GetCompatibleType ( Type t, Type otherType ) : Type
GetValidationInfo ( ) : ValidationInfo
GetValidationInfo ( DynamicMetaObject tested, IronPython.Runtime.Types.PythonType type ) : ValidationInfo
InvokeFallback ( DynamicMetaObjectBinder action, Expression codeContext, DynamicMetaObject target, DynamicMetaObject args ) : DynamicMetaObject

Helper to do fallback for Invoke's so we can handle both StandardAction and Python's InvokeBinder.

IsDataMember ( object p ) : bool
IsNoThrow ( DynamicMetaObjectBinder action ) : bool
IsSubclassOf ( DynamicMetaObject xType, DynamicMetaObject yType ) : bool

Determines if the type associated with the first MetaObject is a subclass of the type associated with the second MetaObject.

NeedsDeferral ( DynamicMetaObject args ) : bool
TryConvertToBuiltinFunction ( object o ) : IronPython.Runtime.Types.BuiltinFunction
TryGetStaticFunction ( PythonContext state, string op, DynamicMetaObject mo, IronPython.Runtime.Types.BuiltinFunction &function ) : bool

Tries to get the BuiltinFunction for the given name on the type of the provided MetaObject. Succeeds if the MetaObject is a BuiltinFunction or BuiltinMethodDescriptor.

TypeErrorForProtectedMember ( Type type, string name ) : Expression
TypeErrorGenericMethod ( Type type, string name, BindingRestrictions restrictions ) : DynamicMetaObject

Method Details

Invoke() public static method

public static Invoke ( Expression codeContext, PythonContext binder, Type resultType, CallSignature signature ) : Expression
codeContext Expression
binder PythonContext
resultType System.Type
signature CallSignature
return Expression