本文整理汇总了C#中DynamicMetaObjectBinder.GetUpdateExpression方法的典型用法代码示例。如果您正苦于以下问题:C# DynamicMetaObjectBinder.GetUpdateExpression方法的具体用法?C# DynamicMetaObjectBinder.GetUpdateExpression怎么用?C# DynamicMetaObjectBinder.GetUpdateExpression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicMetaObjectBinder
的用法示例。
在下文中一共展示了DynamicMetaObjectBinder.GetUpdateExpression方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConversionFallback
private Expression ConversionFallback(DynamicMetaObjectBinder/*!*/ convertToAction) {
PythonConversionBinder cb = convertToAction as PythonConversionBinder;
if (cb != null) {
return GetConversionFailedReturnValue(cb, this).Expression;
}
return convertToAction.GetUpdateExpression(typeof(object));
}
示例2: AddDynamicTestAndDefer
internal static DynamicMetaObject/*!*/ AddDynamicTestAndDefer(DynamicMetaObjectBinder/*!*/ operation, DynamicMetaObject/*!*/ res, DynamicMetaObject/*!*/[] args, ValidationInfo typeTest, Type deferType, params ParameterExpression[] temps) {
if (typeTest != null) {
if (typeTest.Test != null) {
// add the test and a validator if persent
Expression defer = operation.GetUpdateExpression(deferType ?? typeof(object));
Type bestType = BindingHelpers.GetCompatibleType(defer.Type, res.Expression.Type);
res = new DynamicMetaObject(
Ast.Condition(
typeTest.Test,
AstUtils.Convert(res.Expression, bestType),
AstUtils.Convert(defer, bestType)
),
res.Restrictions
);
}
}
if (temps.Length > 0) {
// finally add the scoped variables
res = new DynamicMetaObject(
Ast.Block(temps, res.Expression),
res.Restrictions,
null
);
}
return res;
}