Add IReadOnlyCollection interface
authorMarek Safar <marek.safar@gmail.com>
Fri, 1 Jun 2012 12:02:06 +0000 (13:02 +0100)
committerMarek Safar <marek.safar@gmail.com>
Fri, 1 Jun 2012 13:07:18 +0000 (14:07 +0100)
mcs/class/corlib/System.Collections.Generic/IReadOnlyCollection.cs [new file with mode: 0644]
mcs/class/corlib/System.Collections.Generic/IReadOnlyDictionary.cs
mcs/class/corlib/System.Collections.Generic/IReadOnlyList.cs
mcs/class/corlib/corlib.dll.sources

diff --git a/mcs/class/corlib/System.Collections.Generic/IReadOnlyCollection.cs b/mcs/class/corlib/System.Collections.Generic/IReadOnlyCollection.cs
new file mode 100644 (file)
index 0000000..b65c15f
--- /dev/null
@@ -0,0 +1,39 @@
+//
+// IReadOnlyCollection.cs
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2012 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
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_4_5
+
+namespace System.Collections.Generic
+{
+       public interface IReadOnlyCollection<out T> : IEnumerable<T>
+       {
+               int Count { get; }
+       }
+}
+
+#endif
\ No newline at end of file
index e886c4cab02c32d69a1a79280dd0903a2fa8e9e8..4c9144fc5f1063542c0d83c74178a51074f7a700 100644 (file)
@@ -30,9 +30,8 @@
 
 namespace System.Collections.Generic
 {
-       public interface IReadOnlyDictionary<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>
+       public interface IReadOnlyDictionary<TKey, TValue> : IReadOnlyCollection<KeyValuePair<TKey, TValue>>
        {
-               int Count { get; }
                TValue this [TKey key] { get; }
                IEnumerable<TKey> Keys { get; }
                IEnumerable<TValue> Values { get; }
index 1363deb2502e43f7e3b208cebfd80d8f54126e20..91ddb84a7fc2899b4fb3e5c5c84377a8aeec4b54 100644 (file)
@@ -30,9 +30,8 @@
 
 namespace System.Collections.Generic
 {
-       public interface IReadOnlyList<out T> : IEnumerable<T>
+       public interface IReadOnlyList<out T> : IReadOnlyCollection<T>
        {
-               int Count { get; }
                T this [int index] { get; }
        }
 }
index 0da21c0a27fd586fcff0db62d6477a354fc15352..04d2673063a9ac43dbaf5fc32eb42738afccba46 100644 (file)
@@ -1544,6 +1544,7 @@ System.Collections.Generic/IList.cs
 System.Collections.Generic/IComparer.cs
 System.Collections.Generic/IEqualityComparer.cs
 System.Collections.Generic/IDictionary.cs
+System.Collections.Generic/IReadOnlyCollection.cs
 System.Collections.Generic/IReadOnlyList.cs
 System.Collections.Generic/IReadOnlyDictionary.cs
 System.Collections.Generic/KeyValuePair.cs