예제 #1
0
        public static EE.EvaluationResult HandleDebuggerDisplay(Interpreter interpreter,
                                                                Thread thread,
                                                                TargetStructObject instance,
                                                                DebuggerDisplayAttribute attr,
                                                                int timeout, out string name,
                                                                out string type)
        {
            ScriptingContext expr_context = new ScriptingContext(interpreter);

            expr_context.CurrentThread    = thread;
            expr_context.CurrentLanguage  = instance.Type.Language;
            expr_context.ImplicitInstance = instance;

            EE.EvaluationResult result = expr_context.HandleDebuggerDisplay(
                thread, instance, attr.Value, timeout, out name);

            if (result != EE.EvaluationResult.Ok)
            {
                type = null;
                return(result);
            }

            if (String.IsNullOrEmpty(attr.Type))
            {
                type = null;
                return(EE.EvaluationResult.Ok);
            }

            return(expr_context.HandleDebuggerDisplay(
                       thread, instance, attr.Type, timeout, out type));
        }
예제 #2
0
            public EE.AsyncResult Assign(StackFrame frame, TargetObject obj,
                                         EE.EvaluationCallback callback)
            {
                AsyncResult async = new AsyncResult(this);

                ST.ThreadPool.QueueUserWorkItem(delegate {
                    ScriptingContext context    = new ScriptingContext(Parser.Interpreter);
                    context.InterruptionHandler = async;
                    context.CurrentFrame        = frame;

                    object data;
                    EE.EvaluationResult result = DoAssignWorker(
                        context, obj, out data);
                    callback(result, data);
                    async.WaitHandle.Set();
                });

                return(async);
            }
예제 #3
0
            public EE.AsyncResult Evaluate(StackFrame frame, EE.EvaluationFlags flags,
                                           EE.EvaluationCallback callback)
            {
                AsyncResult async = new AsyncResult(this);

                ST.ThreadPool.QueueUserWorkItem(delegate {
                    ScriptingContext context    = new ScriptingContext(Parser.Interpreter);
                    context.InterruptionHandler = async;
                    context.CurrentFrame        = frame;

                    if ((flags & EE.EvaluationFlags.NestedBreakStates) != 0)
                    {
                        context.ScriptingFlags |= ScriptingFlags.NestedBreakStates;
                    }

                    object data;
                    EE.EvaluationResult result = DoEvaluateWorker(context, out data);
                    callback(result, data);
                    async.WaitHandle.Set();
                });

                return(async);
            }