Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions ReactiveUI/CollectionDebugView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace ReactiveUI
{
internal sealed class CollectionDebugView<T>
{
private readonly ICollection<T> collection;

public CollectionDebugView(ICollection<T> collection)
{
if (collection == null)
throw new ArgumentNullException("collection", "collection is null.");
this.collection = collection;
}

[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public T[] Items
{
get
{
T[] array = new T[this.collection.Count];
this.collection.CopyTo(array, 0);
return array;
}
}
}
}
3 changes: 3 additions & 0 deletions ReactiveUI/ReactiveCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
using System.Threading;
using System.Reactive.Disposables;
using System.Globalization;
using System.Diagnostics;

namespace ReactiveUI
{
[DebuggerDisplay("Count = {Count}")]
[DebuggerTypeProxy(typeof(CollectionDebugView<>))]
public class ReactiveCollection<T> : IList<T>, IList, IReactiveCollection<T>, INotifyPropertyChanging, INotifyPropertyChanged, IEnableLogger
{
public event NotifyCollectionChangedEventHandler CollectionChanging;
Expand Down
1 change: 1 addition & 0 deletions ReactiveUI/ReactiveUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PropertyBinding.cs" />
<Compile Include="ReactiveCollection.cs" />
<Compile Include="CollectionDebugView.cs" />
<Compile Include="ReactiveCollectionMixins.cs" />
<Compile Include="ReactiveNotifyPropertyChangedMixin.cs" />
<Compile Include="ReactiveObject.cs" />
Expand Down