-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
breaking changes, ISynchronizedView<T> -> ISynchronizedView<T, TView>
- Loading branch information
Showing
10 changed files
with
92 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,38 @@ | ||
using System; | ||
using System.Collections.Specialized; | ||
|
||
namespace ObservableCollections | ||
{ | ||
// Obsolete... | ||
[Obsolete("this interface is obsoleted. Use ISynchronizedViewFilter<T, TView> instead.")] | ||
public interface ISynchronizedViewFilter<T> | ||
{ | ||
bool IsMatch(T value); | ||
} | ||
|
||
public class SynchronizedViewFilter<T>(Func<T, bool> isMatch) : ISynchronizedViewFilter<T> | ||
public interface ISynchronizedViewFilter<T, TView> | ||
{ | ||
public static readonly ISynchronizedViewFilter<T> Null = new NullViewFilter(); | ||
bool IsMatch(T value, TView view); | ||
} | ||
|
||
public bool IsMatch(T value) => isMatch(value); | ||
internal class SynchronizedViewValueOnlyFilter<T, TView>(Func<T, bool> isMatch) : ISynchronizedViewFilter<T, TView> | ||
{ | ||
public bool IsMatch(T value, TView view) => isMatch(value); | ||
|
||
class NullViewFilter : ISynchronizedViewFilter<T> | ||
class NullViewFilter : ISynchronizedViewFilter<T, TView> | ||
{ | ||
public bool IsMatch(T value) => true; | ||
public bool IsMatch(T value, TView view) => true; | ||
} | ||
} | ||
|
||
|
||
public class SynchronizedViewFilter<T, TView>(Func<T, TView, bool> isMatch) : ISynchronizedViewFilter<T, TView> | ||
{ | ||
public static readonly ISynchronizedViewFilter<T, TView> Null = new NullViewFilter(); | ||
|
||
public bool IsMatch(T value, TView view) => isMatch(value, view); | ||
|
||
class NullViewFilter : ISynchronizedViewFilter<T, TView> | ||
{ | ||
public bool IsMatch(T value, TView view) => true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.