diff options
Diffstat (limited to 'src/ProtocolBuffers/Collections/PopsicleList.cs')
-rw-r--r-- | src/ProtocolBuffers/Collections/PopsicleList.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ProtocolBuffers/Collections/PopsicleList.cs b/src/ProtocolBuffers/Collections/PopsicleList.cs index a7d01553..26996d9b 100644 --- a/src/ProtocolBuffers/Collections/PopsicleList.cs +++ b/src/ProtocolBuffers/Collections/PopsicleList.cs @@ -39,7 +39,7 @@ namespace Google.ProtocolBuffers.Collections { /// to be made read-only (with the <see cref="MakeReadOnly" /> method), /// after which any modifying methods throw <see cref="NotSupportedException" />. /// </summary> - public sealed class PopsicleList<T> : IList<T> { + public sealed class PopsicleList<T> : IPopsicleList<T> { private readonly List<T> items = new List<T>(); private bool readOnly = false; @@ -108,6 +108,13 @@ namespace Google.ProtocolBuffers.Collections { return items.Remove(item); } + public void Add(IEnumerable<T> collection) { + if (readOnly) { + throw new NotSupportedException("List is read-only"); + } + items.AddRange(collection); + } + public IEnumerator<T> GetEnumerator() { return items.GetEnumerator(); } |