This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathProgram.cs
105 lines (94 loc) · 3.05 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using System;
using System.Windows.Forms;
namespace PlenteumWallet
{
static class Program
{
public static bool jumpBack = false;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
#if DEBUG
Properties.Settings.Default.Reset();
#endif
if (Environment.OSVersion.Version.Major >= 6)
{
SetProcessDPIAware();
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var uPrompt = new UpdatePrompt();
uPrompt.ShowDialog();
string _pass = "";
string _wallet = "";
/* Reopen wallet from last time */
if (Properties.Settings.Default.walletPath != "" && System.IO.File.Exists(Properties.Settings.Default.walletPath))
{
var pPrompt = new PasswordPrompt();
var pResult = pPrompt.ShowDialog();
if (pResult != DialogResult.OK)
{
SelectionPrompt sPrompt = new SelectionPrompt();
sPrompt.ShowDialog();
if (sPrompt.DialogResult != DialogResult.OK)
{
return;
}
else
{
_pass = sPrompt.WalletPassword;
_wallet = sPrompt.WalletPath;
}
}
else
{
_pass = pPrompt.WalletPassword;
_wallet = Properties.Settings.Default.walletPath;
Utilities.Close(pPrompt);
}
}
else
{
SelectionPrompt sPrompt = new SelectionPrompt();
sPrompt.ShowDialog();
if (sPrompt.DialogResult != DialogResult.OK)
{
return;
}
else
{
_pass = sPrompt.WalletPassword;
_wallet = sPrompt.WalletPath;
}
}
jumpBackFlag:
var splash = new Splash(_wallet,_pass);
Application.Run(splash);
if (jumpBack) //Hacky, but will work for now until a proper loop can be placed.
{
jumpBack = false;
goto jumpBackFlag;
}
}
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetProcessDPIAware();
}
class NoBorderTabControl : TabControl
{
private const int TCM_ADJUSTRECT = 0x1328;
protected override void WndProc(ref Message m)
{
// Hide the tab headers at run-time
if (m.Msg == TCM_ADJUSTRECT && !DesignMode)
{
m.Result = (IntPtr)1;
return;
}
// call the base class implementation
base.WndProc(ref m);
}
}
}