Merge pull request #101 from Mbucari/master

Fixed cross thread bug and Enumerable change bug.
This commit is contained in:
rmcrackan 2021-09-03 08:15:37 -04:00 committed by GitHub
commit dccb2d73d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,8 @@ namespace LibationWinForms.Dialogs
InitializeComponent(); InitializeComponent();
_labelFormat = label1.Text; _labelFormat = label1.Text;
_dataGridView.CellContentClick += (s, e) => _dataGridView.CommitEdit(DataGridViewDataErrorContexts.Commit); _dataGridView.CellContentClick += (_, _) => _dataGridView.CommitEdit(DataGridViewDataErrorContexts.Commit);
_dataGridView.CellValueChanged += (_, _) => UpdateSelection();
_dataGridView.BindingContextChanged += _dataGridView_BindingContextChanged; _dataGridView.BindingContextChanged += _dataGridView_BindingContextChanged;
var orderedGridEntries = _libraryBooks var orderedGridEntries = _libraryBooks
@ -58,7 +59,7 @@ namespace LibationWinForms.Dialogs
{ {
var removedBooks = await LibraryCommands.FindInactiveBooks((account) => new WinformResponder(account), _libraryBooks, _accounts); var removedBooks = await LibraryCommands.FindInactiveBooks((account) => new WinformResponder(account), _libraryBooks, _accounts);
var removable = _removableGridEntries.Where(rge => removedBooks.Any(rb => rb.Book.AudibleProductId == rge.AudibleProductId)); var removable = _removableGridEntries.Where(rge => removedBooks.Any(rb => rb.Book.AudibleProductId == rge.AudibleProductId)).ToList();
if (!removable.Any()) if (!removable.Any())
return; return;

View File

@ -134,7 +134,7 @@ namespace LibationWinForms
// suppressed filter while init'ing UI // suppressed filter while init'ing UI
var prev_isProcessingGridSelect = isProcessingGridSelect; var prev_isProcessingGridSelect = isProcessingGridSelect;
isProcessingGridSelect = true; isProcessingGridSelect = true;
setGrid(); this.UIThread(() => setGrid());
isProcessingGridSelect = prev_isProcessingGridSelect; isProcessingGridSelect = prev_isProcessingGridSelect;
// UI init complete. now we can apply filter // UI init complete. now we can apply filter