Formatting

This commit is contained in:
Michael Bucari-Tovo 2022-06-08 09:46:11 -06:00
parent a476d5986d
commit 859a8e933c
2 changed files with 17 additions and 17 deletions

View File

@ -11,7 +11,6 @@ namespace LibationWinForms.GridView
/// <summary>The View Model for a LibraryBook that is ContentType.Product or ContentType.Episode</summary> /// <summary>The View Model for a LibraryBook that is ContentType.Product or ContentType.Episode</summary>
public class LibraryBookEntry : GridEntry public class LibraryBookEntry : GridEntry
{ {
[Browsable(false)] public override DateTime DateAdded => LibraryBook.DateAdded; [Browsable(false)] public override DateTime DateAdded => LibraryBook.DateAdded;
[Browsable(false)] public SeriesEntry Parent { get; init; } [Browsable(false)] public SeriesEntry Parent { get; init; }
@ -60,8 +59,6 @@ namespace LibationWinForms.GridView
{ {
LibraryBook = libraryBook; LibraryBook = libraryBook;
// Immutable properties
{
Title = Book.Title; Title = Book.Title;
Series = Book.SeriesNames(); Series = Book.SeriesNames();
Length = Book.LengthInMinutes == 0 ? "" : $"{Book.LengthInMinutes / 60} hr {Book.LengthInMinutes % 60} min"; Length = Book.LengthInMinutes == 0 ? "" : $"{Book.LengthInMinutes / 60} hr {Book.LengthInMinutes % 60} min";
@ -75,7 +72,6 @@ namespace LibationWinForms.GridView
LongDescription = GetDescriptionDisplay(Book); LongDescription = GetDescriptionDisplay(Book);
Description = TrimTextToWord(LongDescription, 62); Description = TrimTextToWord(LongDescription, 62);
SeriesIndex = Book.SeriesLink.FirstOrDefault()?.Index ?? 0; SeriesIndex = Book.SeriesLink.FirstOrDefault()?.Index ?? 0;
}
UserDefinedItem.ItemChanged += UserDefinedItem_ItemChanged; UserDefinedItem.ItemChanged += UserDefinedItem_ItemChanged;
} }

View File

@ -65,6 +65,8 @@ namespace LibationWinForms.GridView
NotifyPropertyChanged(); NotifyPropertyChanged();
} }
#region Data Sorting
/// <summary>Create getters for all member object values by name</summary> /// <summary>Create getters for all member object values by name</summary>
protected override Dictionary<string, Func<object>> CreateMemberValueDictionary() => new() protected override Dictionary<string, Func<object>> CreateMemberValueDictionary() => new()
{ {
@ -83,5 +85,7 @@ namespace LibationWinForms.GridView
{ nameof(Liberate), () => Liberate }, { nameof(Liberate), () => Liberate },
{ nameof(DateAdded), () => DateAdded }, { nameof(DateAdded), () => DateAdded },
}; };
#endregion
} }
} }