本文整理汇总了C#中Mono.CSharp.Expression.MakeExpression方法的典型用法代码示例。如果您正苦于以下问题:C# Expression.MakeExpression方法的具体用法?C# Expression.MakeExpression怎么用?C# Expression.MakeExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.Expression
的用法示例。
在下文中一共展示了Expression.MakeExpression方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Bind
public DynamicMetaObject Bind (DynamicContext ctx, Type callingType)
{
Expression res;
try {
var rc = new Compiler.ResolveContext (new RuntimeBinderContext (ctx, callingType), ResolveOptions);
// Static typemanager and internal caches are not thread-safe
lock (resolver) {
expr = expr.Resolve (rc, Compiler.ResolveFlags.VariableOrValue);
}
if (expr == null)
throw new RuntimeBinderInternalCompilerException ("Expression resolved to null");
res = expr.MakeExpression (new Compiler.BuilderContext ());
} catch (RuntimeBinderException e) {
if (errorSuggestion != null)
return errorSuggestion;
res = CreateBinderException (e.Message);
} catch (Exception) {
if (errorSuggestion != null)
return errorSuggestion;
throw;
}
return new DynamicMetaObject (res, restrictions);
}
示例2: MakeExpression
public static SLE.Expression MakeExpression (BuilderContext ctx, Expression instance, MethodSpec mi, Arguments args)
{
#if STATIC
throw new NotSupportedException ();
#else
var instance_expr = instance == null ? null : instance.MakeExpression (ctx);
return SLE.Expression.Call (instance_expr, (MethodInfo) mi.GetMetaInfo (), Arguments.MakeExpression (args, ctx));
#endif
}