示例#1
0
        private static void Events_OnEnterDesignMode(dbgEventReason Reason)
        {
            lock (_sync)
            {
                switch (Reason)
                {
                case dbgEventReason.dbgEventReasonEndProgram:
                case dbgEventReason.dbgEventReasonLaunchProgram:
                case dbgEventReason.dbgEventReasonStopDebugging:
                case dbgEventReason.dbgEventReasonDetachProgram:
                case dbgEventReason.dbgEventReasonExceptionThrown:
                case dbgEventReason.dbgEventReasonExceptionNotHandled:
                    Project proj = VSPackage.GetActiveProject();
                    if (proj != null && Debugging && (DateTime.Now - LastQuery).TotalSeconds > 1)
                    {
                        Debugging = false;
                        LastQuery = DateTime.Now;
                        OnProjectDebuggingStop?.Invoke(proj);
                    }
                    break;

                default:
                    break;
                }
            }
        }
示例#2
0
        private static void Events_OnEnterRunMode(dbgEventReason Reason)
        {
            lock (_sync)
            {
                switch (Reason)
                {
                case dbgEventReason.dbgEventReasonGo:
                case dbgEventReason.dbgEventReasonAttachProgram:
                case dbgEventReason.dbgEventReasonLaunchProgram:
                    Project proj = VSPackage.GetActiveProject();
                    if (proj != null && !Debugging && (DateTime.Now - LastQuery).TotalSeconds > 1)
                    {
                        Debugging = true;
                        LastQuery = DateTime.Now;
                        OnProjectDebuggingStart?.Invoke(proj);
                    }
                    break;

                default:
                    break;
                }
            }
        }