-
Notifications
You must be signed in to change notification settings - Fork 50
/
FormSettings.cs
485 lines (432 loc) · 22.5 KB
/
FormSettings.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
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
using System;
using System.ComponentModel;
using System.Windows.Forms;
using KeePass.UI;
namespace KeeTrayTOTP
{
/// <summary>
/// Form providing controls to customize the plugin's settings.
/// </summary>
internal partial class FormSettings : Form
{
/// <summary>
/// Helper delegate for cross thread UI operations
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private delegate void SafeCallDelegate(object sender, DoWorkEventArgs e);
/// <summary>
/// Plugin Host.
/// </summary>
private readonly KeeTrayTOTPExt _plugin;
/// <summary>
/// Windows Form Constructor.
/// </summary>
/// <param name="plugin">Plugin Host.</param>
internal FormSettings(KeeTrayTOTPExt plugin)
{
_plugin = plugin; //Defines variable from argument.
InitializeComponent(); //Form Initialization.
}
/// <summary>
/// Contains last network connection status. Is true by default to control user prompt.
/// </summary>
private bool _networkWasConnected = true;
/// <summary>
/// Windows Form Load.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void FormSettings_Load(object sender, EventArgs e)
{
GlobalWindowManager.AddWindow(this);
Text = Localization.Strings.Settings + @" - " + Localization.Strings.TrayTOTPPlugin; // Set form's name using constants.
Working(true, true); // Set controls depending on the state of action.
WorkerLoad.RunWorkerAsync(); // Load Settings in form controls.
}
/// <summary>
/// Windows Form Closing.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void FormSettings_FormClosing(object sender, FormClosingEventArgs e)
{
if (WorkerLoad.IsBusy)
{
ButtonCancel.Enabled = false;
WorkerLoad.CancelAsync();
e.Cancel = true;
}
if (WorkerSave.IsBusy)
{
ButtonCancel.Enabled = false;
WorkerSave.CancelAsync();
e.Cancel = true;
}
if (WorkerReset.IsBusy)
{
ButtonCancel.Enabled = false;
WorkerReset.CancelAsync();
e.Cancel = true;
}
}
private void ButtonReset_Click(object sender, EventArgs e)
{
if (MessageBox.Show(Localization.Strings.SettingsAskResetDefaultValues, Localization.Strings.TrayTOTPPlugin, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
Working(true, false); //Set controls depending on the state of action.
WorkerReset.RunWorkerAsync();
}
}
private void CheckBoxAutoType_CheckedChanged(object sender, EventArgs e)
{
GroupBoxAutoType.Enabled = CheckBoxAutoType.Checked;
}
private void CheckBoxAutoTypeFieldName_CheckedChanged(object sender, EventArgs e)
{
TextBoxAutoTypeFieldName.Enabled = CheckBoxAutoTypeFieldName.Checked;
if (!CheckBoxAutoTypeFieldName.Checked)
{
CheckBoxAutoTypeFieldRename.Checked = false;
}
}
private void CheckBoxAutoTypeFieldRename_CheckedChanged(object sender, EventArgs e)
{
if (CheckBoxAutoTypeFieldRename.Checked)
{
if (!_plugin.PluginHost.MainWindow.ActiveDatabase.IsOpen)
{
CheckBoxAutoTypeFieldRename.Checked = false;
if (_plugin.PluginHost.MainWindow.IsFileLocked(null))
{
MessageBox.Show(Localization.Strings.SettingsCurrentDatabaseLocked, Localization.Strings.TrayTOTPPlugin, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
MessageBox.Show(Localization.Strings.SettingsOpenDatabaseRequired, Localization.Strings.TrayTOTPPlugin, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (!CheckBoxAutoTypeFieldName.Checked)
{
CheckBoxAutoTypeFieldRename.Checked = false;
MessageBox.Show(Localization.Strings.SettingsEnableFieldRename, Localization.Strings.TrayTOTPPlugin, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
private void CheckBoxTimeCorrection_CheckedChanged(object sender, EventArgs e)
{
GroupBoxTimeCorrection.Enabled = CheckBoxTimeCorrection.Checked;
GroupBoxTimeCorrectonList.Enabled = CheckBoxTimeCorrection.Checked;
}
private void TabControlSettings_Selected(object sender, TabControlEventArgs e)
{
if (e.TabPage.Name == "TabPageSync")
{
ToolStripButtonRefreshTimeCorrection_Click(null, null);
}
}
private void ListViewTimeCorrectionList_DoubleClick(object sender, EventArgs e)
{
ToolStripButtonPropertiesTimeCorrection_Click(sender, e);
}
private void ToolStripButtonAddTimeCorrection_Click(object sender, EventArgs e)
{
var formTc = new FormTimeCorrection(_plugin);
if (formTc.ShowDialog() == DialogResult.OK)
{
ListViewTimeCorrectionList.Items.Add(formTc.ComboBoxUrlTimeCorrection.Text, 0);
}
}
private void ToolStripButtonPropertiesTimeCorrection_Click(object sender, EventArgs e)
{
if (ListViewTimeCorrectionList.SelectedItems.Count == 1)
{
ListViewItem thisItem = ListViewTimeCorrectionList.SelectedItems[0];
var formTc = new FormTimeCorrection(_plugin, thisItem.Text);
if (formTc.ShowDialog() == DialogResult.OK)
{
thisItem.SubItems[0].Text = formTc.ComboBoxUrlTimeCorrection.Text;
thisItem.SubItems[1].Text = string.Empty;
thisItem.ImageIndex = 0;
}
}
}
private void ToolStripButtonRemoveTimeCorrection_Click(object sender, EventArgs e)
{
if (ListViewTimeCorrectionList.SelectedItems.Count == 1)
{
ListViewTimeCorrectionList.SelectedItems[0].Remove();
}
}
private void ToolStripButtonRefreshTimeCorrection_Click(object sender, EventArgs e)
{
ListViewTimeCorrectionList.Items.Clear();
ListViewTimeCorrectionList.Items.AddRange(_plugin.TimeCorrections.ToLvi());
if (!_plugin.NetworkIsConnected)
{
if (_networkWasConnected)
{
MessageBox.Show(string.Format(Localization.Strings.SettingsNoInternetDetected, Environment.NewLine), Localization.Strings.TrayTOTPPlugin, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
ToolStripButtonAddTimeCorrection.Enabled = false;
ToolStripButtonPropertiesTimeCorrection.Enabled = false;
_networkWasConnected = false;
}
else
{
ToolStripButtonAddTimeCorrection.Enabled = true;
ToolStripButtonPropertiesTimeCorrection.Enabled = true;
_networkWasConnected = true;
}
}
private void ButtonOK_Click(object sender, EventArgs e)
{
if (HasErrors())
{
return;
}
Working(true, true); //Set controls depending on the state of action.
WorkerSave.RunWorkerAsync("OK");
}
private void ButtonCancel_Click(object sender, EventArgs e)
{
//Dialog Result = Cancel
}
private void ButtonApply_Click(object sender, EventArgs e)
{
if (HasErrors())
{
return;
}
Working(true, true); //Set controls depending on the state of action.
WorkerSave.RunWorkerAsync();
}
private bool HasErrors()
{
bool temp = false;
ErrorProviderSettings.SetError(ButtonOK, string.Empty);
ErrorProviderSettings.SetError(TextBoxAutoTypeFieldName, string.Empty);
ErrorProviderSettings.SetError(ComboBoxTOTPSeedStringName, string.Empty);
ErrorProviderSettings.SetError(ComboBoxTOTPSettingsStringName, string.Empty);
if (TextBoxAutoTypeFieldName.Text.Contains("{") || TextBoxAutoTypeFieldName.Text.Contains("}"))
{
ErrorProviderSettings.SetError(TextBoxAutoTypeFieldName, Localization.Strings.SettingsInvalidCharacter);
}
if (ComboBoxTOTPSeedStringName.Text == ComboBoxTOTPSettingsStringName.Text)
{
ErrorProviderSettings.SetError(ComboBoxTOTPSeedStringName, Localization.Strings.SettingsInvalidNameSetting);
ErrorProviderSettings.SetError(ComboBoxTOTPSettingsStringName, Localization.Strings.SettingsInvalidNameSeed);
}
if (ErrorProviderSettings.GetError(TextBoxAutoTypeFieldName) != string.Empty)
{
temp = true;
}
if (ErrorProviderSettings.GetError(ComboBoxTOTPSeedStringName) != string.Empty)
{
temp = true;
}
if (ErrorProviderSettings.GetError(ComboBoxTOTPSettingsStringName) != string.Empty)
{
temp = true;
}
if (temp)
{
ErrorProviderSettings.SetError(ButtonOK, Localization.Strings.SettingsErrors);
}
return temp;
}
private void Working(bool enable, bool cancellable)
{
UseWaitCursor = enable;
TabControlSettings.Enabled = !enable;
ButtonReset.Enabled = !enable;
ButtonOK.Enabled = !enable;
ButtonCancel.Enabled = cancellable;
ButtonApply.Enabled = !enable;
}
private void WorkerLoad_DoWork(object sender, DoWorkEventArgs e)
{
if (InvokeRequired)
{
var safeCallDelegate = new SafeCallDelegate(WorkerLoad_DoWork);
Invoke(safeCallDelegate, sender, e);
return;
}
// Argument
e.Result = e.Argument;
// Menus
CheckBoxShowCopyTOTPEntryMenu.Checked = _plugin.PluginHost.CustomConfig.GetBool(KeeTrayTOTPExt.setname_bool_EntryContextCopy_Visible, true);
CheckBoxShowSetupTOTPEntryMenu.Checked = _plugin.PluginHost.CustomConfig.GetBool(KeeTrayTOTPExt.setname_bool_EntryContextSetup_Visible, true);
CheckBoxShowTOTPEntriesTrayMenu.Checked = _plugin.PluginHost.CustomConfig.GetBool(KeeTrayTOTPExt.setname_bool_NotifyContext_Visible, true);
CheckBoxTrimTrayText.Checked = _plugin.PluginHost.CustomConfig.GetBool(KeeTrayTOTPExt.setname_bool_TrimTrayText, false);
if (WorkerLoad.CancellationPending) { e.Cancel = true; return; }
// TOTP Column
CheckBoxTOTPColumnClipboard.Checked = _plugin.PluginHost.CustomConfig.GetBool(KeeTrayTOTPExt.setname_bool_TOTPColumnCopy_Enable, true);
CheckBoxTOTPColumnTimer.Checked = _plugin.PluginHost.CustomConfig.GetBool(KeeTrayTOTPExt.setname_bool_TOTPColumnTimer_Visible, true);
if (WorkerLoad.CancellationPending) { e.Cancel = true; return; }
// Auto-Type
CheckBoxAutoType.Checked = _plugin.PluginHost.CustomConfig.GetBool(KeeTrayTOTPExt.setname_bool_AutoType_Enable, true);
TextBoxAutoTypeFieldName.Text = _plugin.PluginHost.CustomConfig.GetString(KeeTrayTOTPExt.setname_string_AutoType_FieldName, KeeTrayTOTPExt.setdef_string_AutoType_FieldName);
if (WorkerLoad.CancellationPending) { e.Cancel = true; return; }
// Time Correction
CheckBoxTimeCorrection.Checked = _plugin.PluginHost.CustomConfig.GetBool(KeeTrayTOTPExt.setname_bool_TimeCorrection_Enable, false);
NumericTimeCorrectionInterval.Value = Convert.ToDecimal(_plugin.PluginHost.CustomConfig.GetULong(KeeTrayTOTPExt.setname_ulong_TimeCorrection_RefreshTime, KeeTrayTOTPExt.setdef_ulong_TimeCorrection_RefreshTime));
ListViewTimeCorrectionList.Items.AddRange(_plugin.TimeCorrections.ToLvi());
if (WorkerLoad.CancellationPending) { e.Cancel = true; return; }
// Storage
if (_plugin.PluginHost.MainWindow.ActiveDatabase.IsOpen)
{
foreach (var pe in _plugin.PluginHost.MainWindow.ActiveDatabase.RootGroup.GetEntries(true))
{
foreach (var str in pe.Strings)
{
if (!ComboBoxTOTPSeedStringName.Items.Contains(str.Key))
{
ComboBoxTOTPSeedStringName.Items.Add(str.Key);
ComboBoxTOTPSettingsStringName.Items.Add(str.Key);
}
}
}
}
ComboBoxTOTPSeedStringName.Text = _plugin.PluginHost.CustomConfig.GetString(KeeTrayTOTPExt.setname_string_TOTPSeed_StringName, Localization.Strings.TOTPSeed);
ComboBoxTOTPSettingsStringName.Text = _plugin.PluginHost.CustomConfig.GetString(KeeTrayTOTPExt.setname_string_TOTPSettings_StringName, Localization.Strings.TOTPSettings);
if (WorkerLoad.CancellationPending)
{
e.Cancel = true;
}
}
private void WorkerLoad_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (e.Cancelled)
{
DialogResult = DialogResult.Cancel;
Close();
}
else
{
Working(false, true); // Set controls depending on the state of action.
if (e.Result != null && e.Result.ToString() == "Reset")
{
MessageBox.Show(Localization.Strings.SettingsDefaultValuesRestored, Localization.Strings.TrayTOTPPlugin, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
private void WorkerSave_DoWork(object sender, DoWorkEventArgs e)
{
//Argument
e.Result = e.Argument;
//Menus
_plugin.PluginHost.CustomConfig.SetBool(KeeTrayTOTPExt.setname_bool_EntryContextCopy_Visible, CheckBoxShowCopyTOTPEntryMenu.Checked);
_plugin.PluginHost.CustomConfig.SetBool(KeeTrayTOTPExt.setname_bool_EntryContextSetup_Visible, CheckBoxShowSetupTOTPEntryMenu.Checked);
_plugin.PluginHost.CustomConfig.SetBool(KeeTrayTOTPExt.setname_bool_NotifyContext_Visible, CheckBoxShowTOTPEntriesTrayMenu.Checked);
_plugin.PluginHost.CustomConfig.SetBool(KeeTrayTOTPExt.setname_bool_TrimTrayText, CheckBoxTrimTrayText.Checked);
if (WorkerSave.CancellationPending) { e.Cancel = true; return; }
//TOTP Column
_plugin.PluginHost.CustomConfig.SetBool(KeeTrayTOTPExt.setname_bool_TOTPColumnCopy_Enable, CheckBoxTOTPColumnClipboard.Checked);
_plugin.PluginHost.CustomConfig.SetBool(KeeTrayTOTPExt.setname_bool_TOTPColumnTimer_Visible, CheckBoxTOTPColumnTimer.Checked);
if (WorkerSave.CancellationPending) { e.Cancel = true; return; }
//Auto-Type
_plugin.PluginHost.CustomConfig.SetBool(KeeTrayTOTPExt.setname_bool_AutoType_Enable, CheckBoxAutoType.Checked);
if (CheckBoxAutoTypeFieldName.Checked)
{
string oldAutoTypeFieldName = _plugin.PluginHost.CustomConfig.GetString(KeeTrayTOTPExt.setname_string_AutoType_FieldName, KeeTrayTOTPExt.setdef_string_AutoType_FieldName).ExtWithBrackets();
string newAutoTypeFieldName = TextBoxAutoTypeFieldName.Text.ExtWithBrackets();
KeePass.Util.Spr.SprEngine.FilterPlaceholderHints.Remove(oldAutoTypeFieldName);
if (CheckBoxAutoTypeFieldRename.Checked) //Replace existing field of custom keystrokes from all entries and all groups
{
_plugin.PluginHost.MainWindow.ActiveDatabase.RootGroup.DefaultAutoTypeSequence = _plugin.PluginHost.MainWindow.ActiveDatabase.RootGroup.DefaultAutoTypeSequence.Replace(oldAutoTypeFieldName, newAutoTypeFieldName);
foreach (var group in _plugin.PluginHost.MainWindow.ActiveDatabase.RootGroup.GetGroups(true))
{
group.DefaultAutoTypeSequence = group.DefaultAutoTypeSequence.Replace(oldAutoTypeFieldName, newAutoTypeFieldName);
foreach (var pe in group.GetEntries(false))
{
foreach (var association in pe.AutoType.Associations)
{
association.Sequence = association.Sequence.Replace(oldAutoTypeFieldName, newAutoTypeFieldName);
}
}
}
}
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_string_AutoType_FieldName, TextBoxAutoTypeFieldName.Text);
KeePass.Util.Spr.SprEngine.FilterPlaceholderHints.Add(newAutoTypeFieldName);
}
if (WorkerSave.CancellationPending) { e.Cancel = true; return; }
//Time Correction
_plugin.PluginHost.CustomConfig.SetBool(KeeTrayTOTPExt.setname_bool_TimeCorrection_Enable, CheckBoxTimeCorrection.Checked);
_plugin.TimeCorrections.Enable = CheckBoxTimeCorrection.Checked;
_plugin.PluginHost.CustomConfig.SetULong(KeeTrayTOTPExt.setname_ulong_TimeCorrection_RefreshTime, Convert.ToUInt64(NumericTimeCorrectionInterval.Value));
KeeTrayTOTP.Libraries.TimeCorrectionProvider.Interval = Convert.ToInt16(NumericTimeCorrectionInterval.Value);
_plugin.TimeCorrections.ResetThenAddRangeFromLvIs(ListViewTimeCorrectionList.Items);
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_string_TimeCorrection_List, _plugin.TimeCorrections.ToSetting());
if (WorkerSave.CancellationPending) { e.Cancel = true; return; }
//Storage
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_string_TOTPSeed_StringName, ComboBoxTOTPSeedStringName.Text);
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_string_TOTPSettings_StringName, ComboBoxTOTPSettingsStringName.Text);
if (WorkerSave.CancellationPending)
{
e.Cancel = true;
}
}
private void WorkerSave_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (e.Cancelled)
{
DialogResult = DialogResult.Cancel;
Close();
}
else
{
Working(false, true); //Set controls depending on the state of action.
if (e.Result != null && e.Result.ToString() == "OK")
{
DialogResult = DialogResult.OK;
}
}
}
private void WorkerReset_DoWork(object sender, DoWorkEventArgs e)
{
// Menus
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_bool_EntryContextCopy_Visible, null);
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_bool_EntryContextSetup_Visible, null);
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_bool_NotifyContext_Visible, null);
// TOTP Column
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_bool_TOTPColumnCopy_Enable, null);
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_bool_TOTPColumnTimer_Visible, null);
// Auto-Type
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_bool_AutoType_Enable, null);
string oldAutoTypeFieldName = _plugin.PluginHost.CustomConfig.GetString(KeeTrayTOTPExt.setname_string_AutoType_FieldName, KeeTrayTOTPExt.setdef_string_AutoType_FieldName).ExtWithBrackets();
string newAutoTypeFieldName = Localization.Strings.TOTP.ExtWithBrackets();
KeePass.Util.Spr.SprEngine.FilterPlaceholderHints.Remove(oldAutoTypeFieldName);
_plugin.PluginHost.MainWindow.ActiveDatabase.RootGroup.DefaultAutoTypeSequence = _plugin.PluginHost.MainWindow.ActiveDatabase.RootGroup.DefaultAutoTypeSequence.Replace(oldAutoTypeFieldName, newAutoTypeFieldName);
foreach (var group in _plugin.PluginHost.MainWindow.ActiveDatabase.RootGroup.GetGroups(true))
{
group.DefaultAutoTypeSequence = group.DefaultAutoTypeSequence.Replace(oldAutoTypeFieldName, newAutoTypeFieldName);
foreach (var pe in group.GetEntries(false))
{
foreach (var association in pe.AutoType.Associations)
{
association.Sequence = association.Sequence.Replace(oldAutoTypeFieldName, newAutoTypeFieldName);
}
}
}
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_string_AutoType_FieldName, null);
KeePass.Util.Spr.SprEngine.FilterPlaceholderHints.Add(newAutoTypeFieldName);
// Time Correction
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_bool_TimeCorrection_Enable, null);
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_ulong_TimeCorrection_RefreshTime, null);
Libraries.TimeCorrectionProvider.Interval = Convert.ToInt16(KeeTrayTOTPExt.setdef_ulong_TimeCorrection_RefreshTime);
_plugin.TimeCorrections.ResetThenAddRangeFromString(string.Empty);
// Storage
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_string_TOTPSeed_StringName, null);
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_string_TOTPSettings_StringName, null);
}
private void WorkerReset_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
WorkerLoad.RunWorkerAsync("Reset");
}
private void FormSettings_FormClosed(object sender, FormClosedEventArgs e)
{
GlobalWindowManager.RemoveWindow(this);
}
}
}