Skip to content

Commit 4ded0d2

Browse files
committed
Revert "Add read only interfaces for reactive collections"
This reverts commit 580af48, adding Read-only Collection interfaces adds 100000000x ambiguous method errors /cc @haacked
1 parent a592a0e commit 4ded0d2

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

ReactiveUI/Interfaces.cs

-13
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,6 @@ public interface IReactiveCollection : ICollection, INotifyCollectionChanged, IN
212212
IObservable<Unit> ShouldReset { get; }
213213
}
214214

215-
public interface IReadOnlyReactiveCollection<T> : IReadOnlyCollection<T>, IReactiveCollection
216-
{
217-
}
218-
219-
public interface IReadOnlyReactiveList<T> : IReadOnlyList<T>, IReadOnlyReactiveCollection<T>
220-
{
221-
}
222-
223-
public interface IReactiveDerivedList<T> : IReadOnlyReactiveList<T>, IDisposable
224-
{
225-
}
226-
227215
/// <summary>
228216
/// IReactiveCollection of T is the typed version of IReactiveCollection and
229217
/// adds type-specified versions of Observables
@@ -267,7 +255,6 @@ public interface IReactiveCollection<T> : ICollection<T>, IReactiveCollection
267255
/// ChangeTrackingEnabled is set to True.
268256
/// </summary>
269257
IObservable<IObservedChange<T, object>> ItemChanged { get; }
270-
271258
}
272259

273260
/// <summary>

ReactiveUI/ReactiveCollectionMixins.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace ReactiveUI
1313
{
14-
public abstract class ReactiveDerivedCollection<TValue> : ReactiveList<TValue>, IReactiveDerivedList<TValue>
14+
public abstract class ReactiveDerivedCollection<TValue> : ReactiveList<TValue>, IDisposable
1515
{
1616
const string readonlyExceptionMessage = "Derived collections cannot be modified.";
1717

@@ -151,7 +151,7 @@ public void Dispose()
151151
public virtual void Dispose(bool disposing) { }
152152
}
153153

154-
public sealed class ReactiveDerivedCollection<TSource, TValue> : ReactiveDerivedCollection<TValue>
154+
public sealed class ReactiveDerivedCollection<TSource, TValue> : ReactiveDerivedCollection<TValue>, IDisposable
155155
{
156156
readonly IEnumerable<TSource> source;
157157
readonly Func<TSource, TValue> selector;
@@ -504,7 +504,7 @@ public override void Dispose(bool disposing)
504504
}
505505
}
506506

507-
internal class ReactiveDerivedCollectionFromObservable<T> : ReactiveDerivedCollection<T>
507+
internal class ReactiveDerivedCollectionFromObservable<T>: ReactiveDerivedCollection<T>
508508
{
509509
SingleAssignmentDisposable inner;
510510

@@ -573,7 +573,7 @@ public static class ReactiveCollectionMixins
573573
/// collection no faster than the delay provided.</param>
574574
/// <returns>A new collection which will be populated with the
575575
/// Observable.</returns>
576-
public static IReactiveDerivedList<T> CreateCollection<T>(
576+
public static ReactiveDerivedCollection<T> CreateCollection<T>(
577577
this IObservable<T> fromObservable,
578578
TimeSpan? withDelay = null,
579579
Action<Exception> onError = null)
@@ -596,7 +596,7 @@ public static IReactiveDerivedList<T> CreateCollection<T>(
596596
/// collection no faster than the delay provided.</param>
597597
/// <returns>A new collection which will be populated with the
598598
/// Observable.</returns>
599-
public static IReactiveDerivedList<TRet> CreateCollection<T, TRet>(
599+
public static ReactiveDerivedCollection<TRet> CreateCollection<T, TRet>(
600600
this IObservable<T> fromObservable,
601601
Func<T, TRet> selector,
602602
TimeSpan? withDelay = null)
@@ -632,7 +632,7 @@ public static class ObservableCollectionMixin
632632
/// <returns>A new collection whose items are equivalent to
633633
/// Collection.Select().Where().OrderBy() and will mirror changes
634634
/// in the initial collection.</returns>
635-
public static IReactiveDerivedList<TNew> CreateDerivedCollection<T, TNew, TDontCare>(
635+
public static ReactiveDerivedCollection<TNew> CreateDerivedCollection<T, TNew, TDontCare>(
636636
this IEnumerable<T> This,
637637
Func<T, TNew> selector,
638638
Func<T, bool> filter = null,
@@ -670,7 +670,7 @@ public static IReactiveDerivedList<TNew> CreateDerivedCollection<T, TNew, TDontC
670670
/// <returns>A new collection whose items are equivalent to
671671
/// Collection.Select().Where().OrderBy() and will mirror changes
672672
/// in the initial collection.</returns>
673-
public static IReactiveDerivedList<TNew> CreateDerivedCollection<T, TNew>(
673+
public static ReactiveDerivedCollection<TNew> CreateDerivedCollection<T, TNew>(
674674
this IEnumerable<T> This,
675675
Func<T, TNew> selector,
676676
Func<T, bool> filter = null,

0 commit comments

Comments
 (0)