Merge pull request #101 from Mbucari/master
Fixed cross thread bug and Enumerable change bug.
This commit is contained in:
commit
dccb2d73d6
@ -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;
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user