summary refs log tree commit diff
path: root/crypto/src/util/collections/EnumerableProxy.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/util/collections/EnumerableProxy.cs')
-rw-r--r--crypto/src/util/collections/EnumerableProxy.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crypto/src/util/collections/EnumerableProxy.cs b/crypto/src/util/collections/EnumerableProxy.cs
index 9eec4af21..196b4d9df 100644
--- a/crypto/src/util/collections/EnumerableProxy.cs
+++ b/crypto/src/util/collections/EnumerableProxy.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections;
+using System.Collections.Generic;
 
 namespace Org.BouncyCastle.Utilities.Collections
 {
@@ -22,4 +23,28 @@ namespace Org.BouncyCastle.Utilities.Collections
 			return inner.GetEnumerator();
 		}
 	}
+
+	internal sealed class EnumerableProxy<T>
+		: IEnumerable<T>
+	{
+		private readonly IEnumerable<T> m_inner;
+
+		internal EnumerableProxy(IEnumerable<T> inner)
+		{
+			if (inner == null)
+				throw new ArgumentNullException("inner");
+
+			m_inner = inner;
+		}
+
+		IEnumerator IEnumerable.GetEnumerator()
+		{
+			return m_inner.GetEnumerator();
+		}
+
+		IEnumerator<T> IEnumerable<T>.GetEnumerator()
+		{
+			return m_inner.GetEnumerator();
+		}
+	}
 }