Merge pull request #54 from AnnulusGames/add-readonlyobservablelist

Add IReadOnlyObservableList interface
This commit is contained in:
Yoshifumi Kawai 2024-08-13 20:33:21 +09:00 committed by GitHub
commit fbdbfe0d5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View File

@ -15,6 +15,11 @@ namespace ObservableCollections
ISynchronizedView<T, TView> CreateView<TView>(Func<T, TView> transform, bool reverse = false);
}
public interface IReadOnlyObservableList<T> :
IReadOnlyList<T>, IObservableCollection<T>
{
}
public interface IReadOnlyObservableDictionary<TKey, TValue> :
IReadOnlyDictionary<TKey, TValue>, IObservableCollection<KeyValuePair<TKey, TValue>>
{

View File

@ -7,7 +7,7 @@ using System.Linq;
namespace ObservableCollections
{
public sealed partial class ObservableList<T> : IList<T>, IReadOnlyList<T>, IObservableCollection<T>
public sealed partial class ObservableList<T> : IList<T>, IReadOnlyObservableList<T>
{
public ISynchronizedView<T, TView> CreateView<TView>(Func<T, TView> transform, bool reverse = false)
{

View File

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
namespace ObservableCollections
{
public sealed partial class ObservableList<T> : IList<T>, IReadOnlyList<T>, IObservableCollection<T>
public sealed partial class ObservableList<T> : IList<T>, IReadOnlyObservableList<T>
{
readonly List<T> list;
public object SyncRoot { get; } = new();