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


C# ActionBinder.ReturnMemberTracker方法代码示例

本文整理汇总了C#中Microsoft.Scripting.Actions.ActionBinder.ReturnMemberTracker方法的典型用法代码示例。如果您正苦于以下问题:C# ActionBinder.ReturnMemberTracker方法的具体用法?C# ActionBinder.ReturnMemberTracker怎么用?C# ActionBinder.ReturnMemberTracker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Scripting.Actions.ActionBinder的用法示例。


在下文中一共展示了ActionBinder.ReturnMemberTracker方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetValue

        public override DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type) {
            if (!IsStatic || GetIndexParameters().Length > 0) {
                // need to bind to a value or parameters to get the value.
                return binder.ReturnMemberTracker(type, this);
            }

            MethodInfo getter = ResolveGetter(binder.PrivateBinding);
            if (getter == null || getter.ContainsGenericParameters) {
                // no usable getter
                return null;
            }

            if (getter.IsPublic && getter.DeclaringType.IsPublic) {
                return binder.MakeCallExpression(resolverFactory, getter);
            }

            // private binding is just a call to the getter method...
            return MemberTracker.FromMemberInfo(getter).Call(resolverFactory, binder);
        }
开发者ID:jschementi,项目名称:iron,代码行数:19,代码来源:PropertyTracker.cs

示例2: GetBoundValue

 protected internal override Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) {
     return binder.ReturnMemberTracker(type, BindToInstance(instance));
 }
开发者ID:bclubb,项目名称:ironruby,代码行数:3,代码来源:MethodTracker.cs

示例3: GetBoundValue

 protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance)
 {
     return binder.ReturnMemberTracker(type, BindToInstance(instance));
 }
开发者ID:TerabyteX,项目名称:main,代码行数:4,代码来源:MethodGroup.cs

示例4: GetValue

        public override DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type) {
            if (Field.IsLiteral) {
                return new DynamicMetaObject(
                    AstUtils.Constant(Field.GetValue(null), typeof(object)),
                    BindingRestrictions.Empty
                );
            }

            if (!IsStatic) {
                // return the field tracker...
                return binder.ReturnMemberTracker(type, this);
            }

            if (Field.DeclaringType.ContainsGenericParameters) {
                return null;
            }

            if (IsPublic && DeclaringType.IsPublic) {
                return new DynamicMetaObject(
                    Ast.Convert(Ast.Field(null, Field), typeof(object)),
                    BindingRestrictions.Empty
                );
            }

            return new DynamicMetaObject(
                Ast.Call(
                    AstUtils.Convert(AstUtils.Constant(Field), typeof(FieldInfo)),
                    typeof(FieldInfo).GetMethod("GetValue"),
                    AstUtils.Constant(null)
                ),
                BindingRestrictions.Empty
            );
        }
开发者ID:apboyle,项目名称:ironruby,代码行数:33,代码来源:FieldTracker.cs

示例5: GetValue

 /// <summary>
 /// Gets the expression that creates the value.  
 /// 
 /// Returns null if it's an error to get the value.  The caller can then call GetErrorForGet to get 
 /// the correct error Expression (or null if they should provide a default).
 /// </summary>
 public virtual DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type) {
     return binder.ReturnMemberTracker(type, this);
 }
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:9,代码来源:MemberTracker.cs

示例6: GetValue

        public override Expression GetValue(Expression context, ActionBinder binder, Type type) {
            if (Field.IsLiteral) {
                return AstUtils.Constant(Field.GetValue(null), typeof(object));
            }

            if (!IsStatic) {
                // return the field tracker...
                return binder.ReturnMemberTracker(type, this);
            }

            if (Field.DeclaringType.ContainsGenericParameters) {
                return null;
            }

            if (IsPublic && DeclaringType.IsPublic) {
                return Ast.Convert(Ast.Field(null, Field), typeof(object));
            }

            return Ast.Call(
                AstUtils.Convert(AstUtils.Constant(Field), typeof(FieldInfo)),
                typeof(FieldInfo).GetMethod("GetValue"),
                AstUtils.Constant(null)
            );
        }
开发者ID:Hank923,项目名称:ironruby,代码行数:24,代码来源:FieldTracker.cs

示例7: GetBoundValue

 internal override Expression GetBoundValue(ActionBinder binder, Type type, Expression instance) {
     return binder.ReturnMemberTracker(type, new BoundMemberTracker(this, instance));
 }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:3,代码来源:EventTracker.cs

示例8: GetBoundValue

        protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance) {
            if (instance != null && IsStatic) {
                return null;
            }

            if (GetIndexParameters().Length > 0) {
                // need to bind to a value or parameters to get the value.
                return binder.ReturnMemberTracker(type, BindToInstance(instance));
            }

            MethodInfo getter = GetGetMethod(true);
            if (getter == null || getter.ContainsGenericParameters) {
                // no usable getter
                return null;
            }

            getter = CompilerHelpers.TryGetCallableMethod(getter);

            var defaultBinder = (DefaultBinder)binder;
            if (binder.PrivateBinding || CompilerHelpers.IsVisible(getter)) {
                return defaultBinder.MakeCallExpression(resolverFactory, getter, instance);
            }

            // private binding is just a call to the getter method...
            return DefaultBinder.MakeError(defaultBinder.MakeNonPublicMemberGetError(resolverFactory, this, type, instance), BindingRestrictions.Empty, typeof(object));
        }
开发者ID:jschementi,项目名称:iron,代码行数:26,代码来源:PropertyTracker.cs

示例9: GetValue

 /// <summary>
 /// Gets the expression that creates the value.  
 /// 
 /// Returns null if it's an error to get the value.  The caller can then call GetErrorForGet to get 
 /// the correct error Expression (or null if they should provide a default).
 /// </summary>
 public virtual Expression GetValue(Expression context, ActionBinder binder, Type type) {
     return binder.ReturnMemberTracker(type, this);
 }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:9,代码来源:MemberTracker.cs

示例10: GetValue

        public override Expression GetValue(ActionBinder binder, Type type) {
            if (Field.IsLiteral) {
                return Ast.Constant(Field.GetValue(null));
            }

            if (!IsStatic) {
                // return the field tracker...
                return binder.ReturnMemberTracker(type, this);
            }

            if (IsPublic && DeclaringType.IsPublic) {
                return Ast.ReadField(null, Field);
            }

            return Ast.Call(
                Ast.ConvertHelper(Ast.RuntimeConstant(Field), typeof(FieldInfo)),
                typeof(FieldInfo).GetMethod("GetValue"),
                Ast.Null()
            );
        }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:20,代码来源:FieldTracker.cs

示例11: GetBoundValue

        protected internal override Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) {
            if (instance != null && IsStatic) {
                return null;
            }

            if (GetIndexParameters().Length > 0) {
                // need to bind to a value or parameters to get the value.
                return binder.ReturnMemberTracker(type, BindToInstance(instance));
            }

            MethodInfo getter = GetGetMethod(true);
            if (getter == null || getter.ContainsGenericParameters) {
                // no usable getter
                return null;
            }

            getter = CompilerHelpers.TryGetCallableMethod(getter);

            if (binder.PrivateBinding || CompilerHelpers.IsVisible(getter)) {
                return binder.MakeCallExpression(context, getter, instance);
            }

            // private binding is just a call to the getter method...
            return DefaultBinder.MakeError(((DefaultBinder)binder).MakeNonPublicMemberGetError(context, this, type, instance));
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:25,代码来源:PropertyTracker.cs


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