Add Heartbeat Function to Service, Add Timer to ClientSuite Service Startup check
This commit is contained in:
@@ -13,17 +13,33 @@ Public Class frmMain
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
' Assign My.MainForm before everything else
|
||||
My.MainForm = Me
|
||||
|
||||
' Initialize Main Timer
|
||||
_Timer = New ClassTimer(My.LogConfig)
|
||||
|
||||
' Show splashscreen
|
||||
frmSplash.ShowDialog()
|
||||
|
||||
' Initialize Form Related Variables
|
||||
My.MainForm = Me
|
||||
End Sub
|
||||
|
||||
Private Sub SetOnlineLabel()
|
||||
If My.Application.Service.Online Then
|
||||
LabelServiceOnline.Caption = "Service Online"
|
||||
LabelServiceOnline.ItemAppearance.Normal.ForeColor = Color.Green
|
||||
Else
|
||||
LabelServiceOnline.Caption = "Service Offline"
|
||||
LabelServiceOnline.ItemAppearance.Normal.ForeColor = Color.Red
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub HandleOnlineChanged(sender As Object, Online As Boolean)
|
||||
SetOnlineLabel()
|
||||
End Sub
|
||||
|
||||
Private Sub FrmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
' Initialize Main Timer
|
||||
_Timer = New ClassTimer(My.LogConfig, Me, My.Config.HeartbeatInterval)
|
||||
AddHandler _Timer.OnlineChanged, AddressOf HandleOnlineChanged
|
||||
SetOnlineLabel()
|
||||
|
||||
LabelCurrentUser.Caption = My.Application.User.UserName
|
||||
LabelCurrentMachine.Caption = My.Application.User.MachineName
|
||||
LabelCurrentVersion.Caption = My.Application.Info.Version.ToString
|
||||
@@ -48,7 +64,6 @@ Public Class frmMain
|
||||
MsgBox($"Clicked on Document {RowView.Row.Item("DocName")}")
|
||||
End Sub
|
||||
|
||||
|
||||
LoadLayout()
|
||||
End Sub
|
||||
|
||||
@@ -57,21 +72,21 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
Private Sub LoadLayout()
|
||||
Dim oLayoutPathForDockManager As String = GetLayoutPath(LayoutName.LayoutMain, LayoutComponent.DockManager)
|
||||
Dim oLayoutPathForDocumentManager As String = GetLayoutPath(LayoutName.LayoutMain, LayoutComponent.DocumentManager)
|
||||
Dim oLayoutPathForDockManager As String = GetLayoutPath(GroupName.LayoutMain, LayoutComponent.DockManager)
|
||||
Dim oLayoutPathForDocumentManager As String = GetLayoutPath(GroupName.LayoutMain, LayoutComponent.DocumentManager)
|
||||
|
||||
If IO.File.Exists(oLayoutPathForDockManager) Then
|
||||
If File.Exists(oLayoutPathForDockManager) Then
|
||||
DockManager.RestoreLayoutFromXml(oLayoutPathForDockManager)
|
||||
End If
|
||||
|
||||
If IO.File.Exists(oLayoutPathForDocumentManager) Then
|
||||
If File.Exists(oLayoutPathForDocumentManager) Then
|
||||
DocumentManager.View.RestoreLayoutFromXml(oLayoutPathForDocumentManager)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub SaveLayout()
|
||||
Dim oLayoutPathForDockManager As String = GetLayoutPath(LayoutName.LayoutMain, LayoutComponent.DockManager)
|
||||
Dim oLayoutPathForDocumentManager As String = GetLayoutPath(LayoutName.LayoutMain, LayoutComponent.DocumentManager)
|
||||
Dim oDirectory As String = Path.GetDirectoryName(oLayoutPathForDockManager)
|
||||
Dim oLayoutPathForDockManager As String = GetLayoutPath(GroupName.LayoutMain, LayoutComponent.DockManager)
|
||||
Dim oLayoutPathForDocumentManager As String = GetLayoutPath(GroupName.LayoutMain, LayoutComponent.DocumentManager)
|
||||
Dim oDirectory As String = GetLayoutDirectory()
|
||||
|
||||
If Not Directory.Exists(oDirectory) Then
|
||||
Directory.CreateDirectory(oDirectory)
|
||||
|
||||
Reference in New Issue
Block a user