初始化CRICS
This commit is contained in:
68
WebSite/Models/ActiveUserModels.cs
Normal file
68
WebSite/Models/ActiveUserModels.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user