Exemple #1
0
        /// <summary>
        /// Called after the last batch was processed.
        /// </summary>
        public void SignOut()
        {
            try {
                if (m_ppProcess != null)
                {
                    if (!m_ppProcess.HasExited)
                    {
                        Thread.Sleep(100);
                    }

                    if (PreprocessorExitedWithError)
                    {
                        ++m_errorCount;
                    }
                }
            }
            catch (InvalidOperationException) {
                // Ignore any invalid operation when trying to determine the preprocessor exit code.
            }


            if (GlobalSettings.Verbosity.TraceInfo)
            {
                string message = "\r\n*** Finished ";
                switch (m_errorCount)
                {
                case 0:
                    message += "without any error :-)";
                    break;

                case 1:
                    message += "with one error";
                    if (m_options.BreakOnError)
                    {
                        message += " that caused the script execution to stop";
                    }
                    message += " :-(";
                    break;

                default:
                    message += "with " + m_errorCount + " errors :-(";
                    break;
                }

                Trace.WriteLineIf(GlobalSettings.Verbosity.TraceInfo, message);
            }

            m_ppTraces.Flush();
            m_processor.SignOut();
            Trace.Flush();
        }