[Mono-devel-list] [PATCH] System.Collections.ObjectModel implementations
Ben Maurer
bmaurer at ximian.com
Mon Jun 20 15:17:31 EDT 2005
On Mon, 2005-06-20 at 00:44 -0600, David Waite wrote:
> Included in this patch are implementations of Collection<T> and
> ReadOnlyCollection<T>. KeyedCollection I left alone.
>
> 2005-06-19 David Waite <mass at akuma.org>
>
> * Collection.cs ReadonlyCollection.cs: Implement all methods
> _______________________________________________
> - throw new NotImplementedException ();
> + if (list == null)
> + throw new ArgumentNullException("list");
> + this.list = list;
> + ICollection l = list as ICollection;
> + syncRoot = (l != null) ? l.SyncRoot : new object();
> }
Is the syncroot behavior exactly what msft does? Do you have tests?
(ditto for readonly version).
> + if (IsValidItem(item))
> + {
> + return list.IndexOf((T)item);
> + }
coding style says
if (...) {
Anyways, doesn't need braces. Also, space between method name and (, as
well, space between (T) and item.
-- Ben
More information about the Mono-devel-list
mailing list