aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/ReadOnlyEnumerable.cs
blob: 1a69f88379cdbd2c354845c603ec81d589a753d2 (plain)
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rssdp
{
	internal sealed class ReadOnlyEnumerable<T> : System.Collections.Generic.IEnumerable<T>
	{

		#region Fields

		private IEnumerable<T> _Items;

		#endregion

		#region Constructors

		public ReadOnlyEnumerable(IEnumerable<T> items)
		{
			if (items == null) throw new ArgumentNullException("items");

			_Items = items;
		}

		#endregion

		#region IEnumerable<T> Members

		public IEnumerator<T> GetEnumerator()
		{
			return _Items.GetEnumerator();
		}

		#endregion

		#region IEnumerable Members

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			return _Items.GetEnumerator();
		}

		#endregion
	}
}