clean up frmFileTest

This commit is contained in:
Jonathan Jenne 2020-02-04 16:06:47 +01:00
parent b8855659b4
commit 97806fe9cd
2 changed files with 11 additions and 12 deletions

View File

@ -19,14 +19,12 @@ Public Class frmFileTest
.Multiselect = True
}
Dim oDialogResult = oDialog.ShowDialog()
If oDialogResult <> DialogResult.OK Then
If oDialog.ShowDialog() <> DialogResult.OK Then
Exit Sub
End If
Try
For Each oFileName In oDialog.FileNames
For Each oFileName In oDialog.FileNames
Try
Dim oSW As New Stopwatch()
oSW.Start()
@ -35,7 +33,7 @@ Public Class frmFileTest
oSW.Stop()
If oResult.OK = False Then
MsgBox(oResult.ErrorMessage)
listboxLog.Items.Add($"Document upload failed! Reason: '{oResult.ErrorMessage}'")
Exit Sub
End If
@ -43,11 +41,12 @@ Public Class frmFileTest
listboxLog.Items.Add($"Filename: {oResult.Document.FileName}")
listboxLog.Items.Add($"Time in milliseconds: {oSW.ElapsedMilliseconds}")
listboxLog.Items.Add($"----------------------------------------------------------")
Next
Catch ex As Exception
ShowErrorMessage(ex)
Logger.Error(ex)
End Try
Catch ex As Exception
listboxLog.Items.Add($"Document upload failed! Reason: '{ex.Message}'")
Logger.Error(ex)
End Try
Next
End Sub
'Private Sub btnDocByDocId_Click(sender As Object, e As EventArgs)

View File

@ -33,7 +33,7 @@ Public Class Document
''' Connect to the service
''' </summary>
''' <returns>True if connection was successful, false otherwise</returns>
Public Function Connect()
Public Function Connect() As Boolean
Try
_channel = GetChannel()