Ejemplo n.º 1
0
        protected override void OnInitializePanel()
        {
            base.OnInitializePanel();

            if (NuGenDebugEventHandler.Instance.EventObjects.Thread != null)
            {
                if (ActiveFrame == null)
                {
                    NuGenUIHandler.Instance.DisplayUserWarning("No stack frame information is available at the location.");
                }
                else if (!ActiveFrame.IsILFrame() && Mode != ObjectsPanelMode.Watch)
                {
                    switch (Mode)
                    {
                    case ObjectsPanelMode.Arguments:
                        NuGenUIHandler.Instance.DisplayUserWarning("The current frame is native therefore arguments are not available.");
                        break;

                    case ObjectsPanelMode.AutoObjects:
                        NuGenUIHandler.Instance.DisplayUserWarning("The current frame is native therefore auto objects are not available.");
                        break;

                    case ObjectsPanelMode.LocalVariables:
                        NuGenUIHandler.Instance.DisplayUserWarning("The current frame is native therefore local variables are not available.");
                        break;
                    }
                }
                else
                {
                    EvalWrapper evalWrapper = NuGenDebugEventHandler.Instance.EventObjects.Thread.CreateEval();
                    EvaluationContext = new NuGenEvaluationContext(NuGenDebugEventHandler.Instance.EventObjects.Process, new NuGenEvaluationHandler(ActiveFrameRefresher), evalWrapper, NuGenDebugEventHandler.Instance.EventObjects.Thread);
                    ValueDisplayer    = new NuGenValueDisplayer(EvaluationContext);

                    switch (Mode)
                    {
                    case ObjectsPanelMode.Arguments:
                        DisplayArguments();
                        break;

                    case ObjectsPanelMode.AutoObjects:
                        DisplayCurrentException();
                        break;

                    case ObjectsPanelMode.LocalVariables:
                        DisplayLocalVariables();
                        break;

                    case ObjectsPanelMode.Watch:
                        DisplayWatchExpressions();
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void DisplayCurrentException()
        {
            try
            {
                if (ActiveFrame.IsILFrame())
                {
                    ValueWrapper exceptionObject = NuGenDebugEventHandler.Instance.EventObjects.Thread.GetCurrentException();

                    if (exceptionObject != null)
                    {
                        NuGenExceptionValueRefresher valueRefresher = new NuGenExceptionValueRefresher(NuGenConstants.CurrentExceptionName, NuGenDebugEventHandler.Instance.EventObjects.Thread);

                        ShowObject(valueRefresher);
                    }
                }
            }
            catch (Exception exception)
            {
                NuGenUIHandler.Instance.ShowException(exception);
            }
        }