Esempio n. 1
0
 private void boundOutput_NewEntry(object sender, DataLogOutput.LogEntryEventArgs e)
 {
     lock (this.logSchedule)
     {
         this.logSchedule.Add(e.Entry);
     }
     if (!this.timerLogSchedule.Enabled)
     {
         // Don't use a synchronous Invoke. It will block while the BuildManager is active (why?)
         // and thus lead to a deadlock when something is logged while it is.
         this.InvokeEx(() => this.timerLogSchedule.Enabled = true, false);
     }
 }
Esempio n. 2
0
        private void LogData_NewEntry(object sender, DataLogOutput.LogEntryEventArgs e)
        {
            if (this.InvokeRequired)
            {
                return;
            }
            bool pause =
                e.Entry.Type == LogMessageType.Error &&
                this.buttonPauseOnError.Checked &&
                Sandbox.State == SandboxState.Playing &&
                !Sandbox.IsChangingState;

            if (pause)
            {
                System.Media.SystemSounds.Hand.Play();
                Sandbox.Pause();
            }
        }