-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLegalDisclaimer.cs
94 lines (85 loc) · 2.7 KB
/
LegalDisclaimer.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Telerik.WinControls.UI;
using System.IO;
using System.Diagnostics;
using Charon_Hash_Detector.Core;
namespace Charon_Hash_Detector
{
public partial class LegalDisclaimer : RadForm
{
public LegalDisclaimer()
{
InitializeComponent();
legal_dis.Text = Charon_Hash_Detector.Core.LegalConfig.Legal_disclaimer_content();
}
private void bt_Accept_Click(object sender, EventArgs e)
{
try
{
Directory.CreateDirectory(Config.TempDIR);
if (!File.Exists(Config.LegalFile))
{
using (FileStream fs = File.Create(Config.LegalFile))
{
// Ensures the file is closed immediately after creation
}
}
this.Enabled = false;
this.Hide();
MainWindow MainWIN = new MainWindow();
MainWIN.Show();
//this.Close(); // Optional, if you want to close the disclaimer form completely
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void bt_Decline_Click(object sender, EventArgs e)
{
Process.GetCurrentProcess().Kill();
Environment.Exit(0);
}
private void LegalDisclaimer_FormClosing(object sender, FormClosingEventArgs e)
{
//e.Cancel = true;
//this.Hide();
}
private void LegalDisclaimer_Shown(object sender, EventArgs e)
{
if (Directory.Exists(Config.TempDIR))
{
if (File.Exists(Config.LegalFile))
{
this.Opacity = 0;
this.Hide();
MainWindow MainWIN = new MainWindow();
MainWIN.Show();
}
else
{
using (FileStream fs = File.Create(Config.LegalFile))
{
// Ensures the file is closed immediately after creation
}
}
}
else
{
this.Enabled = true;
this.Opacity = 100;
}
}
private void LegalDisclaimer_Load(object sender, EventArgs e)
{
}
}
}