-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
58 lines (52 loc) · 1.46 KB
/
Copy pathProgram.cs
File metadata and controls
58 lines (52 loc) · 1.46 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 System;
using System.Threading;
using System.Windows.Forms;
namespace Calculator
{
public class ProgramHandler : ApplicationContext
{
public enum CalculatorType {
Standard,
Scientific
}
public static CalculatorType calcType = CalculatorType.Standard;
public ProgramHandler()
{
Form1 form1 = new Form1();
Form2 form2 = new Form2();
DialogResult? result = null;
//form1.Show();
switch (calcType)
{
case CalculatorType.Standard:
result = form1.ShowDialog();
break;
case CalculatorType.Scientific:
result = form2.ShowDialog();
break;
}
while (result == DialogResult.Retry)
{
switch (calcType)
{
case CalculatorType.Standard:
result = form1.ShowDialog();
break;
case CalculatorType.Scientific:
result = form2.ShowDialog();
break;
}
}
Environment.Exit(0);
}
}
static class Program
{
[STAThread]
static void Main(string[] args)
{
ProgramHandler context = new ProgramHandler();
Application.Run(context);
}
}
}