Пример #1
0
        /// <summary>
        /// finish execute an action
        /// </summary>
        /// <param name="objectKey"></param>
        /// <param name="methodWholeId"></param>
        /// <param name="branchId"></param>
        /// <param name="executer"></param>
        public void AfterExecuteAction(string objectKey, UInt64 methodWholeId, UInt32 branchId, object executer)
        {
            if (_ComponentDebugger.Stopping)
            {
                return;
            }
            int threadId = System.Threading.Thread.CurrentThread.ManagedThreadId;

            _ComponentDebugger.DecrementStackLevel(threadId);
            //check if it is at a break point
            MethodClass mc = _ComponentDebugger.GetMethod(methodWholeId);

            if (mc != null)
            {
                IActionGroup g      = mc;
                ActionBranch branch = mc.GetBranchByIdInGroup(branchId, ref g);
                if (branch != null)
                {
                    IActionGroup g0 = branch as IActionGroup;
                    if (g0 != null)
                    {
                        //finished calling a group of actions
                        MethodDesignerHolder h = _ComponentDebugger.GetViewer(threadId, g0.GroupId);
                        if (h != null)
                        {
                            h.ActionGroup.GroupFinished = true;
                            _ComponentDebugger.UpdateViewersBackColor();
                        }
                    }
                    else
                    {
                        ISingleAction sa = branch as ISingleAction;
                        if (sa != null)
                        {
                            CustomMethodPointer ac = sa.ActionData.ActionMethod as CustomMethodPointer;
                            if (ac != null)
                            {
                                //finished calling a custom action
                                MethodDesignerHolder h = _ComponentDebugger.GetViewer(threadId, ac.MethodDef.MethodID);
                                if (h != null)
                                {
                                    h.ActionGroup.GroupFinished = true;
                                    _ComponentDebugger.UpdateViewersBackColor();
                                }
                            }
                        }
                    }
                    EnumRunStatus status = _ComponentDebugger.GetRunStatus(threadId);
                    bool          b      = (status == EnumRunStatus.Pause || status == EnumRunStatus.StepInto);
                    if (!b)
                    {
                        if (status == EnumRunStatus.StepOver && _ComponentDebugger.ReachStepOver(threadId))
                        {
                            b = true;
                        }
                        if (!b)
                        {
                            if (status == EnumRunStatus.StepOut && _ComponentDebugger.ReachStepOut(threadId))
                            {
                                b = true;
                            }
                        }
                    }

                    if (b || branch.BreakAfterExecute)
                    {
                        _ComponentDebugger.SetSelectedObject(executer);
                        _ComponentDebugger.SetAtBreak(threadId, true);
                        _debugUI.ShowBreakPoint(_ComponentDebugger);
                        branch.AtBreak = EnumActionBreakStatus.After;
                        _ComponentDebugger.ShowBreakPointInMethod(threadId, mc, g, branch);
                        waitForBreakPoint(threadId);
                        branch.AtBreak = EnumActionBreakStatus.None;
                        _ComponentDebugger.ShowBreakPointInMethod(threadId, mc, g, branch);
                    }
                    else
                    {
                        branch.AtBreak = EnumActionBreakStatus.None;
                        _ComponentDebugger.ClearBreakPointInMethod(threadId, mc, g, branch);
                    }
                }
            }
        }