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


C# Dynamic.BindingRestrictions类代码示例

本文整理汇总了C#中System.Dynamic.BindingRestrictions的典型用法代码示例。如果您正苦于以下问题:C# BindingRestrictions类的具体用法?C# BindingRestrictions怎么用?C# BindingRestrictions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BindingRestrictions类属于System.Dynamic命名空间,在下文中一共展示了BindingRestrictions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ThrowArgumentException

 private static DynamicMetaObject ThrowArgumentException(string message, BindingRestrictions restrictions)
 {
     var ctorInfo = typeof(InvalidOperationException).GetConstructor(new[] { typeof(string) });
     return new DynamicMetaObject(
         Expression.Throw(Expression.New(ctorInfo, Expression.Constant(message)), typeof(object)),
         restrictions);
 }
开发者ID:irxground,项目名称:kurogane,代码行数:7,代码来源:MapBinder.cs

示例2: CSharpBinder

		public CSharpBinder (DynamicMetaObjectBinder binder, Compiler.Expression expr, DynamicMetaObject errorSuggestion)
		{
			this.binder = binder;
			this.expr = expr;
			this.restrictions = BindingRestrictions.Empty;
			this.errorSuggestion = errorSuggestion;
		}
开发者ID:bbqchickenrobot,项目名称:playscript-mono,代码行数:7,代码来源:CSharpBinder.cs

示例3: DynamicMetaObject

        /// <summary>
        /// Initializes a new instance of the <see cref="DynamicMetaObject"/> class.
        /// </summary>
        /// <param name="expression">The expression representing this <see cref="DynamicMetaObject"/> during the dynamic binding process.</param>
        /// <param name="restrictions">The set of binding restrictions under which the binding is valid.</param>
        public DynamicMetaObject(Expression expression, BindingRestrictions restrictions) {
            ContractUtils.RequiresNotNull(expression, "expression");
            ContractUtils.RequiresNotNull(restrictions, "restrictions");

            _expression = expression;
            _restrictions = restrictions;
        }
开发者ID:joshholmes,项目名称:ironruby,代码行数:12,代码来源:DynamicMetaObject.cs

示例4: ComInvokeBinder

        internal ComInvokeBinder(
                CallInfo callInfo, 
                DynamicMetaObject[] args,
                bool[] isByRef,
                BindingRestrictions restrictions, 
                Expression method, 
                Expression dispatch, 
                ComMethodDesc methodDesc
                )
        {
            Debug.Assert(callInfo != null, "arguments");
            Debug.Assert(args != null, "args");
            Debug.Assert(isByRef != null, "isByRef");
            Debug.Assert(method != null, "method");
            Debug.Assert(dispatch != null, "dispatch");

            Debug.Assert(TypeUtils.AreReferenceAssignable(typeof(ComMethodDesc), method.Type), "method");
            Debug.Assert(TypeUtils.AreReferenceAssignable(typeof(IDispatch), dispatch.Type), "dispatch");

            _method = method;
            _dispatch = dispatch;
            _methodDesc = methodDesc;

            _callInfo = callInfo;
            _args = args;
            _isByRef = isByRef;
            _restrictions = restrictions;

            // Set Instance to some value so that CallBinderHelper has the right number of parameters to work with
            _instance = dispatch;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:31,代码来源:ComInvokeBinder.cs

示例5: SmalltalkDynamicMetaObject

 public SmalltalkDynamicMetaObject(Expression expression, BindingRestrictions restrictions, SmalltalkClass cls, object value)
     : base(expression, restrictions, value)
 {
     if (cls == null)
         throw new ArgumentNullException("cls");
     this.Class = cls;
 }
开发者ID:erlis,项目名称:IronSmalltalk,代码行数:7,代码来源:SmalltalkDynamicMetaObject.cs

示例6: DynamicMetaObject

 public DynamicMetaObject(System.Linq.Expressions.Expression expression, BindingRestrictions restrictions)
 {
     ContractUtils.RequiresNotNull(expression, "expression");
     ContractUtils.RequiresNotNull(restrictions, "restrictions");
     this._expression = expression;
     this._restrictions = restrictions;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:DynamicMetaObject.cs

示例7: TableMetaObject

 public TableMetaObject(
     Expression expression,
     BindingRestrictions restrictions,
     Table value)
     : base(expression, restrictions, value)
 {
 }
开发者ID:jeffpanici75,项目名称:Tsuki,代码行数:7,代码来源:TableMetaObject.cs

示例8: MetaObjectBuilder

 public MetaObjectBuilder(SilverMetaObject target, DynamicMetaObject[] args)
 {
     _restrictions = null;
     if (target.Restrictions != BindingRestrictions.Empty) {
         _restrictions = target.Restrictions;
     }
 }
开发者ID:shadowphoenix,项目名称:IronSilver,代码行数:7,代码来源:MetaObjectBuilder.cs

示例9: MetaObjectBuilder

        internal MetaObjectBuilder(DynamicMetaObject target, params DynamicMetaObject/*!*/[]/*!*/ arguments) {
            var restrictions = BindingRestrictions.Combine(arguments);
            if (target != null) {
                restrictions = target.Restrictions.Merge(restrictions);
            }

            _restrictions = restrictions;
        }
开发者ID:toddb,项目名称:ironruby,代码行数:8,代码来源:MetaObjectBuilder.cs

示例10: Clear

 private void Clear() {
     _condition = null;
     _restrictions = BindingRestrictions.Empty;
     _result = null;
     _initializations = null;
     _error = false;
     _treatRestrictionsAsConditions = false;
 }
开发者ID:madpilot,项目名称:ironruby,代码行数:8,代码来源:MetaObjectBuilder.cs

示例11: DynamicMetaObject

        /// <summary>
        /// Initializes a new instance of the <see cref="DynamicMetaObject"/> class.
        /// </summary>
        /// <param name="expression">The expression representing this <see cref="DynamicMetaObject"/> during the dynamic binding process.</param>
        /// <param name="restrictions">The set of binding restrictions under which the binding is valid.</param>
        public DynamicMetaObject(Expression expression, BindingRestrictions restrictions)
        {
            ContractUtils.RequiresNotNull(expression, nameof(expression));
            ContractUtils.RequiresNotNull(restrictions, nameof(restrictions));

            Expression = expression;
            Restrictions = restrictions;
        }
开发者ID:chcosta,项目名称:corefx,代码行数:13,代码来源:DynamicMetaObject.cs

示例12: InferenceResult

        public InferenceResult(Type type, BindingRestrictions restrictions)
        {
            ContractUtils.RequiresNotNull(type, "type");
            ContractUtils.RequiresNotNull(restrictions, "restrictions");

            _type = type;
            _restrictions = restrictions;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:TypeInferer.cs

示例13: CallMethod

 /// <summary>
 /// Performs binding against a set of overloaded methods using the specified arguments.  The arguments are
 /// consumed as specified by the CallSignature object.
 /// </summary>
 /// <param name="resolver">Overload resolver.</param>
 /// <param name="targets">The methods to be called</param>
 /// <param name="restrictions">Additional restrictions which should be applied to the resulting MetaObject.</param>
 /// <returns>A meta object which results from the call.</returns>
 public DynamicMetaObject CallMethod(DefaultOverloadResolver resolver, IList<MethodBase> targets, BindingRestrictions restrictions) {
     return CallMethod(
         resolver,
         targets,
         restrictions,
         null
     );
 }
开发者ID:jschementi,项目名称:iron,代码行数:16,代码来源:DefaultBinder.MethodCalls.cs

示例14: TryAllConversions

 /// <summary>
 /// Checks if any conversions are available and if so builds the target for that conversion.
 /// </summary>
 private DynamicMetaObject TryAllConversions(Type toType, ConversionResultKind kind, Type knownType, BindingRestrictions restrictions, DynamicMetaObject arg) {
     return
         TryAssignableConversion(toType, knownType, restrictions, arg) ??           // known type -> known type
         TryExtensibleConversion(toType, knownType, restrictions, arg) ??           // Extensible<T> -> Extensible<T>.Value
         TryUserDefinedConversion(kind, toType, knownType, restrictions, arg) ??    // op_Implicit
         TryImplicitNumericConversion(toType, knownType, restrictions, arg) ??      // op_Implicit
         TryNullableConversion(toType, kind, knownType, restrictions, arg) ??       // null -> Nullable<T> or T -> Nullable<T>
         TryNullConversion(toType, knownType, restrictions);                        // null -> reference type
 }
开发者ID:Hank923,项目名称:ironruby,代码行数:12,代码来源:DefaultBinder.Conversions.cs

示例15: TryAssignableConversion

        /// <summary>
        /// Checks if the conversion can be handled by a simple cast.
        /// </summary>
        private static DynamicMetaObject TryAssignableConversion(Type toType, Type type, BindingRestrictions restrictions, DynamicMetaObject arg) {
            if (toType.IsAssignableFrom(type) ||
                (type == typeof(DynamicNull) && (toType.IsClass || toType.IsInterface))) {
                // MakeSimpleConversionTarget handles the ConversionResultKind check
                return MakeSimpleConversionTarget(toType, restrictions, arg);
            }

            return null;
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:12,代码来源:DefaultBinder.Conversions.cs


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