diff --git a/ToolCollection/frmStart.vb b/ToolCollection/frmStart.vb index 4137f0e..22a1690 100644 --- a/ToolCollection/frmStart.vb +++ b/ToolCollection/frmStart.vb @@ -5,6 +5,7 @@ Imports DigitalData.Modules.Logging Imports System.IO Imports DigitalData.Modules.Database Imports System.Text.RegularExpressions +Imports System.ComponentModel Public Class frmStart Private _MyLogger As LogConfig @@ -127,6 +128,18 @@ Public Class frmStart Dim result As MsgBoxResult = MsgBox("Sind Sie sicher, dass sie " & Application.ProductName & " wirklich schließen wollen?" & vbNewLine & "Alle Vorgänge/Module werden gestoppt und nicht mehr ausgeführt!", MsgBoxStyle.YesNo, "Bestätigung erforderlich:") If result = MsgBoxResult.No Then e.Cancel = True + Return ' ← wichtig: hier sofort raus, kein Logout + End If + + If Not IsNothing(CURRENToWMSession) Then + _Logger.Debug("Closing frmStart - Now logging out of windream session...") + Try + CURRENToWMSession.Logout() + _Logger.Debug("windream session logged out successfully.") + Catch ex As Exception + _Logger.Warn("Error while logging out windream session: " & ex.Message) + _Logger.Error(ex) + End Try End If End Sub