-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
58 lines (50 loc) · 1.52 KB
/
Copy pathProgram.cs
File metadata and controls
58 lines (50 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using BeTimelyProject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ProductivBoostProject
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Engine e = new Engine();
e.MainForm.FormClosing += new FormClosingEventHandler(e.MainForm_FormClosing);
Application.Run(e.MainForm);
//Application.Run(new SettingsForm());
}
}
public class Engine
{
public MainForm MainForm;
public Engine()
{
this.MainForm = new MainForm();
}
public void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (MainForm.CurrentRoutineTasks.Count != 0)
{
DialogResult result = MessageBox.Show(
"You currently have an active routine. Are you sure to stop and exit program?", "",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
e.Cancel = (result == DialogResult.No);
}
else
{
e.Cancel = false;
}
}
}
}