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