This commit is contained in:
Digital Data - Marlon Schreiber 2018-10-04 12:26:11 +02:00
parent 77864646a7
commit eecaea85f3
3 changed files with 46 additions and 34 deletions

View File

@ -190,6 +190,7 @@ Public Class ClassInit
Try
WMSESSION_STARTSTOP_STARTUP = DT.Rows(0).Item("WMSESSION_STARTSTOP_STARTUP")
Catch ex As Exception
ClassLogger.Add("Unexpected Error in Settings_LoadBasicConfig: " & ex.Message, True)
WMSESSION_STARTSTOP_STARTUP = False
End Try

View File

@ -130,34 +130,34 @@ Public Class ClassWindream_allgemein
End Function
Public Function Start_WMCC_andCo()
Try
If WMSESSION_STARTSTOP_STARTUP = True Then
ClassLogger.Add(">> WINDREAM-Start on ApplicationStart is active!", False)
If WMSESSION_STARTSTOP_STARTUP = True Then
Try
Dim owindreamControlCenter = CreateObject("Wmcc.ControlCenter")
Dim owindreamIndexService = CreateObject("WMIndexServer.WMIdxSvControl")
owindreamControlCenter.StartVFSService(1)
System.Threading.Thread.Sleep(1000)
owindreamIndexService.Start()
System.Threading.Thread.Sleep(1500)
Create_Session()
Catch ex As Exception
ClassLogger.Add("Error while starting up WMCC and IndexService: " & ex.Message, True)
End Try
End If
End If
Create_Session()
Catch ex As Exception
ClassLogger.Add("Error while starting up WMCC and IndexService: " & ex.Message, True)
End Try
End Function
Public Function Stop_WMCC_andCo()
If WMSESSION_STARTSTOP_STARTUP = True Then
Try
Try
If WMSESSION_STARTSTOP_STARTUP = True Then
Dim owindreamControlCenter = CreateObject("Wmcc.ControlCenter")
Dim owindreamIndexService = CreateObject("WMIndexServer.WMIdxSvControl")
owindreamControlCenter.StartVFSService(0)
owindreamIndexService.Shutdown()
owindreamControlCenter.ExitCC(0)
Catch ex As Exception
ClassLogger.Add("Error while Stopping WMCC and IndexService: " & ex.Message, True)
End Try
End If
owindreamControlCenter.StartVFSService(0)
owindreamIndexService.Shutdown()
owindreamControlCenter.ExitCC(0)
End If
Catch ex As Exception
ClassLogger.Add("Error while Stopping WMCC and IndexService: " & ex.Message, True)
End Try
End Function
#End Region

View File

@ -24,7 +24,7 @@ Public Class frmMain
Private GRID_INV_COL_REMOVED As Boolean = False
Private _windream As New ClassWindream_allgemein
Private Sub frmProfiles_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Try
' Position und Größe speichern
My.Settings.frmMainSize = Me.Size
@ -48,14 +48,14 @@ Public Class frmMain
End Try
End Sub
Private Sub frmProfiles_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
Private Sub frmMain_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
Select Case e.KeyCode
Case Keys.F12
frmLicense.ShowDialog()
End Select
End Sub
Private Sub frmProfiles_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Private Sub frmMain_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If LogErrorsOnly = False Then ClassLogger.Add(" >> Initializing MainForm....", False)
Try
UserLookAndFeel.Default.SetSkinStyle("VS2010")
@ -120,23 +120,34 @@ Public Class frmMain
Catch ex As Exception
MsgBox("Fehler bei Laden des Formulars: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
If UniversalViewer = "" And Viewer = "uviewer" Then
MsgBox("Definieren Sie wo UniversalViewer abgelegt wurde!", MsgBoxStyle.Critical, "Fehlende Konfiguration")
frmKonfig.ShowDialog()
End If
If TimerRefresh.Enabled = False Then
TimerRefresh.Start()
End If
Try
If UniversalViewer = "" And Viewer = "uviewer" Then
MsgBox("Definieren Sie wo UniversalViewer abgelegt wurde!", MsgBoxStyle.Critical, "Fehlende Konfiguration")
frmKonfig.ShowDialog()
End If
If TimerRefresh.Enabled = False Then
TimerRefresh.Start()
End If
Catch ex As Exception
MsgBox("Unexpected Error in LoadForm - Step 4: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
End Try
Load_Profile_items()
Check_Timer_Notification()
Restore_Form_Position()
_windreamPM = New ClassPMWindream
_windreamPM.Start_WMCC_andCo()
If _windreamPM.oSession.aLoggedin = False Then
MsgBox("Login on windream was not possible. Please check the log." & vbNewLine & "Application will close now!", MsgBoxStyle.Critical)
Me.Close()
End If
Try
_windreamPM = New ClassPMWindream
_windreamPM.Start_WMCC_andCo()
If _windreamPM.oSession.aLoggedin = False Then
MsgBox("Login on windream was not possible. Please check the log." & vbNewLine & "Application will close now!", MsgBoxStyle.Critical)
Me.Close()
End If
Catch ex As Exception
MsgBox("Unexpected Error in windream-login - Step 5: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
End Try
If LogErrorsOnly = False Then ClassLogger.Add(" >> MainForm initialized!", False)
End If