Framework EDI Reference. Events in FREDI .NET Hybrid
ediDocument. ProgressNotify

The event handler that gets called when the progress of an internal process is about to begin, is being updated, or has completed.

Syntax

Progress Type:    

Example:

The following is an example that shows how to listen to progress notifications.

' Set up FREDI to receive events in the module
Private WithEvents m_oEdiDoc As ediDocument
         :
   ' In the main routine start an instance of FREDI
   Set m_oEdiDoc = New ediDocument

         :

         :

' This is an event handler for ProgressNotify that captures progress notifications from 
' FREDI.

Private Sub m_oEdiDoc_ProgressNotify(ByVal ProgressNotify As Edidev.FrameworkEDI.ediProgressNotify) Handles m_oEdiDoc.ProgressNotify

If ProgressNotify.ProgressState = ProgressStateConstants.Progress_Phase_Start Then
Select Case ProgressNotify.ProgressType
Case ProgressTypeConstants.Progress_Type_Single_Import
TextBox1.Text = TextBox1.Text & "Progress Start. Importing single SEF" & vbCrLf
Application.DoEvents()
Case ProgressTypeConstants.Progress_Type_Codes_Read
TextBox1.Text = TextBox1.Text & "Progress Start. Reading SEF Codes" & vbCrLf
Application.DoEvents()
Case ProgressTypeConstants.Progress_Type_Document_Read
TextBox1.Text = TextBox1.Text & "Progress Start. Reading EDI Document" & vbCrLf
Application.DoEvents()
Case ProgressTypeConstants.Progress_Type_Document_Save
TextBox1.Text = TextBox1.Text & "Progress Start. Saving EDI Document" & vbCrLf
Application.DoEvents()
End Select
ElseIf ProgressNotify.ProgressState = ProgressStateConstants.Progress_Phase_Update Then
Select Case ProgressNotify.ProgressType
Case ProgressTypeConstants.Progress_Type_Single_Import
TextBox1.Text = TextBox1.Text & "Progress Update. Importing single SEF at %" & CStr(ProgressNotify.Percent) & vbCrLf
Application.DoEvents()
Case ProgressTypeConstants.Progress_Type_Codes_Read
TextBox1.Text = TextBox1.Text & "Progress Update. Reading SEF Codes at %" & CStr(ProgressNotify.Percent) & vbCrLf
Application.DoEvents()
Case ProgressTypeConstants.Progress_Type_Document_Read
TextBox1.Text = TextBox1.Text & "Progress Update. Reading EDI Document at %" & CStr(ProgressNotify.Percent) & vbCrLf
Application.DoEvents()
Case ProgressTypeConstants.Progress_Type_Document_Save
TextBox1.Text = TextBox1.Text & "Progress Update. Saving EDI Document at %" & CStr(ProgressNotify.Percent) & vbCrLf
Application.DoEvents()
End Select

ElseIf ProgressNotify.ProgressState = ProgressStateConstants.Progress_Phase_Complete Then
Select Case ProgressNotify.ProgressType
Case ProgressTypeConstants.Progress_Type_Single_Import
TextBox1.Text = TextBox1.Text & "Progress Completed. Importing single SEF" & vbCrLf
Application.DoEvents()
Case ProgressTypeConstants.Progress_Type_Codes_Read
TextBox1.Text = TextBox1.Text & "Progress Completed. Reading SEF Codes" & vbCrLf
Application.DoEvents()
Case ProgressTypeConstants.Progress_Type_Document_Read
TextBox1.Text = TextBox1.Text & "Progress Completed. Reading EDI Document" & vbCrLf
Application.DoEvents()
Case ProgressTypeConstants.Progress_Type_Document_Save
TextBox1.Text = TextBox1.Text & "Progress Completed. Saving EDI Document" & vbCrLf
Application.DoEvents()
End Select
End If
End Sub