本文整理汇总了C#中Mono.CSharp.Arguments.CreateDynamicBinderArguments方法的典型用法代码示例。如果您正苦于以下问题:C# Arguments.CreateDynamicBinderArguments方法的具体用法?C# Arguments.CreateDynamicBinderArguments怎么用?C# Arguments.CreateDynamicBinderArguments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.Arguments
的用法示例。
在下文中一共展示了Arguments.CreateDynamicBinderArguments方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateCallSiteBinder
protected override Expression CreateCallSiteBinder(ResolveContext ec, Arguments args, bool isSet)
{
Arguments binder_args = new Arguments (4);
binder_args.Add (new Argument (new BinderFlags (0, this)));
binder_args.Add (new Argument (new StringLiteral (name, loc)));
binder_args.Add (new Argument (new TypeOf (new TypeExpression (ec.CurrentType, loc), loc)));
binder_args.Add (new Argument (new ImplicitlyTypedArrayCreation ("[]", args.CreateDynamicBinderArguments (ec), loc)));
return new Invocation (GetBinder (isSet ? "SetMember" : "GetMember", loc), binder_args);
}
示例2: CreateCallSiteBinder
public Expression CreateCallSiteBinder (ResolveContext ec, Arguments args)
{
Arguments binder_args = new Arguments (3);
MemberAccess sle = new MemberAccess (new MemberAccess (
new QualifiedAliasMember (QualifiedAliasMember.GlobalAlias, "System", loc), "Linq", loc), "Expressions", loc);
MemberAccess binder = GetBinderNamespace (loc);
binder_args.Add (new Argument (new MemberAccess (new MemberAccess (sle, "ExpressionType", loc), name, loc)));
binder_args.Add (new Argument (new BoolLiteral (ec.HasSet (ResolveContext.Options.CheckedScope), loc)));
binder_args.Add (new Argument (new ImplicitlyTypedArrayCreation ("[]", args.CreateDynamicBinderArguments (), loc)));
return new New (new MemberAccess (binder, "CSharpUnaryOperationBinder", loc), binder_args, loc);
}
示例3: CreateCallSiteBinder
protected override Expression CreateCallSiteBinder (ResolveContext ec, Arguments args, bool isSet)
{
Arguments binder_args = new Arguments (4);
binder_args.Add (new Argument (new BinderFlags (flags, this)));
binder_args.Add (new Argument (new StringLiteral (ec.BuiltinTypes, name, loc)));
binder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));
binder_args.Add (new Argument (new ImplicitlyTypedArrayCreation (args.CreateDynamicBinderArguments (ec), loc)));
isSet |= (flags & CSharpBinderFlags.ValueFromCompoundAssignment) != 0;
return new Invocation (GetBinder (isSet ? "SetMember" : "GetMember", loc), binder_args);
}
示例4: CreateCallSiteBinder
public Expression CreateCallSiteBinder (ResolveContext ec, Arguments args)
{
Arguments binder_args = new Arguments (4);
MemberAccess ns;
if (ec.Module.PredefinedTypes.IsPlayScriptAotMode) {
ns = new QualifiedAliasMember (QualifiedAliasMember.GlobalAlias, "PlayScript", loc);
} else {
ns = new MemberAccess (new MemberAccess (
new QualifiedAliasMember (QualifiedAliasMember.GlobalAlias, "System", loc), "Linq", loc), "Expressions", loc);
}
var flags = ec.HasSet (ResolveContext.Options.CheckedScope) ? CSharpBinderFlags.CheckedContext : 0;
binder_args.Add (new Argument (new BinderFlags (flags, this)));
binder_args.Add (new Argument (new MemberAccess (new MemberAccess (ns, "ExpressionType", loc), name, loc)));
binder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));
binder_args.Add (new Argument (new ImplicitlyTypedArrayCreation (args.CreateDynamicBinderArguments (ec), loc)));
return new Invocation (GetBinder ("UnaryOperation", loc), binder_args);
}
示例5: CreateCallSiteBinder
public Expression CreateCallSiteBinder (ResolveContext ec, Arguments args)
{
Statement.DynamicOps |= DynamicOperation.InvokeConstructor;
Arguments binder_args = new Arguments (3);
binder_args.Add (new Argument (new BinderFlags (0, this)));
if (typeExpr != null) {
binder_args.Add (new Argument (typeExpr));
} else {
binder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));
}
binder_args.Add (new Argument (new ImplicitlyTypedArrayCreation (args.CreateDynamicBinderArguments (ec), loc)));
return new Invocation (GetBinder ("InvokeConstructor", loc), binder_args);
}
示例6: DoResolveLValue
public override Expression DoResolveLValue (ResolveContext rc, Expression right_side)
{
if (right_side == EmptyExpression.OutAccess) {
right_side.DoResolveLValue (rc, this);
return null;
}
var res_right_side = right_side.Resolve (rc);
if (DoResolveCore (rc) && res_right_side != null) {
setter_args = CreateSetterArguments (rc, res_right_side);
// create setter callsite
var dc = (binder as IDynamicCallSite);
if (rc.Module.PredefinedTypes.IsPlayScriptAotMode && (dc != null) && dc.UseCallSite(rc, setter_args)) {
this.useDelegateInvoke = false;
setter_args.CreateDynamicBinderArguments(rc);
setter = CreateCallSite(rc, setter_args, true);
} else {
this.useDelegateInvoke = true;
setter = CreateCallSiteBinder (rc, setter_args, true);
}
}
eclass = ExprClass.Variable;
return this;
}