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));
        }
            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);
            }
            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);
            }