Ejemplo n.º 1
0
        public EvaluationResult SetValue(ObjectPath path, string value, EvaluationOptions options)
        {
            if (path.Length != 2)
            {
                throw new NotSupportedException();
            }

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

            object val;

            try {
                EvaluationContext cctx = ctx.Clone();
                EvaluationOptions ops  = options ?? cctx.Options;
                ops.AllowMethodEvaluation = true;
                ops.AllowTargetInvoke     = true;
                cctx.Options = ops;
                ValueReference var = ctx.Evaluator.Evaluate(ctx, value, array.ElementType);
                val = var.Value;
                val = ctx.Adapter.Convert(ctx, val, array.ElementType);
                array.SetElement(idx, val);
            } catch {
                val = array.GetElement(idx);
            }
            try {
                return(ctx.Evaluator.TargetObjectToExpression(ctx, val));
            } catch (Exception ex) {
                ctx.WriteDebuggerError(ex);
                return(new EvaluationResult("? (" + ex.Message + ")"));
            }
        }
Ejemplo n.º 2
0
 public RemoteRawValue(EvaluationContext gctx, IObjectSource source, object targetObject)
 {
     this.ctx = gctx.Clone ();
     ctx.Options.AllowTargetInvoke = true;
     ctx.Options.AllowMethodEvaluation = true;
     this.targetObject = targetObject;
     this.source = source;
     Connect ();
 }
Ejemplo n.º 3
0
 public RemoteRawValue(EvaluationContext gctx, IObjectSource source, object targetObject)
 {
     this.ctx = gctx.Clone();
     ctx.Options.AllowTargetInvoke     = true;
     ctx.Options.AllowMethodEvaluation = true;
     this.targetObject = targetObject;
     this.source       = source;
     Connect();
 }
Ejemplo n.º 4
0
        protected EvaluationContext GetChildrenContext(EvaluationOptions options)
        {
            EvaluationContext newCtx = ctx.Clone();

            if (options != null)
            {
                newCtx.Options = options;
            }
            newCtx.Options.EvaluationTimeout = originalOptions.MemberEvaluationTimeout;
            return(newCtx);
        }
		ML.TargetObject EvaluateExp (EvaluationContext ctx, string exp)
		{
			ValueReference var;
			try {
				EvaluationContext cctx = ctx.Clone ();
				EvaluationOptions ops = cctx.Options;
				ops.AllowMethodEvaluation = true;
				cctx.Options = ops;
				var = (ValueReference) Server.Instance.Evaluator.Evaluate (cctx, exp);
				return (ML.TargetObject) var.Value;
			} catch {
				return null;
			}
		}