Private Shared iMacrosExecuterTimer As Timers.Timer Protected Overrides Sub OnStart(ByVal args() As String) 'Initiate and set timer iMacrosExecuterTimer = New Timers.Timer iMacrosExecuterTimer.Interval = 10000 '10 seconds so it start immediately after it gets enabled, then it will be called every minute AddHandler iMacrosExecuterTimer.Elapsed, AddressOf OnTimedEvent iMacrosExecuterTimer.AutoReset = False iMacrosExecuterTimer.Start() End Sub 'OnStart Protected Overrides Sub OnStop() End Sub 'OnStop Private Sub OnTimedEvent(source As Object, e As System.Timers.ElapsedEventArgs) iMacrosExecuterEventLog.WriteEntry("OnTimedEvent: S T A R T E D", EventLogEntryType.Information) 'added for testing purposes 'Testing Site CheckPendingiMacros(True) 'Production Site CheckPendingiMacros(False) iMacrosExecuterEventLog.WriteEntry("OnTimedEvent: E N D E D", EventLogEntryType.Information) 'added for testing purposes 'Re-Start the service again iMacrosExecuterTimer.Interval = 60000 iMacrosExecuterTimer.Start() End Sub Private Sub CheckPendingiMacros(ByVal TestingSite As Boolean) 'Set log entry to identify if running for the TestingSite or Production site iMacrosExecuterEventLog.WriteEntry(IIf(TestingSite, "Check Pending iMacros on:" & vbCr & "*** TestingSite Site ***", "Check Pending iMacros on:" & vbCr & "--- Production Site ---"), EventLogEntryType.Information)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)