using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebSite.Models
{
	/// <summary>
	/// 在线用户
	/// </summary>
	public class ActiveUserModel
	{
		public string ID { get; set; }
		public string Account { get; set; }
		public string LoginIP { get; set; }
	}

	public class ActiveUserCollection : ICollection<ActiveUserModel>
	{
		private IList<ActiveUserModel> activeUserList = new List<ActiveUserModel>();

		public void Add(ActiveUserModel item)
		{
			activeUserList.Add(item);
		}

		public void Clear()
		{
			activeUserList.Clear();
		}

		public bool Contains(ActiveUserModel item)
		{
			return item != null && item.ID == item.ID;
		}

		public void CopyTo(ActiveUserModel[] array, int arrayIndex)
		{
			throw new NotImplementedException();
		}

		public int Count
		{
			get { return activeUserList.Count; }
		}

		public bool IsReadOnly
		{
			get { return activeUserList.IsReadOnly; }
		}

		public bool Remove(ActiveUserModel item)
		{
			return activeUserList.Remove(item);
		}

		public IEnumerator<ActiveUserModel> GetEnumerator()
		{
			return activeUserList.GetEnumerator();
		}

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

}