rename project to ClientSuite, add application timer

This commit is contained in:
Jonathan Jenne
2019-02-18 11:14:02 +01:00
parent a2f4c06492
commit bc7605bdcf
40 changed files with 120 additions and 1478 deletions

View File

@@ -0,0 +1,37 @@
Imports System.Threading
Imports System.Timers
Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference
Imports DigitalData.Modules.Logging
Public Class ClassTimer
Private _Callback As TimerCallback
Private _LogConfig As LogConfig
Private _Logger As Logger
Private _Timer As Timers.Timer
Private _Channel As IEDMServiceChannel
Private Const TIMER_START_TIME = 1000
Private Const TIMER_INTERVAL = 5000
Public Sub Callback(sender As Object, e As ElapsedEventArgs)
_Logger.Info("Checking if Service is up...")
' Connect to service and send hearbeat request
My.Application.Service.Online = True
My.Application.Service.LastChecked = DateTime.Now
End Sub
Public Sub New(LogConfig As LogConfig)
_LogConfig = LogConfig
_Logger = LogConfig.GetLogger()
_Channel = My.ChannelFactory.CreateChannel()
_Channel.Open()
_Timer = New Timers.Timer(TIMER_INTERVAL)
_Timer.SynchronizingObject = My.MainForm
AddHandler _Timer.Elapsed, AddressOf Callback
_Timer.Enabled = True
End Sub
End Class