当前位置: 首页>>代码示例>>C#>>正文


C# Arguments.CreateDynamicBinderArguments方法代码示例

本文整理汇总了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);
        }
开发者ID:speier,项目名称:shake,代码行数:11,代码来源:dynamic.cs

示例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);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:15,代码来源:dynamic.cs

示例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);
		}
开发者ID:caomw,项目名称:mono,代码行数:12,代码来源:dynamic.cs

示例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);
		}
开发者ID:bbqchickenrobot,项目名称:playscript-mono,代码行数:21,代码来源:dynamic.cs

示例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);
		}
开发者ID:rlfqudxo,项目名称:playscript-mono,代码行数:16,代码来源:dynamic.cs

示例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;
		}
开发者ID:rlfqudxo,项目名称:playscript-mono,代码行数:27,代码来源:dynamic.cs


注:本文中的Mono.CSharp.Arguments.CreateDynamicBinderArguments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。