This commit is contained in:
Michael Bucari-Tovo 2022-06-10 20:45:10 -06:00
parent 4111d5fa48
commit f8f5eac109
6 changed files with 117 additions and 95 deletions

View file

@ -44,7 +44,7 @@
this.productsGrid.CoverClicked += new LibationWinForms.GridView.GridEntryClickedEventHandler(this.productsGrid_CoverClicked);
this.productsGrid.DetailsClicked += new LibationWinForms.GridView.LibraryBookEntryClickedEventHandler(this.productsGrid_DetailsClicked);
this.productsGrid.DescriptionClicked += new LibationWinForms.GridView.GridEntryRectangleClickedEventHandler(this.productsGrid_DescriptionClicked);
this.productsGrid.RemovableCountChanged += new LibationWinForms.GridView.GridEntryClickedEventHandler(this.productsGrid_RemovableCountChanged);
this.productsGrid.RemovableCountChanged += new System.EventHandler(this.productsGrid_RemovableCountChanged);
//
// ProductsDisplay
//

View file

@ -82,7 +82,7 @@ namespace LibationWinForms.GridView
#endregion
#region UI display functions
#region Scan and Remove Books
public void CloseRemoveBooksColumn()
=> productsGrid.RemoveColumnVisible = false;
@ -127,7 +127,7 @@ namespace LibationWinForms.GridView
foreach (var r in removable)
r.Remove = RemoveStatus.Removed;
productsGrid_RemovableCountChanged(null);
productsGrid_RemovableCountChanged(this, null);
}
catch (Exception ex)
{
@ -139,6 +139,10 @@ namespace LibationWinForms.GridView
}
}
#endregion
#region UI display functions
public void Display()
{
try
@ -183,9 +187,9 @@ namespace LibationWinForms.GridView
LiberateClicked?.Invoke(this, liveGridEntry.LibraryBook);
}
private void productsGrid_RemovableCountChanged(GridEntry liveGridEntry)
private void productsGrid_RemovableCountChanged(object sender, EventArgs e)
{
RemovableCountChanged?.Invoke(this, productsGrid.GetAllBookEntries().Count(lbe => lbe.Remove is RemoveStatus.Removed));
RemovableCountChanged?.Invoke(sender, productsGrid.GetAllBookEntries().Count(lbe => lbe.Remove is RemoveStatus.Removed));
}
}
}

View file

@ -23,7 +23,7 @@ namespace LibationWinForms.GridView
public event LibraryBookEntryClickedEventHandler DetailsClicked;
public event GridEntryRectangleClickedEventHandler DescriptionClicked;
public new event EventHandler<ScrollEventArgs> Scroll;
public event GridEntryClickedEventHandler RemovableCountChanged;
public event EventHandler RemovableCountChanged;
private GridEntryBindingList bindingList;
internal IEnumerable<LibraryBook> GetVisibleBooks()
@ -88,7 +88,7 @@ namespace LibationWinForms.GridView
if (e.ColumnIndex == removeGVColumn.Index)
{
gridEntryDataGridView.CommitEdit(DataGridViewDataErrorContexts.Commit);
RemovableCountChanged?.Invoke(entry);
RemovableCountChanged?.Invoke(this, EventArgs.Empty);
}
}