MS Inactivity 1
This commit is contained in:
@@ -199,9 +199,11 @@ Public Class frmMain
|
||||
bbtniMonitor.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
|
||||
End If
|
||||
Check_Timer_Notification()
|
||||
Check_Timer_Inactivity()
|
||||
formShown = True
|
||||
Restore_Form_Position()
|
||||
|
||||
|
||||
If IDB_ACTIVE = False And ERROR_STATE = "" Then
|
||||
Try
|
||||
If Init_windream() = True Then
|
||||
@@ -254,6 +256,22 @@ Public Class frmMain
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Public Sub Check_Timer_Inactivity()
|
||||
Try
|
||||
If INACTIVITY_DURATION <> 0 Then
|
||||
TimerInactivity.Stop()
|
||||
TimerInactivity.Interval = INACTIVITY_DURATION * 60000
|
||||
TimerInactivity.Start()
|
||||
Else
|
||||
TimerInactivity.Enabled = False
|
||||
TimerInactivity.Stop()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Sub Restore_Form_Position()
|
||||
Try
|
||||
@@ -1192,8 +1210,6 @@ Public Class frmMain
|
||||
CURRENT_DOC_GUID = 0
|
||||
CURRENT_ProfilGUID = oHitProfilID
|
||||
LOGGER.Debug($"Item_Scope: hitInfo.InGroupRow...oHitProfilID [{oHitProfilID}]")
|
||||
|
||||
|
||||
Load_Profil_from_Grid(oHitProfilID)
|
||||
|
||||
ElseIf hitInfo.InDataRow Then
|
||||
@@ -2222,4 +2238,21 @@ Public Class frmMain
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub TimerInactivity_Tick(sender As Object, e As EventArgs) Handles TimerInactivity.Tick
|
||||
If Application.OpenForms().OfType(Of frmValidator).Any Then
|
||||
Check_Timer_Inactivity()
|
||||
Exit Sub
|
||||
End If
|
||||
If Application.OpenForms().OfType(Of frmAdministration).Any Then
|
||||
Check_Timer_Inactivity()
|
||||
Exit Sub
|
||||
End If
|
||||
Try
|
||||
INACTIVITYRecognized = True
|
||||
Application.Exit()
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user