示例#1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public int OnError(IDebugEngine2 pEngine, IDebugProcess2 pProcess, IDebugProgram2 pProgram, IDebugThread2 pThread, IDebugEvent2 pEvent, ref Guid riidEvent, uint dwAttrib)
        {
            LoggingUtils.PrintFunction();

            try
            {
                DebugEngineEvent.Error errorEvent = pEvent as DebugEngineEvent.Error;

                enum_MESSAGETYPE [] messageType = new enum_MESSAGETYPE [1];

                string errorFormat, errorHelpFileName;

                int errorReason;

                uint errorType, errorHelpId;

                LoggingUtils.RequireOk(errorEvent.GetErrorMessage(messageType, out errorFormat, out errorReason, out errorType, out errorHelpFileName, out errorHelpId));

                LoggingUtils.RequireOk(m_debuggerConnectionService.LaunchDialogUpdate(errorFormat, true));

                return(VSConstants.S_OK);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                return(VSConstants.E_FAIL);
            }
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public async Task <int> PrepareLaunch()
        {
            LoggingUtils.PrintFunction();

            DateTime logTime = DateTime.Now;

            await m_debugConnectionService.LaunchDialogShow();

            return(await m_debugConnectionService.LaunchDialogUpdate(string.Format(CultureInfo.InvariantCulture, "Session started: {0}", logTime.ToString("F", CultureInfo.CurrentCulture)), false));
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public void PrepareLaunch()
        {
            LoggingUtils.PrintFunction();

            try
            {
                DateTime logTime = DateTime.Now;

                LoggingUtils.RequireOk(m_debugConnectionService.LaunchDialogShow());

                LoggingUtils.RequireOk(m_debugConnectionService.LaunchDialogUpdate(string.Format(CultureInfo.InvariantCulture, "Session started: {0}", logTime.ToString("F", CultureInfo.CurrentCulture)), false));
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                throw;
            }
        }