-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainForm.Designer.cs
More file actions
342 lines (302 loc) · 11.5 KB
/
MainForm.Designer.cs
File metadata and controls
342 lines (302 loc) · 11.5 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
using System;
using System.Drawing;
using System.Windows.Forms;
namespace ConfigMerger
{
partial class MainForm
{
private System.ComponentModel.IContainer components = null;
private Panel headerPanel;
private Label titleLabel;
private Label subtitleLabel;
private GroupBox sourceGroupBox;
private GroupBox targetGroupBox;
private Button sourceSelectBtn;
private Button targetSelectBtn;
private Label sourceStatusLabel;
private Label targetStatusLabel;
private Button compareBtn;
private Button resetBtn;
private TabControl resultsTabControl;
private RichTextBox mergedConfigTextBox;
private ListBox addedListBox;
private ListBox missingListBox;
private ListBox differentListBox;
private Label summaryLabel;
private Button copyBtn;
private ProgressBar progressBar;
private void InitializeComponent()
{
this.SuspendLayout();
// Настройки формы
this.Text = "Config Merger - Сравнение конфиг-файлов";
this.Size = new Size(1200, 800);
this.StartPosition = FormStartPosition.CenterScreen;
this.MinimumSize = new Size(800, 600);
this.BackColor = Color.FromArgb(240, 240, 240);
this.AutoScaleMode = AutoScaleMode.Font;
CreateHeaderPanel();
CreateUploadPanel();
CreateActionPanel();
CreateResultsSection();
// Добавляем контролы на форму
this.Controls.Add(resultsTabControl);
this.Controls.Add(CreateActionPanel());
this.Controls.Add(CreateUploadPanel());
this.Controls.Add(headerPanel);
this.ResumeLayout(false);
}
private void CreateHeaderPanel()
{
headerPanel = new Panel
{
Name = "headerPanel",
Dock = DockStyle.Top,
Height = 80,
BackColor = Color.FromArgb(79, 172, 254)
};
titleLabel = new Label
{
Text = "🔧 Сравнение конфиг-файлов",
Font = new Font("Segoe UI", 18, FontStyle.Bold),
ForeColor = Color.White,
Location = new Point(20, 15),
AutoSize = true
};
subtitleLabel = new Label
{
Text = "Загрузите два конфиг-файла для сравнения и объединения настроек",
Font = new Font("Segoe UI", 10),
ForeColor = Color.White,
Location = new Point(20, 45),
AutoSize = true
};
headerPanel.Controls.Add(titleLabel);
headerPanel.Controls.Add(subtitleLabel);
}
private Panel CreateUploadPanel()
{
var uploadPanel = new Panel
{
Dock = DockStyle.Top,
Height = 150,
Padding = new Padding(20, 20, 20, 10)
};
CreateSourceGroupBox();
CreateTargetGroupBox();
uploadPanel.Controls.Add(sourceGroupBox);
uploadPanel.Controls.Add(targetGroupBox);
return uploadPanel;
}
private void CreateSourceGroupBox()
{
sourceGroupBox = new GroupBox
{
Text = "📄 Исходный конфиг (с данными)",
Font = new Font("Segoe UI", 10, FontStyle.Bold),
Size = new Size(350, 120),
Location = new Point(20, 10),
ForeColor = Color.FromArgb(50, 50, 50)
};
sourceSelectBtn = new Button
{
Text = "Выбрать файл",
Size = new Size(120, 35),
Location = new Point(20, 30),
Font = new Font("Segoe UI", 9, FontStyle.Bold),
UseVisualStyleBackColor = false,
FlatStyle = FlatStyle.Flat,
TextAlign = ContentAlignment.MiddleCenter
};
sourceSelectBtn.Click += sourceSelectBtn_Click;
sourceStatusLabel = new Label
{
Text = "Файл не выбран",
Location = new Point(20, 75),
Size = new Size(300, 20),
Font = new Font("Segoe UI", 8),
ForeColor = Color.Gray
};
sourceGroupBox.Controls.Add(sourceSelectBtn);
sourceGroupBox.Controls.Add(sourceStatusLabel);
}
private void CreateTargetGroupBox()
{
targetGroupBox = new GroupBox
{
Text = "📋 Целевой конфиг (пустой)",
Font = new Font("Segoe UI", 10, FontStyle.Bold),
Size = new Size(350, 120),
Location = new Point(390, 10),
ForeColor = Color.FromArgb(50, 50, 50)
};
targetSelectBtn = new Button
{
Text = "Выбрать файл",
Size = new Size(120, 35),
Location = new Point(20, 30),
Font = new Font("Segoe UI", 9, FontStyle.Bold),
UseVisualStyleBackColor = false,
FlatStyle = FlatStyle.Flat,
TextAlign = ContentAlignment.MiddleCenter
};
targetSelectBtn.Click += targetSelectBtn_Click;
targetStatusLabel = new Label
{
Text = "Файл не выбран",
Location = new Point(20, 75),
Size = new Size(300, 20),
Font = new Font("Segoe UI", 8),
ForeColor = Color.Gray
};
targetGroupBox.Controls.Add(targetSelectBtn);
targetGroupBox.Controls.Add(targetStatusLabel);
}
private Panel CreateActionPanel()
{
var actionPanel = new Panel
{
Dock = DockStyle.Top,
Height = 60,
Padding = new Padding(20, 10, 20, 10)
};
compareBtn = new Button
{
Text = "🔍 Сравнить файлы",
Size = new Size(150, 30),
Location = new Point(400, 10),
Font = new Font("Segoe UI", 10, FontStyle.Bold),
Enabled = false,
UseVisualStyleBackColor = false,
FlatStyle = FlatStyle.Standard,
TextAlign = ContentAlignment.MiddleCenter
};
compareBtn.Click += compareBtn_Click;
resetBtn = new Button
{
Text = "🔄 Сбросить",
Size = new Size(150, 30),
Location = new Point(570, 10),
Font = new Font("Segoe UI", 10, FontStyle.Bold),
UseVisualStyleBackColor = false,
FlatStyle = FlatStyle.Standard,
TextAlign = ContentAlignment.MiddleCenter
};
resetBtn.Click += resetBtn_Click;
progressBar = new ProgressBar
{
Location = new Point(20, 25),
Size = new Size(300, 10),
Style = ProgressBarStyle.Marquee,
MarqueeAnimationSpeed = 30,
Visible = false
};
actionPanel.Controls.Add(compareBtn);
actionPanel.Controls.Add(resetBtn);
actionPanel.Controls.Add(progressBar);
return actionPanel;
}
private void CreateResultsSection()
{
resultsTabControl = new TabControl
{
Dock = DockStyle.Fill,
Font = new Font("Segoe UI", 9),
Padding = new Point(20, 10)
};
CreateSummaryTab();
CreateMergedConfigTab();
CreateAddedTab();
CreateMissingTab();
CreateDifferentTab();
}
private void CreateSummaryTab()
{
var summaryTab = new TabPage("📊 Сводка");
summaryLabel = new Label
{
Dock = DockStyle.Top,
Font = new Font("Segoe UI", 11),
Padding = new Padding(20),
Height = 100,
BackColor = Color.FromArgb(102, 126, 234),
ForeColor = Color.White,
TextAlign = ContentAlignment.MiddleCenter
};
summaryTab.Controls.Add(summaryLabel);
resultsTabControl.TabPages.Add(summaryTab);
}
private void CreateMergedConfigTab()
{
var mergedTab = new TabPage("📝 Объединенный конфиг");
var mergedPanel = new Panel
{
Dock = DockStyle.Fill,
Padding = new Padding(10)
};
copyBtn = new Button
{
Text = "📋 Скопировать",
Size = new Size(120, 30),
Location = new Point(10, 10),
Font = new Font("Segoe UI", 9, FontStyle.Bold),
BackColor = Color.FromArgb(40, 167, 69),
ForeColor = Color.White,
FlatStyle = FlatStyle.Flat,
TextAlign = ContentAlignment.MiddleCenter
};
copyBtn.Click += copyBtn_Click;
mergedConfigTextBox = new RichTextBox
{
Location = new Point(10, 50),
Font = new Font("Consolas", 9),
BackColor = Color.FromArgb(248, 249, 250),
ReadOnly = true,
ScrollBars = RichTextBoxScrollBars.Both,
Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right
};
mergedPanel.Controls.Add(mergedConfigTextBox);
mergedTab.Controls.Add(mergedPanel);
resultsTabControl.TabPages.Add(mergedTab);
}
private void CreateAddedTab()
{
var addedTab = new TabPage("➕ Новые параметры");
addedListBox = new ListBox
{
Dock = DockStyle.Fill,
Font = new Font("Consolas", 9),
BackColor = Color.FromArgb(232, 245, 232),
BorderStyle = BorderStyle.None
};
addedTab.Controls.Add(addedListBox);
resultsTabControl.TabPages.Add(addedTab);
}
private void CreateMissingTab()
{
var missingTab = new TabPage("❌ Отсутствующие");
missingListBox = new ListBox
{
Dock = DockStyle.Fill,
Font = new Font("Consolas", 9),
BackColor = Color.FromArgb(255, 234, 234),
BorderStyle = BorderStyle.None
};
missingTab.Controls.Add(missingListBox);
resultsTabControl.TabPages.Add(missingTab);
}
private void CreateDifferentTab()
{
var differentTab = new TabPage("🔄 Измененные");
differentListBox = new ListBox
{
Dock = DockStyle.Fill,
Font = new Font("Consolas", 9),
BackColor = Color.FromArgb(255, 243, 205),
BorderStyle = BorderStyle.None
};
differentTab.Controls.Add(differentListBox);
resultsTabControl.TabPages.Add(differentTab);
}
}
}