-
Notifications
You must be signed in to change notification settings - Fork 2
/
Program.cs
51 lines (50 loc) · 1.95 KB
/
Program.cs
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
using Fishing.Properties;
using System;
using System.Windows.Forms;
namespace Fishing {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form form = null;
if (args.Length == 0)
{
args = new string[] { Resources.ArgumentNoArgs };
}
else if (args.Length == 1 && args[0] == Resources.ArgumentForceSync)
{
string[] message =
{
"You are about to force sync your FishDB with the remote database.",
"This will take a long time.",
"The program will exit when the sync is complete.",
"",
"It is suggested that you do not run another FishingForm while the sync is happening.",
"",
"Are you sure you want to do this?"
};
if (DialogResult.Yes == MessageBox.Show(string.Join(Environment.NewLine, message), Resources.MessageTitleForceSync, MessageBoxButtons.YesNo))
{
form = new FishingDBSyncForm();
}
else
{
args = new string[] { Resources.ArgumentNoArgs };
}
}
try
{
Application.Run(form ?? new FishingForm(args));
}
catch(Exception e)
{
MessageBox.Show(e.Message + Environment.NewLine + Environment.NewLine + e.StackTrace, Resources.MessageTitleFishingFormError, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}