diff --git a/LibationWinForms/Properties/Resources.Designer.cs b/LibationWinForms/Properties/Resources.Designer.cs
index fde009ab..f3a66cd5 100644
--- a/LibationWinForms/Properties/Resources.Designer.cs
+++ b/LibationWinForms/Properties/Resources.Designer.cs
@@ -109,5 +109,125 @@ namespace LibationWinForms.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_green {
+ get {
+ object obj = ResourceManager.GetObject("liberate_green", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_green_pdf_blank {
+ get {
+ object obj = ResourceManager.GetObject("liberate_green_pdf_blank", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_green_pdf_no {
+ get {
+ object obj = ResourceManager.GetObject("liberate_green_pdf_no", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_green_pdf_yes {
+ get {
+ object obj = ResourceManager.GetObject("liberate_green_pdf_yes", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_red {
+ get {
+ object obj = ResourceManager.GetObject("liberate_red", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_red_pdf_blank {
+ get {
+ object obj = ResourceManager.GetObject("liberate_red_pdf_blank", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_red_pdf_no {
+ get {
+ object obj = ResourceManager.GetObject("liberate_red_pdf_no", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_red_pdf_yes {
+ get {
+ object obj = ResourceManager.GetObject("liberate_red_pdf_yes", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_yellow {
+ get {
+ object obj = ResourceManager.GetObject("liberate_yellow", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_yellow_pdf_blank {
+ get {
+ object obj = ResourceManager.GetObject("liberate_yellow_pdf_blank", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_yellow_pdf_no {
+ get {
+ object obj = ResourceManager.GetObject("liberate_yellow_pdf_no", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap liberate_yellow_pdf_yes {
+ get {
+ object obj = ResourceManager.GetObject("liberate_yellow_pdf_yes", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
}
}
diff --git a/LibationWinForms/Properties/Resources.resx b/LibationWinForms/Properties/Resources.resx
index 1f866c77..7ea4d816 100644
--- a/LibationWinForms/Properties/Resources.resx
+++ b/LibationWinForms/Properties/Resources.resx
@@ -133,4 +133,40 @@
..\Resources\edit-tags-50x50.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\liberate_green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_green_pdf_blank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_green_pdf_no.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_green_pdf_yes.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_red.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_red_pdf_blank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_red_pdf_no.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_red_pdf_yes.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_yellow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_yellow_pdf_blank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_yellow_pdf_no.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\liberate_yellow_pdf_yes.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/LibationWinForms/Resources/liberate and pdf icons.pdn b/LibationWinForms/Resources/liberate and pdf icons.pdn
new file mode 100644
index 00000000..87c4f6dc
Binary files /dev/null and b/LibationWinForms/Resources/liberate and pdf icons.pdn differ
diff --git a/LibationWinForms/Resources/liberate icons.pdn b/LibationWinForms/Resources/liberate icons.pdn
new file mode 100644
index 00000000..80c6c1f8
Binary files /dev/null and b/LibationWinForms/Resources/liberate icons.pdn differ
diff --git a/LibationWinForms/Resources/liberate_green.png b/LibationWinForms/Resources/liberate_green.png
new file mode 100644
index 00000000..b552ac62
Binary files /dev/null and b/LibationWinForms/Resources/liberate_green.png differ
diff --git a/LibationWinForms/Resources/liberate_green_pdf_blank.png b/LibationWinForms/Resources/liberate_green_pdf_blank.png
new file mode 100644
index 00000000..3c32720b
Binary files /dev/null and b/LibationWinForms/Resources/liberate_green_pdf_blank.png differ
diff --git a/LibationWinForms/Resources/liberate_green_pdf_no.png b/LibationWinForms/Resources/liberate_green_pdf_no.png
new file mode 100644
index 00000000..05be229f
Binary files /dev/null and b/LibationWinForms/Resources/liberate_green_pdf_no.png differ
diff --git a/LibationWinForms/Resources/liberate_green_pdf_yes.png b/LibationWinForms/Resources/liberate_green_pdf_yes.png
new file mode 100644
index 00000000..87868b75
Binary files /dev/null and b/LibationWinForms/Resources/liberate_green_pdf_yes.png differ
diff --git a/LibationWinForms/Resources/liberate_red.png b/LibationWinForms/Resources/liberate_red.png
new file mode 100644
index 00000000..8e74022c
Binary files /dev/null and b/LibationWinForms/Resources/liberate_red.png differ
diff --git a/LibationWinForms/Resources/liberate_red_pdf_blank.png b/LibationWinForms/Resources/liberate_red_pdf_blank.png
new file mode 100644
index 00000000..5793eb77
Binary files /dev/null and b/LibationWinForms/Resources/liberate_red_pdf_blank.png differ
diff --git a/LibationWinForms/Resources/liberate_red_pdf_no.png b/LibationWinForms/Resources/liberate_red_pdf_no.png
new file mode 100644
index 00000000..fd2c47b0
Binary files /dev/null and b/LibationWinForms/Resources/liberate_red_pdf_no.png differ
diff --git a/LibationWinForms/Resources/liberate_red_pdf_yes.png b/LibationWinForms/Resources/liberate_red_pdf_yes.png
new file mode 100644
index 00000000..7ba45d56
Binary files /dev/null and b/LibationWinForms/Resources/liberate_red_pdf_yes.png differ
diff --git a/LibationWinForms/Resources/liberate_yellow.png b/LibationWinForms/Resources/liberate_yellow.png
new file mode 100644
index 00000000..d2ea7791
Binary files /dev/null and b/LibationWinForms/Resources/liberate_yellow.png differ
diff --git a/LibationWinForms/Resources/liberate_yellow_pdf_blank.png b/LibationWinForms/Resources/liberate_yellow_pdf_blank.png
new file mode 100644
index 00000000..37a98f91
Binary files /dev/null and b/LibationWinForms/Resources/liberate_yellow_pdf_blank.png differ
diff --git a/LibationWinForms/Resources/liberate_yellow_pdf_no.png b/LibationWinForms/Resources/liberate_yellow_pdf_no.png
new file mode 100644
index 00000000..1d23208b
Binary files /dev/null and b/LibationWinForms/Resources/liberate_yellow_pdf_no.png differ
diff --git a/LibationWinForms/Resources/liberate_yellow_pdf_yes.png b/LibationWinForms/Resources/liberate_yellow_pdf_yes.png
new file mode 100644
index 00000000..a8f04328
Binary files /dev/null and b/LibationWinForms/Resources/liberate_yellow_pdf_yes.png differ
diff --git a/LibationWinForms/Resources/pdf source.url b/LibationWinForms/Resources/pdf source.url
new file mode 100644
index 00000000..f40830a2
--- /dev/null
+++ b/LibationWinForms/Resources/pdf source.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://www.flaticon.com/free-icon/pdf-file-format-symbol_29099
diff --git a/LibationWinForms/Resources/stoplight source.url b/LibationWinForms/Resources/stoplight source.url
new file mode 100644
index 00000000..958a1189
--- /dev/null
+++ b/LibationWinForms/Resources/stoplight source.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://www.flaticon.com/free-icon/semaphore_55291
diff --git a/LibationWinForms/UNTESTED/GridEntry.cs b/LibationWinForms/UNTESTED/GridEntry.cs
index 0b1a01c6..19c471a6 100644
--- a/LibationWinForms/UNTESTED/GridEntry.cs
+++ b/LibationWinForms/UNTESTED/GridEntry.cs
@@ -26,44 +26,19 @@ namespace LibationWinForms
[Browsable(false)]
public IEnumerable TagsEnumerated => book.UserDefinedItem.TagsEnumerated;
+ public enum LiberatedState { NotDownloaded, DRM, Liberated }
[Browsable(false)]
- public string Download_Status
- {
- get
- {
- var print
- = FileManager.AudibleFileStorage.Audio.Exists(book.AudibleProductId) ? "Liberated"
- : FileManager.AudibleFileStorage.AAX.Exists(book.AudibleProductId) ? "DRM"
- : "NOT d/l'ed";
+ public LiberatedState Liberated_Status
+ => FileManager.AudibleFileStorage.Audio.Exists(book.AudibleProductId) ? LiberatedState.Liberated
+ : FileManager.AudibleFileStorage.AAX.Exists(book.AudibleProductId) ? LiberatedState.DRM
+ : LiberatedState.NotDownloaded;
- if (!book.Supplements.Any())
- return print;
-
- print += "\r\n";
-
- var downloadStatuses = book.Supplements
- .Select(d => FileManager.AudibleFileStorage.PDF.Exists(book.AudibleProductId))
- // break delayed execution right now!
- .ToList();
- var count = downloadStatuses.Count;
- if (count == 1)
- {
- print += downloadStatuses[0]
- ? "PDF d/l'ed"
- : "PDF NOT d/l'ed";
- }
- else
- {
- var downloadedCount = downloadStatuses.Count(s => s);
- print
- += downloadedCount == count ? $"{count} PDFs d/l'ed"
- : downloadedCount == 0 ? $"{count} PDFs NOT d/l'ed"
- : $"{downloadedCount} of {count} PDFs d/l'ed";
- }
-
- return print;
- }
- }
+ public enum PdfState { NoPdf, Downloaded, NotDownloaded }
+ [Browsable(false)]
+ public PdfState Pdf_Status
+ => !book.Supplements.Any() ? PdfState.NoPdf
+ : FileManager.AudibleFileStorage.PDF.Exists(book.AudibleProductId) ? PdfState.Downloaded
+ : PdfState.NotDownloaded;
// displayValues is what gets displayed
// the value that gets returned from the property is the cell's value
diff --git a/LibationWinForms/UNTESTED/ProductsGrid.cs b/LibationWinForms/UNTESTED/ProductsGrid.cs
index dfe6f5a5..dae66d49 100644
--- a/LibationWinForms/UNTESTED/ProductsGrid.cs
+++ b/LibationWinForms/UNTESTED/ProductsGrid.cs
@@ -74,8 +74,16 @@ namespace LibationWinForms
private void replaceFormatted(object sender, DataGridViewCellFormattingEventArgs e)
{
var col = ((DataGridView)sender).Columns[e.ColumnIndex];
- if (col is DataGridViewTextBoxColumn textCol && GetGridEntry(e.RowIndex).TryDisplayValue(textCol.Name, out string value))
+ if (col is DataGridViewTextBoxColumn textCol && getGridEntry(e.RowIndex).TryDisplayValue(textCol.Name, out string value))
+ {
+ // DO NOT DO THIS: getCell(e).Value = value;
+ // it's the wrong way and will infinitely call CellFormatting on each assign
+
+ // this is the correct way. will actually set FormattedValue (and EditedFormattedValue) while leaving Value as-is for sorting
e.Value = value;
+
+ getCell(e).ToolTipText = value;
+ }
}
private void hiddenFormatting(object sender, DataGridViewCellFormattingEventArgs e)
@@ -85,9 +93,9 @@ namespace LibationWinForms
if (e.RowIndex < 0 || dgv.Columns[e.ColumnIndex] is DataGridViewButtonColumn)
return;
- var isHidden = GetGridEntry(e.RowIndex).TagsEnumerated.Contains("hidden");
+ var isHidden = getGridEntry(e.RowIndex).TagsEnumerated.Contains("hidden");
- dgv.Rows[e.RowIndex].Cells[e.ColumnIndex].Style
+ getCell(e).Style
= isHidden
? new DataGridViewCellStyle { ForeColor = Color.LightGray }
: dgv.DefaultCellStyle;
@@ -105,22 +113,66 @@ namespace LibationWinForms
private void liberate_Paint(object sender, DataGridViewCellPaintingEventArgs e)
{
- var dgv = (DataGridView)sender;
-
- if (!isColumnValid(dgv, e.RowIndex, e.ColumnIndex, LIBERATE))
+ if (!isColumnValid(e, LIBERATE))
return;
- dgv.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = GetGridEntry(e.RowIndex).Download_Status;
+ var cell = getCell(e);
+ var gridEntry = getGridEntry(e.RowIndex);
+ var liberatedStatus = gridEntry.Liberated_Status;
+ var pdfStatus = gridEntry.Pdf_Status;
+
+ // mouseover text
+ {
+ var libState = liberatedStatus switch
+ {
+ GridEntry.LiberatedState.Liberated => "Liberated",
+ GridEntry.LiberatedState.DRM => "Downloaded but needs DRM removed",
+ GridEntry.LiberatedState.NotDownloaded => "Book NOT downloaded",
+ _ => throw new Exception("Unexpected liberation state")
+ };
+
+ var pdfState = pdfStatus switch
+ {
+ GridEntry.PdfState.Downloaded => "\r\nPDF downloaded",
+ GridEntry.PdfState.NotDownloaded => "\r\nPDF NOT downloaded",
+ GridEntry.PdfState.NoPdf => "",
+ _ => throw new Exception("Unexpected PDF state")
+ };
+
+ var text = libState + pdfState;
+
+ if (liberatedStatus == GridEntry.LiberatedState.NotDownloaded ||
+ liberatedStatus == GridEntry.LiberatedState.DRM ||
+ pdfStatus == GridEntry.PdfState.NotDownloaded)
+ text += "\r\nClick to complete";
+
+ //DEBUG//cell.Value = text;
+ cell.ToolTipText = text;
+ }
+
+ // draw img
+ {
+ var image_lib
+ = liberatedStatus == GridEntry.LiberatedState.NotDownloaded ? "red"
+ : liberatedStatus == GridEntry.LiberatedState.DRM ? "yellow"
+ : liberatedStatus == GridEntry.LiberatedState.Liberated ? "green"
+ : throw new Exception("Unexpected liberation state");
+ var image_pdf
+ = pdfStatus == GridEntry.PdfState.NoPdf ? ""
+ : pdfStatus == GridEntry.PdfState.NotDownloaded ? "_pdf_no"
+ : pdfStatus == GridEntry.PdfState.Downloaded ? "_pdf_yes"
+ : throw new Exception("Unexpected PDF state");
+ var image = (Bitmap)Properties.Resources.ResourceManager.GetObject($"liberate_{image_lib}{image_pdf}");
+ drawImage(e, image);
+ }
}
private async void liberate_Click(object sender, DataGridViewCellEventArgs e)
{
- var dgv = (DataGridView)sender;
-
- if (!isColumnValid(dgv, e.RowIndex, e.ColumnIndex, LIBERATE))
+ if (!isColumnValid(e, LIBERATE))
return;
- var productId = GetGridEntry(e.RowIndex).GetBook().AudibleProductId;
+ var productId = getGridEntry(e.RowIndex).GetBook().AudibleProductId;
// if liberated, open explorer to file
if (FileManager.AudibleFileStorage.Audio.Exists(productId))
@@ -139,7 +191,7 @@ namespace LibationWinForms
public void RefreshRow(string productId)
{
- var rowId = GetRowId((ge) => ge.GetBook().AudibleProductId == productId);
+ var rowId = getRowId((ge) => ge.GetBook().AudibleProductId == productId);
// update cells incl Liberate button text
dataGridView.InvalidateRow(rowId);
@@ -160,33 +212,21 @@ namespace LibationWinForms
{
// DataGridView Image for Button Column: https://stackoverflow.com/a/36253883
- var dgv = (DataGridView)sender;
-
- if (!isColumnValid(dgv, e.RowIndex, e.ColumnIndex, EDIT_TAGS))
+ if (!isColumnValid(e, EDIT_TAGS))
return;
- var displayTags = GetGridEntry(e.RowIndex).TagsEnumerated.ToList();
+ var cell = getCell(e);
+ var gridEntry = getGridEntry(e.RowIndex);
- var cell = dgv.Rows[e.RowIndex].Cells[e.ColumnIndex];
+ var displayTags = gridEntry.TagsEnumerated.ToList();
if (displayTags.Any())
cell.Value = string.Join("\r\n", displayTags);
- else // no tags: use image
+ else
{
- // clear tag text
+ // if removing all tags: clear previous tag text
cell.Value = "";
-
- var image = Properties.Resources.edit_tags_25x25;
-
- e.Paint(e.CellBounds, DataGridViewPaintParts.All);
-
- var w = image.Width;
- var h = image.Height;
- var x = e.CellBounds.Left + (e.CellBounds.Width - w) / 2;
- var y = e.CellBounds.Top + (e.CellBounds.Height - h) / 2;
-
- e.Graphics.DrawImage(image, new Rectangle(x, y, w, h));
- e.Handled = true;
+ drawImage(e, Properties.Resources.edit_tags_25x25);
}
}
@@ -196,10 +236,10 @@ namespace LibationWinForms
var dgv = (DataGridView)sender;
- if (!isColumnValid(dgv, e.RowIndex, e.ColumnIndex, EDIT_TAGS))
+ if (!isColumnValid(e, EDIT_TAGS))
return;
- var liveGridEntry = GetGridEntry(e.RowIndex);
+ var liveGridEntry = getGridEntry(e.RowIndex);
// EditTagsDialog should display better-formatted title
liveGridEntry.TryDisplayValue(nameof(liveGridEntry.Title), out string value);
@@ -221,10 +261,25 @@ namespace LibationWinForms
}
#endregion
- private static bool isColumnValid(DataGridView dgv, int rowIndex, int colIndex, string colName)
+ private static void drawImage(DataGridViewCellPaintingEventArgs e, Bitmap image)
{
- var col = dgv.Columns[colIndex];
- return rowIndex >= 0 && col.HeaderText == colName && col is DataGridViewButtonColumn;
+ e.Paint(e.CellBounds, DataGridViewPaintParts.All);
+
+ var w = image.Width;
+ var h = image.Height;
+ var x = e.CellBounds.Left + (e.CellBounds.Width - w) / 2;
+ var y = e.CellBounds.Top + (e.CellBounds.Height - h) / 2;
+
+ e.Graphics.DrawImage(image, new Rectangle(x, y, w, h));
+ e.Handled = true;
+ }
+
+ private bool isColumnValid(DataGridViewCellEventArgs e, string colName) => isColumnValid(e.RowIndex, e.ColumnIndex, colName);
+ private bool isColumnValid(DataGridViewCellPaintingEventArgs e, string colName) => isColumnValid(e.RowIndex, e.ColumnIndex, colName);
+ private bool isColumnValid(int rowIndex, int colIndex, string colName)
+ {
+ var col = dataGridView.Columns[colIndex];
+ return rowIndex >= 0 && col.Name == colName && col is DataGridViewButtonColumn;
}
private void formatColumns()
@@ -243,6 +298,7 @@ namespace LibationWinForms
col.Width = col.Name switch
{
+ LIBERATE => 70,
nameof(GridEntry.Cover) => 80,
nameof(GridEntry.Title) => col.Width * 2,
nameof(GridEntry.Misc) => (int)(col.Width * 1.35),
@@ -263,7 +319,7 @@ namespace LibationWinForms
=> dataGridView.UIThread(() => updateRowImage(pictureId));
private void updateRowImage(string pictureId)
{
- var rowId = GetRowId((ge) => ge.GetBook().PictureId == pictureId);
+ var rowId = getRowId((ge) => ge.GetBook().PictureId == pictureId);
if (rowId > -1)
dataGridView.InvalidateRow(rowId);
}
@@ -331,7 +387,7 @@ namespace LibationWinForms
currencyManager.SuspendBinding();
{
for (var r = dataGridView.RowCount - 1; r >= 0; r--)
- dataGridView.Rows[r].Visible = productIds.Contains(GetGridEntry(r).GetBook().AudibleProductId);
+ dataGridView.Rows[r].Visible = productIds.Contains(getGridEntry(r).GetBook().AudibleProductId);
}
currencyManager.ResumeBinding();
VisibleCountChanged?.Invoke(this, dataGridView.AsEnumerable().Count(r => r.Visible));
@@ -340,8 +396,14 @@ namespace LibationWinForms
}
#endregion
- private int GetRowId(Func func) => dataGridView.GetRowIdOfBoundItem(func);
+ private int getRowId(Func func) => dataGridView.GetRowIdOfBoundItem(func);
- private GridEntry GetGridEntry(int rowIndex) => dataGridView.GetBoundItem(rowIndex);
- }
+ private GridEntry getGridEntry(int rowIndex) => dataGridView.GetBoundItem(rowIndex);
+
+ private DataGridViewCell getCell(DataGridViewCellFormattingEventArgs e) => getCell(e.RowIndex, e.ColumnIndex);
+
+ private DataGridViewCell getCell(DataGridViewCellPaintingEventArgs e) => getCell(e.RowIndex, e.ColumnIndex);
+
+ private DataGridViewCell getCell(int rowIndex, int columnIndex) => dataGridView.Rows[rowIndex].Cells[columnIndex];
+ }
}
diff --git a/edit-tags-25x25.png b/edit-tags-25x25.png
deleted file mode 100644
index 82b24209..00000000
Binary files a/edit-tags-25x25.png and /dev/null differ
diff --git a/edit-tags-50x50.png b/edit-tags-50x50.png
deleted file mode 100644
index 7b0043ac..00000000
Binary files a/edit-tags-50x50.png and /dev/null differ