load default config when config exists but is empty
This commit is contained in:
parent
39c118308d
commit
19bc39c0ce
@ -160,6 +160,10 @@ Public Class ConfigManager(Of T)
|
||||
oConfig = _Serializer.Deserialize(oReader)
|
||||
End Using
|
||||
|
||||
If oConfig Is Nothing Then
|
||||
oConfig = Activator.CreateInstance(_Blueprint.GetType)
|
||||
End If
|
||||
|
||||
Return oConfig
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
|
||||
@ -10,6 +10,7 @@ Public Class ClassService
|
||||
Public Enum ConnectionTestResult
|
||||
Successful
|
||||
NotFound
|
||||
EmptyURI
|
||||
Unknown
|
||||
End Enum
|
||||
|
||||
@ -57,6 +58,9 @@ Public Class ClassService
|
||||
Catch ex As EndpointNotFoundException
|
||||
_Logger.Error(ex)
|
||||
Return ConnectionTestResult.NotFound
|
||||
Catch ex As UriFormatException
|
||||
_Logger.Error(ex)
|
||||
Return ConnectionTestResult.EmptyURI
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Return ConnectionTestResult.Unknown
|
||||
|
||||
1
EDMI_ClientSuite/frmConfigService.Designer.vb
generated
1
EDMI_ClientSuite/frmConfigService.Designer.vb
generated
@ -91,7 +91,6 @@ Partial Class frmConfigService
|
||||
'
|
||||
'btnOK
|
||||
'
|
||||
Me.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.btnOK.Location = New System.Drawing.Point(257, 124)
|
||||
Me.btnOK.Name = "btnOK"
|
||||
Me.btnOK.Size = New System.Drawing.Size(75, 23)
|
||||
|
||||
@ -32,6 +32,8 @@
|
||||
Select Case oResult
|
||||
Case ClassService.ConnectionTestResult.NotFound
|
||||
lblStatus.Text = "Dienst konnte nicht gefunden werden. Bitte überprüfen sie Addresse und Port."
|
||||
Case ClassService.ConnectionTestResult.EmptyURI
|
||||
lblStatus.Text = "Bitte tragen Sie eine gültige Dienst Adresse ein."
|
||||
Case Else
|
||||
lblStatus.Text = "Unbekannter Fehler."
|
||||
End Select
|
||||
@ -43,6 +45,11 @@
|
||||
End Sub
|
||||
|
||||
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
|
||||
If My.SystemConfigManager.Config.ServiceConnection <> String.Empty Then
|
||||
DialogResult = DialogResult.OK
|
||||
Close()
|
||||
Else
|
||||
MsgBox("Bitte tragen Sie die Dienst Adresse ein!")
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Loading…
x
Reference in New Issue
Block a user