diff --git a/NAudio.Wasapi/CoreAudioApi/SessionCollection.cs b/NAudio.Wasapi/CoreAudioApi/SessionCollection.cs
index 36b946a8..6f2e2712 100644
--- a/NAudio.Wasapi/CoreAudioApi/SessionCollection.cs
+++ b/NAudio.Wasapi/CoreAudioApi/SessionCollection.cs
@@ -1,6 +1,5 @@
using NAudio.CoreAudioApi.Interfaces;
-using System;
-using System.Linq;
+using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace NAudio.CoreAudioApi
@@ -8,7 +7,7 @@ namespace NAudio.CoreAudioApi
///
/// Collection of sessions.
///
- public class SessionCollection
+ public class SessionCollection : IEnumerable
{
readonly IAudioSessionEnumerator audioSessionEnumerator;
@@ -42,5 +41,30 @@ public int Count
return result;
}
}
+
+ #region IEnumerable Members
+
+ ///
+ /// Get Enumerator
+ ///
+ /// AudioSessionControl enumerator
+ public IEnumerator GetEnumerator()
+ {
+ for (int index = 0; index < Count; index++)
+ {
+ yield return this[index];
+ }
+ }
+
+ #endregion
+
+ #region IEnumerable Members
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ #endregion
}
}