Skip to content

Commit e45ba06

Browse files
committed
Update MainForm.cs
1 parent b9d642b commit e45ba06

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

SignToolGUI/Forms/MainForm.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,9 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
10421042
// Show the output textbox the job has started
10431043
textBoxOutput.AppendText("[JOB] Initiating Job of " + _totalJob + " Files" + Environment.NewLine);
10441044

1045+
// Log the signing process started message
1046+
Message("Signing process started...", EventType.Information, 1045);
1047+
10451048
// Sign the files from the list selected - if 0 files are selected, show a message box and return
10461049
if (checkedListBoxFiles.CheckedItems.Count == 0)
10471050
{
@@ -1050,6 +1053,11 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
10501053
Please select one or more binaries into the list above to proceed!", @"No files to sign selected",
10511054
MessageBoxButtons.OK, MessageBoxIcon.Question);
10521055
DisableForm(false);
1056+
1057+
// Log the signing process cancelled message
1058+
Message("Signing process cancelled - no files selected", EventType.Information, 1046);
1059+
1060+
// Return from the method if no files are selected
10531061
return;
10541062
}
10551063

@@ -1061,6 +1069,9 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
10611069
{
10621070
try
10631071
{
1072+
// Log signing process started message for Windows Certificate Store
1073+
Message("Signing process started for Windows Certificate Store...", EventType.Information, 1047);
1074+
10641075
// Disables the form's controls while signing the files
10651076
ToggleDisabledForm(true);
10661077

@@ -1132,6 +1143,9 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
11321143
var filename = Path.GetFileName(file.ToString());
11331144
textBoxOutput.AppendText($"Signing file: '{filename}'...{Environment.NewLine}");
11341145

1146+
// Log the signing process started message for file
1147+
Message("Signing process started for file: '" + filename + "'", EventType.Information, 1053);
1148+
11351149
// Sign file with SignerThumbprint
11361150
signer.Sign(file.ToString());
11371151

@@ -1147,6 +1161,9 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
11471161

11481162
// Enable the form's controls after signing the files again and show the output in the textbox
11491163
ToggleDisabledForm(false);
1164+
1165+
// Log the signing process completed message
1166+
Message("Signing process completed for Windows Certificate Store", EventType.Information, 1048);
11501167
}
11511168
catch (Exception exception)
11521169
{
@@ -1158,6 +1175,9 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
11581175
{
11591176
try
11601177
{
1178+
// Log signing process started message for PFX Certificate
1179+
Message("Signing process started for PFX Certificate...", EventType.Information, 1048);
1180+
11611181
ToggleDisabledForm(true);
11621182
textBoxOutput.Clear();
11631183
SignerPfx signer = new SignerPfx(textBoxSignToolPath.Text, textBoxPFXFile.Text, textBoxPFXPassword.Text,
@@ -1224,6 +1244,9 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
12241244
var filename = Path.GetFileName(file.ToString());
12251245
textBoxOutput.AppendText($"Signing file: '{filename}'...{Environment.NewLine}");
12261246

1247+
// Log the signing process started message for file
1248+
Message("Signing process started for file: '" + filename + "'", EventType.Information, 1053);
1249+
12271250
// Sign file with SignerPfx class
12281251
signer.Sign(file.ToString());
12291252

@@ -1237,7 +1260,11 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
12371260
//statusLabel.Text = @"[JOB] Signed " + jobSigned + @" of " + totalJob + @" File(s)";
12381261
}
12391262

1263+
// Enable the form's controls after signing the files again and show the output in the textbox
12401264
ToggleDisabledForm(false);
1265+
1266+
// Log the signing process completed message
1267+
Message("Signing process completed for PFX Certificate", EventType.Information, 1049);
12411268
}
12421269
catch (Exception exception)
12431270
{
@@ -1249,6 +1276,9 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
12491276
{
12501277
try
12511278
{
1279+
// Log signing process started message for Trusted Signing Certificate
1280+
Message("Signing process started for Trusted Signing Certificate...", EventType.Information, 1049);
1281+
12521282
// Get the values from the form's controls for the SignerTrustedSigning class
12531283
var signToolExe = textBoxSignToolPath.Text;
12541284
var timeStampServer = "http://timestamp.acs.microsoft.com";
@@ -1331,6 +1361,9 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
13311361
var filename = Path.GetFileName(file.ToString());
13321362
textBoxOutput.AppendText($"Signing file: '{filename}'...{Environment.NewLine}");
13331363

1364+
// Log the signing process started message for file
1365+
Message("Signing process started for file: '" + filename + "'", EventType.Information, 1053);
1366+
13341367
// Sign file with SignerTrustedSigning class
13351368
signer.Sign(file.ToString());
13361369

@@ -1344,7 +1377,11 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
13441377
//statusLabel.Text = @"[JOB] Signed " + jobSigned + @" of " + totalJob + @" File(s)";
13451378
}
13461379

1380+
// Enable the form's controls after signing the files again and show the output in the textbox
13471381
ToggleDisabledForm(false);
1382+
1383+
// Log the signing process completed message
1384+
Message("Signing process completed for Trusted Signing Certificate", EventType.Information, 1050);
13481385
}
13491386
catch (Exception exception)
13501387
{
@@ -1391,6 +1428,9 @@ private void SplitButtonSign_Click(object sender, EventArgs e)
13911428

13921429
// Enable the form's controls after signing the files again and show the output in the textbox
13931430
DisableForm(false);
1431+
1432+
// Log the signing process completed message
1433+
Message("Signing process completed", EventType.Information, 1051);
13941434
}
13951435

13961436
private void buttonShowAllCertDataPopup_Click(object sender, EventArgs e)

0 commit comments

Comments
 (0)