diff options
author | Jon Skeet <jonskeet@google.com> | 2017-01-30 17:34:32 +0000 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2017-01-30 18:58:56 +0000 |
commit | afc59ab55abe148af5aa4bd48c34d3d61364f06e (patch) | |
tree | b1287250969951e3c7f852197e8473133daba748 | |
parent | 87e4976ba4bf6782945dcf3e821caaebdc2744ee (diff) | |
download | protobuf-afc59ab55abe148af5aa4bd48c34d3d61364f06e.tar.gz protobuf-afc59ab55abe148af5aa4bd48c34d3d61364f06e.tar.bz2 protobuf-afc59ab55abe148af5aa4bd48c34d3d61364f06e.zip |
C#: Implement IReadOnlyList<T> in RepeatedField<T>
We explicitly don't do this when targeting .NET 3.5, where the
interface doesn't exist.
No implementation is required, as we're already implementing
everything we need for IList<T>.
-rw-r--r-- | csharp/src/Google.Protobuf/Collections/RepeatedField.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs index 7bb56448..9504d7ef 100644 --- a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs +++ b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs @@ -47,6 +47,9 @@ namespace Google.Protobuf.Collections /// </remarks> /// <typeparam name="T">The element type of the repeated field.</typeparam> public sealed class RepeatedField<T> : IList<T>, IList, IDeepCloneable<RepeatedField<T>>, IEquatable<RepeatedField<T>> +#if !DOTNET35 + , IReadOnlyList<T> +#endif { private static readonly T[] EmptyArray = new T[0]; private const int MinArraySize = 8; |