This repository has been archived by the owner on Jul 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NetworkConnectionCollection.cs
58 lines (48 loc) · 1.77 KB
/
NetworkConnectionCollection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Microsoft.WindowsAPICodePack.Net
{
/// <summary>
/// An enumerable collection of <see cref="NetworkConnection"/> objects.
/// </summary>
public class NetworkConnectionCollection : IEnumerable<NetworkConnection>
{
#region Private Fields
IEnumerable networkConnectionEnumerable;
#endregion // Private Fields
internal NetworkConnectionCollection(IEnumerable networkConnectionEnumerable)
{
this.networkConnectionEnumerable = networkConnectionEnumerable;
}
#region IEnumerable<NetworkConnection> Members
/// <summary>
/// Returns the strongly typed enumerator for this collection.
/// </summary>
/// <returns>A <see cref="System.Collections.Generic.IEnumerator{T}"/> object.</returns>
public IEnumerator<NetworkConnection> GetEnumerator()
{
foreach (INetworkConnection networkConnection in networkConnectionEnumerable)
{
yield return new NetworkConnection(networkConnection);
}
}
#endregion
#region IEnumerable Members
/// <summary>
/// Returns the enumerator for this collection.
/// </summary>
///<returns>A <see cref="System.Collections.IEnumerator"/> object.</returns>
IEnumerator IEnumerable.GetEnumerator()
{
foreach (INetworkConnection networkConnection in networkConnectionEnumerable)
{
yield return new NetworkConnection(networkConnection);
}
}
#endregion
}
}