-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainForm.cs
More file actions
158 lines (141 loc) · 6.97 KB
/
MainForm.cs
File metadata and controls
158 lines (141 loc) · 6.97 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
using System;
using System.Drawing;
using System.Windows.Forms;
namespace BitcoinFinder
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.Size = new Size(520, 420);
this.Text = "Bitcoin Finder - Выбор режима";
this.StartPosition = FormStartPosition.CenterScreen;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.BackColor = Color.WhiteSmoke;
var mainLayout = new TableLayoutPanel();
mainLayout.Dock = DockStyle.Fill;
mainLayout.ColumnCount = 1;
mainLayout.RowCount = 4;
mainLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 60F)); // Заголовок
mainLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 30F)); // Отступ
mainLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 210F)); // Кнопки
mainLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); // Инфо
mainLayout.Padding = new Padding(20, 20, 20, 20);
// Заголовок
var lblTitle = new Label();
lblTitle.Text = "Bitcoin Seed Phrase Finder";
lblTitle.Font = new Font("Segoe UI", 22F, FontStyle.Bold);
lblTitle.TextAlign = ContentAlignment.MiddleCenter;
lblTitle.Dock = DockStyle.Fill;
mainLayout.Controls.Add(lblTitle, 0, 0);
// Отступ
var spacer = new Panel { Height = 10, Dock = DockStyle.Fill };
mainLayout.Controls.Add(spacer, 0, 1);
// Кнопки выбора режима
var buttonPanel = new TableLayoutPanel();
buttonPanel.Dock = DockStyle.Fill;
buttonPanel.ColumnCount = 1;
buttonPanel.RowCount = 4;
buttonPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
buttonPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
buttonPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
buttonPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
buttonPanel.Padding = new Padding(10, 0, 10, 0);
buttonPanel.BackColor = Color.White;
// Кнопка автономного режима
var btnStandalone = new Button();
btnStandalone.Text = "🔍 Автономный поиск";
btnStandalone.Font = new Font("Segoe UI", 15F, FontStyle.Bold);
btnStandalone.BackColor = Color.FromArgb(220, 255, 220);
btnStandalone.ForeColor = Color.DarkGreen;
btnStandalone.Height = 50;
btnStandalone.Dock = DockStyle.Top;
btnStandalone.Margin = new Padding(0, 10, 0, 10);
btnStandalone.FlatStyle = FlatStyle.Flat;
btnStandalone.FlatAppearance.BorderSize = 0;
btnStandalone.Cursor = Cursors.Hand;
btnStandalone.Click += BtnStandalone_Click;
buttonPanel.Controls.Add(btnStandalone, 0, 0);
// Кнопка агентского режима
var btnAgent = new Button();
btnAgent.Text = "🤖 Режим агента (TCP)";
btnAgent.Font = new Font("Segoe UI", 15F, FontStyle.Bold);
btnAgent.BackColor = Color.FromArgb(220, 240, 255);
btnAgent.ForeColor = Color.DarkBlue;
btnAgent.Height = 50;
btnAgent.Dock = DockStyle.Top;
btnAgent.Margin = new Padding(0, 10, 0, 10);
btnAgent.FlatStyle = FlatStyle.Flat;
btnAgent.FlatAppearance.BorderSize = 0;
btnAgent.Cursor = Cursors.Hand;
btnAgent.Click += BtnAgent_Click;
buttonPanel.Controls.Add(btnAgent, 0, 1);
// Кнопка подключения агентов через Web API
var btnAgentWeb = new Button();
btnAgentWeb.Text = "🌐 Подключение агентов (Web API)";
btnAgentWeb.Font = new Font("Segoe UI", 15F, FontStyle.Bold);
btnAgentWeb.BackColor = Color.FromArgb(255, 220, 255);
btnAgentWeb.ForeColor = Color.DarkMagenta;
btnAgentWeb.Height = 50;
btnAgentWeb.Dock = DockStyle.Top;
btnAgentWeb.Margin = new Padding(0, 10, 0, 10);
btnAgentWeb.FlatStyle = FlatStyle.Flat;
btnAgentWeb.FlatAppearance.BorderSize = 0;
btnAgentWeb.Cursor = Cursors.Hand;
btnAgentWeb.Click += BtnAgentWeb_Click;
buttonPanel.Controls.Add(btnAgentWeb, 0, 2);
// Кнопка серверного режима
var btnServer = new Button();
btnServer.Text = "🖥️ Сервер координатор";
btnServer.Font = new Font("Segoe UI", 15F, FontStyle.Bold);
btnServer.BackColor = Color.FromArgb(255, 245, 200);
btnServer.ForeColor = Color.DarkOrange;
btnServer.Height = 50;
btnServer.Dock = DockStyle.Top;
btnServer.Margin = new Padding(0, 10, 0, 10);
btnServer.FlatStyle = FlatStyle.Flat;
btnServer.FlatAppearance.BorderSize = 0;
btnServer.Cursor = Cursors.Hand;
btnServer.Click += BtnServer_Click;
buttonPanel.Controls.Add(btnServer, 0, 3);
mainLayout.Controls.Add(buttonPanel, 0, 2);
// Информация
var lblInfo = new Label();
lblInfo.Text = "Выберите режим работы:\n\n" +
"• Автономный поиск — для локального поиска seed-фраз\n" +
"• Режим агента — для подключения к серверу координатору\n" +
"• Сервер координатор — для управления распределёнными агентами";
lblInfo.Font = new Font("Segoe UI", 11F);
lblInfo.TextAlign = ContentAlignment.TopCenter;
lblInfo.Dock = DockStyle.Fill;
mainLayout.Controls.Add(lblInfo, 0, 3);
this.Controls.Add(mainLayout);
}
private void BtnStandalone_Click(object? sender, EventArgs e)
{
var standaloneForm = new StandaloneForm();
standaloneForm.Show();
}
private void BtnAgent_Click(object? sender, EventArgs e)
{
var agentForm = new AgentForm();
agentForm.Show();
}
private void BtnServer_Click(object? sender, EventArgs e)
{
var serverForm = new ServerForm();
serverForm.Show();
}
private void BtnAgentWeb_Click(object? sender, EventArgs e)
{
var agentConnectionForm = new AgentConnectionForm();
agentConnectionForm.Show();
}
}
}