diff --git a/ToolCollection/ClassNIProfile.vb b/ToolCollection/ClassNIProfile.vb index b385864..1aeb873 100644 --- a/ToolCollection/ClassNIProfile.vb +++ b/ToolCollection/ClassNIProfile.vb @@ -14,7 +14,6 @@ Public Class ClassNIProfile xmlConfigFile = oConfigPath ClassNIProfile.LoadFromXmlFile() ' 3b. Windream initialisieren (Connection, Session, ... aufbauen) - _windream.Init() End Sub Public Shared Function IsXmlAccessable() As Boolean Dim xml As New Xml.XmlDocument diff --git a/ToolCollection/ClassWindream_allgemein.vb b/ToolCollection/ClassWindream_allgemein.vb index b298f4c..96abb1f 100644 --- a/ToolCollection/ClassWindream_allgemein.vb +++ b/ToolCollection/ClassWindream_allgemein.vb @@ -107,10 +107,8 @@ Public Class ClassWindream_allgemein ''' Liefert True wenn das Anmelden erfolgreich war, sonst False ''' Public Function Init() As Boolean - Dim oHourDifference As Integer - oHourDifference = CInt(DateDiff(DateInterval.Hour, CURRENToWMSession_Created, Now)) - If IsNothing(CURRENToWMSession) Or oHourDifference >= 2 Then + If IsNothing(CURRENToWMSession) OrElse Not IsLoggedIn() Then If WMLOGIN_DOMAIN <> String.Empty Then GetWMSessionAsUser(WMLOGIN_DOMAIN, Me.GetCurrentServer, WMLOGIN_USER, WMLOGIN_PW) Else @@ -123,7 +121,6 @@ Public Class ClassWindream_allgemein Return True End If - End Function Private Function GetWMSession() Try @@ -530,6 +527,9 @@ Public Class ClassWindream_allgemein ''' Public Function IsLoggedIn() As Boolean Try + If IsNothing(Me.oWMSession) Then + Return False + End If Return Me.oWMSession.aLoggedin Catch ex As Exception clsHelper.Add_Application_log("Unexpected error in Windream.IsLoggedIn: " & ex.Message) diff --git a/ToolCollection/frmNIHauptseite.vb b/ToolCollection/frmNIHauptseite.vb index aeaae59..d39567c 100644 --- a/ToolCollection/frmNIHauptseite.vb +++ b/ToolCollection/frmNIHauptseite.vb @@ -68,17 +68,9 @@ Public Class frmNIHauptseite _windreamNI = New ClassNIWindream(_MyLogger) database = New ClassNIDatenbankzugriff(_MyLogger) - ' 3b. Windream initialisieren (Connection, Session, ... aufbauen) - If _windreamNI.Init() = False Then - _Logger.Warn("Die Windream-Klasse konnte nicht initialisiert werden. Windream-Client unvollständig gestartert.") - Exit Sub - - End If 'ClassMoveRenameLogger.Init("", "MoveRename_", True) - - AddHandler bwProfil.DoWork, AddressOf bwProfil_DoWork AddHandler bwProfil.RunWorkerCompleted, AddressOf bwProfil_RunWorkerCompleted AddHandler bwProfil.ProgressChanged, AddressOf bwProfil_ProgressChanged