Exemplo n.º 1
0
        private void CurrentDomain_FirstChanceException(object sender, FirstChanceExceptionEventArgs e)
        {
            if (!Loggers.IsUsed(this))
            {
                return;
            }

            if (LogFirstChanceExceptions && CurrentLevel == Level.Info)
            {
                var    frame      = GetApplicableFrame(e.Exception);
                string sourceFile = frame.GetFileName();

                string description = "First chance exception.";
                if (sourceFile == null)
                {
                    description += " SourceFile and Line are not available because the application does not have (up-to-date) .pdb files included in the folder holding the binaries where the exception occured.";
                }

                _backgroundWorkQueue.EnqueueWorkItem(_logEntryWriteCallback, Level.Info, description, e.Exception, new object[] { sender }, frame.GetMethod().Name, sourceFile, frame.GetFileLineNumber(), false, null);
            }
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     _backgroundWorkQueue.EnqueueWorkItem(new Action(() => Thread.Sleep(2000)));
 }