> 
> > +           public virtual void RemoveByKey(string key)
> > +           {
> > +                   int index = -1;
> > +                   for (int i = 0; i < nodes.Count; i++)
> > +                   {
> > +                           if (!string.Equals(nodes[i].Name,key, 
> > StringComparison.CurrentCultureIgnoreCase))
> > +                                   continue;
> > +
> > +                           index = i;
> > +                           break;
> > +                   }
> 
> Ditto. Additionally, what happens on MS.NET if you remove the
> String.Empty key? What happens if the collection has duplicate keys?
> Will be the keys deleted all together or just the first/last/random
> occurrence?

As far as I can tell, RemoveByKey behaves just like the other
Key-related methods, so when passing a null or empty string it should do
nothing.

Also, when having duplicate keys, the method should remove the first
occurrence (at least that happens with ListView related collections, for
example).

Anyway, the best thing do do, as Robert said, is to write tests.

Carlos.




_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to