If DateTime.Now >= lngFajrTics And DateTime.Now < lngSunriseTics Then
SetExactAndAllowWhileIdle(lngSunriseTics -180000, "ServiceTimeForPrayer")
End If
If DateTime.Now >= lngSunriseTics And DateTime.Now < lngDhuhrTics Then
SetExactAndAllowWhileIdle(lngDhuhrTics -180000, "ServiceTimeForPrayer")
End If
If DateTime.Now >= lngDhuhrTics And DateTime.Now < lngAsrTics Then
SetExactAndAllowWhileIdle(lngAsrTics -180000, "ServiceTimeForPrayer")
End If
If DateTime.Now >= lngAsrTics And DateTime.Now < lngMagribTics Then
SetExactAndAllowWhileIdle(lngMagribTics -180000, "ServiceTimeForPrayer")
End If
If DateTime.Now >= lngMagribTics And DateTime.Now < lngIshaTics Then
SetExactAndAllowWhileIdle(lngIshaTics -180000, "ServiceTimeForPrayer")
End If
If DateTime.Now >= lngIshaTics Then
' For Fajr, this service needs to be set so it wakes up tomorrow since it's isha now.
'------------------------------------------------------------------------------------
pPeriodToAdd.Days = 1
lngFajrTics = DateUtils.AddPeriod(DateTime.Now, pPeriodToAdd)
SetExactAndAllowWhileIdle(lngFajrTics -180000, "ServiceTimeForPrayer")
End If
End Sub