Skip to content

Commit aff7ebf

Browse files
committed
Update some log, UI and functions
1 parent 74580be commit aff7ebf

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

SignToolGUI/Forms/MainForm.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SignToolGUI/Forms/MainForm.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ private void PopulateComboBox()
294294

295295
private void AddTimestampProvider(string displayName, string url)
296296
{
297-
if (!comboBoxTimestampProviders.Items.Cast<TimestampProvider>().Any(item => item.DisplayName == displayName))
297+
if (comboBoxTimestampProviders.Items.Cast<TimestampProvider>().All(item => item.DisplayName != displayName))
298298
{
299299
comboBoxTimestampProviders.Items.Add(new TimestampProvider(displayName, url));
300300
}
@@ -1499,7 +1499,7 @@ private void ButtonAddDirectory_Click(object sender, EventArgs e)
14991499
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
15001500
{
15011501
// count files before add selected files
1502-
var currentFiles = checkedListBoxFiles.Items.Count;
1502+
var currentFiles = checkedListBoxFiles?.Items.Count ?? 0;
15031503
try
15041504
{
15051505
var searchOption = SearchOption.TopDirectoryOnly;
@@ -1515,15 +1515,15 @@ private void ButtonAddDirectory_Click(object sender, EventArgs e)
15151515
// loop in all files
15161516
foreach (var file in files)
15171517
{
1518-
checkedListBoxFiles.Items.Add(file);
1518+
checkedListBoxFiles?.Items.Add(file);
15191519
}
15201520

15211521
// calc added files
1522-
var totalFiles = checkedListBoxFiles.Items.Count;
1523-
var addedFiles = currentFiles - totalFiles;
1522+
var totalFiles = checkedListBoxFiles?.Items.Count ?? 0;
1523+
var addedFiles = totalFiles - currentFiles;
15241524

15251525
// show status
1526-
statusLabel.Text = @"[INFO] " + addedFiles + @" file(s) imported to File List from folder";
1526+
statusLabel.Text = @"[INFO] " + addedFiles + @" file(s) imported to File List from selected folder";
15271527
}
15281528
catch
15291529
{

0 commit comments

Comments
 (0)