using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using Telerik.Windows.Data;

namespace SelectedDataRecordsBinding_Wpf_2009_Q11
{
	public struct WrapperEnumerator : IDisposable, IEnumerator
	{
		SelectedRecordsCollection list;
		private int index;
		private object current;

		internal WrapperEnumerator(SelectedRecordsCollection collection)
		{
			this.list = collection;
			this.index = 0;
			this.current = null;
		}

		public void Dispose()
		{
		}

		public bool MoveNext()
		{
			if (this.index < this.list.Count)
			{
				DataRecord record = (DataRecord)this.list[this.index];
				this.current = record.Data;
				this.index++;
				return true;
			}

			this.index = this.list.Count + 1;
			this.current = null;
			return false;
		}

		public object Current
		{
			get
			{
				return this.current;
			}
		}

		object IEnumerator.Current
		{
			get
			{
				return (object)this.Current;
			}
		}

		void IEnumerator.Reset()
		{
			this.index = 0;
			this.current = null;
		}
	}
}
