Merge pull request #1135 from kitsilanosoftware/rpm-spec-dead-entries
[mono.git] / mcs / class / corlib / System.Collections.ObjectModel / ReadOnlyCollection.cs
index 46dfd7be9919489dcd7ee4452fbd527dfe2fe7be..7b0510ec9954fb937d1cf1a08351f2befddf3cce 100644 (file)
@@ -2,9 +2,10 @@
 //
 // System.Collections.ObjectModel.ReadOnlyCollection
 //
-// Author:
+// Authors:
 //    Zoltan Varga (vargaz@gmail.com)
 //    David Waite (mass@akuma.org)
+//    Marek Safar (marek.safar@gmail.com)
 //
 // (C) 2005 Novell, Inc.
 // (C) 2005 David Waite
@@ -13,6 +14,7 @@
 //
 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
 // Copyright (C) 2005 David Waite
+// Copyright (C) 2011 Xamarin, Inc (http://www.xamarin.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
+using System.Diagnostics;
 
 namespace System.Collections.ObjectModel
 {
        [ComVisible (false)]
        [Serializable]
-       public class ReadOnlyCollection <T> : IList <T>, ICollection <T>, IEnumerable <T>, IList, ICollection, IEnumerable
+       [DebuggerDisplay ("Count={Count}")]
+       [DebuggerTypeProxy (typeof (CollectionDebuggerView<>))]
+       public class ReadOnlyCollection<T> : IList<T>, IList
+#if NET_4_5
+               , IReadOnlyList<T>
+#endif
        {
                IList <T> list;
                
@@ -142,14 +150,14 @@ namespace System.Collections.ObjectModel
 
                bool IList.Contains (object value)
                {
-                       if (Collection <T>.IsValidItem (value))
+                       if (CollectionHelpers.IsValidItem<T> (value))
                                return list.Contains ((T) value);
                        return false;
                }
                
                int IList.IndexOf (object value)
                {
-                       if (Collection <T>.IsValidItem (value))
+                       if (CollectionHelpers.IsValidItem<T> (value))
                                return list.IndexOf ((T) value);
                        return -1;
                }