EvaluationResult IObjectValueSource.SetValue(ObjectPath path, string value, EvaluationOptions options)
        {
            Context.WaitRuntimeInvokes();
            var ctx = GetContext(options);

            return(ValueModificationUtil.ModifyValue(ctx, value, Type, newVal => SetValue(ctx, newVal)));
        }
        EvaluationResult IObjectValueSource.SetValue(ObjectPath path, string value, EvaluationOptions options)
        {
            if (path.Length != 2)
            {
                throw new InvalidOperationException(string.Format("ObjectPath for array element is invalid: {0}", path));
            }

            int[] idx  = StringToIndices(path [1]);
            var   cctx = ctx.WithOptions(options);

            return(ValueModificationUtil.ModifyValue(cctx, value, array.ElementType, newVal => array.SetElement(idx, newVal)));
        }
        public void SetRawValue(ObjectPath path, object value, EvaluationOptions options)
        {
            if (path.Length != 2)
            {
                throw new NotSupportedException();
            }

            int[] idx = StringToIndices(path [1]);

            EvaluationContext cctx = ctx.WithOptions(options);

            ValueModificationUtil.ModifyValueFromRaw(cctx, value, val => array.SetElement(idx, val));
        }
        protected virtual void SetRawValue(ObjectPath path, object value, EvaluationOptions options)
        {
            var ctx = GetContext(options);

            ValueModificationUtil.ModifyValueFromRaw(ctx, value, val => SetValue(ctx, val));
        }