當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。