SetValue() public method

Gets an expression that assigns a value to the left hand side. Returns null if it's an error to assign to. The caller can then call GetErrorForSet to get the correct error Expression (or null if a default error should be provided).
public SetValue ( Microsoft.Scripting.Actions.Calls.OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value ) : DynamicMetaObject
resolverFactory Microsoft.Scripting.Actions.Calls.OverloadResolverFactory
binder ActionBinder
type System.Type
value System.Dynamic.DynamicMetaObject
return System.Dynamic.DynamicMetaObject
Exemplo n.º 1
0
        private void MakeGenericBody(SetOrDeleteMemberInfo memInfo, DynamicMetaObject instance, DynamicMetaObject target, Type type, MemberTracker tracker, DynamicMetaObject errorSuggestion)
        {
            if (instance != null)
            {
                tracker = tracker.BindToInstance(instance);
            }

            DynamicMetaObject val = tracker.SetValue(memInfo.ResolutionFactory, this, type, target, errorSuggestion);

            if (val != null)
            {
                memInfo.Body.FinishCondition(val);
            }
            else
            {
                memInfo.Body.FinishCondition(
                    MakeError(tracker.GetError(this), typeof(object))
                    );
            }
        }
        private void MakeGenericBody(SetOrDeleteMemberInfo memInfo, Expression instance, MetaObject target, Type type, MemberTracker tracker)
        {
            if (instance != null)
            {
                tracker = tracker.BindToInstance(instance);
            }

            Expression val = tracker.SetValue(memInfo.CodeContext, this, type, target.Expression);

            if (val != null)
            {
                memInfo.Body.FinishCondition(val);
            }
            else
            {
                memInfo.Body.FinishCondition(
                    MakeError(tracker.GetError(this))
                    );
            }
        }
Exemplo n.º 3
0
        private void MakeGenericBody(Type type, MemberTracker tracker)
        {
            if (!_isStatic)
            {
                tracker = tracker.BindToInstance(Instance);
            }

            Expression val = tracker.SetValue(Rule.Context, Binder, type, Rule.Parameters[1]);
            Expression newBody;

            if (val != null)
            {
                newBody = Rule.MakeReturn(Binder, val);
            }
            else
            {
                newBody = tracker.GetError(Binder).MakeErrorForRule(Rule, Binder);
            }

            AddToBody(newBody);
        }
Exemplo n.º 4
0
        private void MakeGenericBody(SetOrDeleteMemberInfo memInfo, Expression instance, DynamicMetaObject target, Type type, MemberTracker tracker) {
            if (instance != null) {
                tracker = tracker.BindToInstance(instance);
            }

            Expression val = tracker.SetValue(memInfo.CodeContext, this, type, target.Expression);

            if (val != null) {
                memInfo.Body.FinishCondition(val);
            } else {
                memInfo.Body.FinishCondition(
                    MakeError(tracker.GetError(this), typeof(object))
                );
            }
        }
        private void MakeGenericBody(SetOrDeleteMemberInfo memInfo, DynamicMetaObject instance, DynamicMetaObject target, Type type, MemberTracker tracker, DynamicMetaObject errorSuggestion) {
            if (instance != null) {
                tracker = tracker.BindToInstance(instance);
            }

            DynamicMetaObject val = tracker.SetValue(memInfo.ResolutionFactory, this, type, target, errorSuggestion);

            if (val != null) {
                memInfo.Body.FinishCondition(val);
            } else {
                memInfo.Body.FinishCondition(
                    MakeError(tracker.GetError(this), typeof(object))
                );
            }
        }