diff --git a/ToolCollection/My Project/Settings.Designer.vb b/ToolCollection/My Project/Settings.Designer.vb index 45e940b..3c52b24 100644 --- a/ToolCollection/My Project/Settings.Designer.vb +++ b/ToolCollection/My Project/Settings.Designer.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' Dieser Code wurde von einem Tool generiert. -' Laufzeitversion:4.0.30319.36366 +' Laufzeitversion:4.0.30319.42000 ' ' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn ' der Code erneut generiert wird. @@ -15,21 +15,21 @@ Option Explicit On Namespace My _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) -#Region "Funktion zum automatischen Speichern von My.Settings" +#Region "Automatische My.Settings-Speicherfunktion" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If @@ -898,6 +898,15 @@ Namespace My Return CType(Me("Sleep_End"),String) End Get End Property + + _ + Public ReadOnly Property NI_WORKING_HOURS() As String + Get + Return CType(Me("NI_WORKING_HOURS"),String) + End Get + End Property End Class End Namespace diff --git a/ToolCollection/My Project/Settings.settings b/ToolCollection/My Project/Settings.settings index a66bc97..8b6abe5 100644 --- a/ToolCollection/My Project/Settings.settings +++ b/ToolCollection/My Project/Settings.settings @@ -233,5 +233,8 @@ 0 + + 16;17;18;19;20 + \ No newline at end of file diff --git a/ToolCollection/app.config b/ToolCollection/app.config index 59fb5fb..45fb123 100644 --- a/ToolCollection/app.config +++ b/ToolCollection/app.config @@ -249,6 +249,9 @@ 0 + + 16;17;18;19;20 + diff --git a/ToolCollection/frmNIHauptseite.vb b/ToolCollection/frmNIHauptseite.vb index e348b05..3dd31f6 100644 --- a/ToolCollection/frmNIHauptseite.vb +++ b/ToolCollection/frmNIHauptseite.vb @@ -531,11 +531,27 @@ Public Class frmNIHauptseite ClassLoggerNI.Add(" ", False) If My.Settings.Sleep_Begin > 0 And My.Settings.Sleep_End > 0 Then If Now.Hour >= CInt(My.Settings.Sleep_Begin) And Now.Hour <= CInt(My.Settings.Sleep_End) Then - clsLogger.Add(String.Format(">> ToolCollection is in SleepMode - {0}-{1}-{2}", Now.Hour.ToString, My.Settings.Sleep_Begin.ToString, My.Settings.Sleep_End.ToString), False) + ClassLoggerNI.Add(String.Format(">> ToolCollection is in SleepMode - {0}-{1}-{2}", Now.Hour.ToString, My.Settings.Sleep_Begin.ToString, My.Settings.Sleep_End.ToString), False) lblStatus.Text = "In SleepMode" Exit Sub End If End If + Dim IsWorking_Hour = False + If My.Settings.NI_WORKING_HOURS <> "" Then + Dim hourarray As String() = My.Settings.NI_WORKING_HOURS.Split(";") + For Each _hour As String In hourarray + If Now.Hour = _hour Then + IsWorking_Hour = True + End If + Next + If IsWorking_Hour = False Then + ClassLoggerNI.Add(String.Format(">> ToolCollection is not in WorkingMode - NowHour: {0} - Working hours are: {1}", Now.Hour.ToString, My.Settings.NI_WORKING_HOURS), False) + lblStatus.Text = "No Working-Hour - Working hours are: " & My.Settings.NI_WORKING_HOURS + Exit Sub + End If + Else + IsWorking_Hour = True + End If If _windreamNI.Init() = False Then email.Send_EMail("Die Windream-Klasse konnte nicht initialisiert werden. Windream-Client unvollständig gestartert.") MsgBox("Die Windream-Klasse konnte nicht initialisiert werden. Windream-Client unvollständig gestartert.", MsgBoxStyle.Critical)