Improved PictureStorage thread safety and more intuitive naming.
This commit is contained in:
parent
7a90d9fba9
commit
27ae5facbe
5 changed files with 38 additions and 33 deletions
|
|
@ -10,7 +10,7 @@ using System.Linq;
|
|||
|
||||
namespace LibationWinForms
|
||||
{
|
||||
internal class GridEntry : AsyncNotifyPropertyChanged, IObjectMemberComparable
|
||||
internal class GridEntry : AsyncNotifyPropertyChanged, IMemberComparable
|
||||
{
|
||||
#region implementation properties
|
||||
// hide from public fields from Data Source GUI with [Browsable(false)]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using System.Collections;
|
|||
|
||||
namespace LibationWinForms
|
||||
{
|
||||
internal interface IObjectMemberComparable
|
||||
internal interface IMemberComparable
|
||||
{
|
||||
IComparer GetMemberComparer(Type memberType);
|
||||
object GetMemberValue(string memberName);
|
||||
|
|
@ -3,7 +3,7 @@ using System.ComponentModel;
|
|||
|
||||
namespace LibationWinForms
|
||||
{
|
||||
internal class ObjectMemberComparer<T> : IComparer<T> where T : IObjectMemberComparable
|
||||
internal class MemberComparer<T> : IComparer<T> where T : IMemberComparable
|
||||
{
|
||||
public ListSortDirection Direction { get; set; } = ListSortDirection.Ascending;
|
||||
public string PropertyName { get; set; }
|
||||
|
|
@ -5,7 +5,7 @@ using System.ComponentModel;
|
|||
|
||||
namespace LibationWinForms
|
||||
{
|
||||
internal class SortableBindingList2<T> : BindingList<T> where T : IObjectMemberComparable
|
||||
internal class SortableBindingList2<T> : BindingList<T> where T : IMemberComparable
|
||||
{
|
||||
private bool isSorted;
|
||||
private ListSortDirection listSortDirection;
|
||||
|
|
@ -14,7 +14,7 @@ namespace LibationWinForms
|
|||
public SortableBindingList2() : base(new List<T>()) { }
|
||||
public SortableBindingList2(IEnumerable<T> enumeration) : base(new List<T>(enumeration)) { }
|
||||
|
||||
private ObjectMemberComparer<T> Comparer { get; } = new();
|
||||
private MemberComparer<T> Comparer { get; } = new();
|
||||
protected override bool SupportsSortingCore => true;
|
||||
protected override bool SupportsSearchingCore => true;
|
||||
protected override bool IsSortedCore => isSorted;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue