public ReturnMemberTracker ( |
||
type | Tthe type which the memberTrack was accessed from | |
memberTracker | The member which is being returned to the user. | |
return |
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); }
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 )); }
public override Expression GetValue(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(); if (getter == null || getter.ContainsGenericParameters) { // no usable getter return(null); } if (getter.IsPublic && getter.DeclaringType.IsPublic) { return(binder.MakeCallExpression(getter)); } // private binding is just a call to the getter method... return(MemberTracker.FromMemberInfo(getter).Call(binder)); }
public override DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type instanceType) { if (!IsStatic || GetIndexParameters().Length > 0) { // need to bind to a value or parameters to get the value. return(binder.ReturnMemberTracker(instanceType, this)); } MethodInfo getter = ResolveGetter(instanceType, 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)); }
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() )); }
protected internal override Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) { return binder.ReturnMemberTracker(type, BindToInstance(instance)); }
protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance) { return binder.ReturnMemberTracker(type, BindToInstance(instance)); }
/// <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 instanceType) { return(binder.ReturnMemberTracker(instanceType, this)); }
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() ); }
public override DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance) { return(binder.ReturnMemberTracker(type, BindToInstance(instance))); }
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) ); }
internal override Expression GetBoundValue(ActionBinder binder, Type type, Expression instance) { return binder.ReturnMemberTracker(type, new BoundMemberTracker(this, instance)); }
protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance) { return(binder.ReturnMemberTracker(type, new BoundMemberTracker(this, instance))); }
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)); }
/// <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); }
/// <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)); }
/// <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); }
protected internal override Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) { return(binder.ReturnMemberTracker(type, BindToInstance(instance))); }
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 ); }
internal override Expression GetBoundValue(ActionBinder binder, Type type, Expression instance) { return(binder.ReturnMemberTracker(type, new BoundMemberTracker(this, instance))); }
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)); }