jj: app state

This commit is contained in:
Jonathan Jenne
2019-01-30 16:20:16 +01:00
parent 7d691246f5
commit 4cf64da043
18 changed files with 218 additions and 210 deletions

View File

@@ -0,0 +1,37 @@
Imports EDMI_ClientSuite.ClassInit
Public Class frmConfigService
Private _Init As ClassInit
Private Sub frmServiceConfig_Load(sender As Object, e As EventArgs) Handles Me.Load
_Init = New ClassInit()
End Sub
Private Async Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click
Dim oIPAddress = txtIPAddress.Text
Dim oPort = txtPort.Text
Dim oEndpointURL = $"net.tcp://{oIPAddress}:{oPort}/DigitalData/Services/Main"
Dim oResult As ConnectionTestResult
lblStatus.Text = "Verbindung wird hergestellt..."
oResult = Await _Init.TestConnectionAsync(oEndpointURL)
If oResult = ConnectionTestResult.Successful Then
My.Settings.ICMServiceAddress = oEndpointURL
'My.Settings.Save()
lblStatus.Text = "Verbindung hergestellt."
Else
Select Case oResult
Case ConnectionTestResult.NotFound
lblStatus.Text = "Dienst konnte nicht gefunden werden. Bitte überprüfen sie Addresse und Port."
Case Else
lblStatus.Text = "Unbekannter Fehler."
End Select
End If
End Sub
Private Sub btnDelete_Click(sender As Object, e As EventArgs)
My.Settings.ICMServiceAddress = String.Empty
My.Settings.Save()
End Sub
End Class