Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ClockApp.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30717.126
# Visual Studio Version 17
VisualStudioVersion = 17.6.33723.286
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClockApp", "ClockApp.csproj", "{3ECFD9F1-856C-4EF2-A0FD-3AF4E81CB076}"
EndProject
Expand Down
31 changes: 30 additions & 1 deletion ClockTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms.VisualStyles;
using System.Windows.Forms;
using Microsoft.Win32;

namespace ClockApp
{
Expand All @@ -14,11 +17,37 @@ class WorldTime

class Alarm
{
public Label LabelTime;
public Label LabelMessage;
public TimeSpan TimeOfDay = new TimeSpan();
public TimeSpan RealTime = new TimeSpan();
public bool[] ActiveDays = { true, true, true, true, true, true, true };
public bool IsActive = false;
public bool IsActive = true;
public bool IsRepeating = true;
public string Text;
public GroupBox AlarmGroupBox;

public void Tick()
{
if (IsActive)
{
DateTime time = DateTime.Now;
if ((time.DayOfWeek == DayOfWeek.Monday && ActiveDays[0]) ||
(time.DayOfWeek == DayOfWeek.Tuesday && ActiveDays[1]) ||
(time.DayOfWeek == DayOfWeek.Wednesday && ActiveDays[2]) ||
(time.DayOfWeek == DayOfWeek.Thursday && ActiveDays[3]) ||
(time.DayOfWeek == DayOfWeek.Friday && ActiveDays[4]) ||
(time.DayOfWeek == DayOfWeek.Saturday && ActiveDays[5]) ||
(time.DayOfWeek == DayOfWeek.Sunday && ActiveDays[6]) )
{
TimeSpan now = new TimeSpan(time.Hour, time.Minute, time.Second);
if (now == RealTime)
{
MessageBox.Show(Text);
}
}
}
}
}

class Timer
Expand Down
Loading