Examples

Top  Previous  Next

In this example, we're going to make EurekaLog ask for confirmation for every major step, and report when the step's finished.

 

 

C# example:

private void eurekaLog1_ExceptionActionNotify(Exception Error, EurekaLogSystem.EurekaLogOptions Options, EurekaLogSystem.EurekaActionType Action, ref bool Execute)
{
  switch (Action)
  {
      case EurekaLogSystem.EurekaActionType.atShowingExceptionInfo:
          if (MessageBox.Show("Do you want me to show the exception info?", "EurekaLog",
              MessageBoxButtons.YesNo) == DialogResult.No) Execute = false;
          break;
      case EurekaLogSystem.EurekaActionType.atShowedExceptionInfo: MessageBox.Show("Done, I showed the exception info"); break;
      case EurekaLogSystem.EurekaActionType.atSavingLogFile:
          if (MessageBox.Show("Do you want me to save the log file?", "EurekaLog",
              MessageBoxButtons.YesNo) == DialogResult.No) Execute = false;
          break;
      case EurekaLogSystem.EurekaActionType.atSavedLogFile: MessageBox.Show("Done"); break;
      case EurekaLogSystem.EurekaActionType.atSendingEmail:
          if (MessageBox.Show("About to send an e-mail. Ok?", "EurekaLog",
              MessageBoxButtons.YesNo) == DialogResult.No) Execute = false;
          break;
      case EurekaLogSystem.EurekaActionType.atSentEmail: MessageBox.Show("Sent"); break;
      case EurekaLogSystem.EurekaActionType.atSendingWebMessage:
          if (MessageBox.Show("Avout to send a web message. Ok?", "EurekaLog",
              MessageBoxButtons.YesNo) == DialogResult.No) Execute = false;
          break;
      case EurekaLogSystem.EurekaActionType.atSentWebMessage: MessageBox.Show("Web message sent"); break;
      case EurekaLogSystem.EurekaActionType.atTerminating: MessageBox.Show("That's all folks... application is terminating"); break;
  }
}

 

 

Visual Basic example:

Private Sub EurekaLog1_ExceptionActionNotify(ByVal [Error] As System.Exception, ByVal Options As EurekaLogSystem.EurekaLogOptions, ByVal Action As EurekaLogSystem.EurekaActionType, ByRef Execute As System.Boolean) Handles EurekaLog1.ExceptionActionNotify
  Select Case Action
      Case EurekaLogSystem.EurekaActionType.atShowingExceptionInfo
          If MessageBox.Show("Do you want me to show the exception info?", "EurekaLog", MessageBoxButtons.YesNo) = DialogResult.No Then
               Execute = False
          End If
      Case EurekaLogSystem.EurekaActionType.atShowedExceptionInfo
           MessageBox.Show("Done, I showed the exception info")
      Case EurekaLogSystem.EurekaActionType.atSavingLogFile
          If MessageBox.Show("Do you want me to save the log file?", "EurekaLog", MessageBoxButtons.YesNo) = DialogResult.No Then
               Execute = False
          End If
      Case EurekaLogSystem.EurekaActionType.atSavedLogFile
           MessageBox.Show("Done")
      Case EurekaLogSystem.EurekaActionType.atSendingEmail
          If MessageBox.Show("About to send an e-mail. Ok?", "EurekaLog", MessageBoxButtons.YesNo) = DialogResult.No Then
               Execute = False
          End If
      Case EurekaLogSystem.EurekaActionType.atSentEmail
           MessageBox.Show("Sent")
      Case EurekaLogSystem.EurekaActionType.atSendingWebMessage
          If MessageBox.Show("Avout to send a web message. Ok?", "EurekaLog", MessageBoxButtons.YesNo) = DialogResult.No Then
               Execute = False
          End If
      Case EurekaLogSystem.EurekaActionType.atSentWebMessage
           MessageBox.Show("Web message sent")
      Case EurekaLogSystem.EurekaActionType.atTerminating
           MessageBox.Show("That's all folks... application is terminating")
  End Select
End Sub