📄 personalgroupmembercollection.cs
字号:
namespace Imps.Client.Core
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Xml;
public class PersonalGroupMemberCollection : UserItemBase, ICollection<PersonalGroupMember>, IEnumerable<PersonalGroupMember>, IEnumerable
{
private List<PersonalGroupMember> _col;
private string _mainVersion;
private string _secondVersion;
private object _syncObj;
internal PersonalGroupMemberCollection(User owner) : base(owner)
{
this._col = new List<PersonalGroupMember>();
this._syncObj = new object();
}
public void Add(PersonalGroupMember item)
{
lock (this._syncObj)
{
this._col.Add(item);
}
}
public void Clear()
{
this._col.Clear();
}
public bool Contains(PersonalGroupMember item)
{
return this._col.Contains(item);
}
public IEnumerator<PersonalGroupMember> GetEnumerator()
{
return this._col.GetEnumerator();
}
internal void LoadGroupsXMLNode(XmlNode node)
{
}
public bool Remove(PersonalGroupMember item)
{
lock (this._syncObj)
{
if (this.Contains(item))
{
this._col.Remove(item);
item.Dispose();
return true;
}
return false;
}
}
void ICollection<PersonalGroupMember>.CopyTo(PersonalGroupMember[] array, int arrayIndex)
{
this._col.CopyTo(array, arrayIndex);
}
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
public int Count
{
get
{
return this._col.get_Count();
}
}
public PersonalGroupMember this[string uri]
{
get
{
lock (this._syncObj)
{
List<PersonalGroupMember>.Enumerator enumerator = this._col.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
PersonalGroupMember member = enumerator.get_Current();
if (member.Uri.Raw == uri)
{
return member;
}
}
}
finally
{
enumerator.Dispose();
}
return null;
}
}
}
internal string MainVersion
{
get
{
return this._mainVersion;
}
set
{
this._mainVersion = value;
}
}
internal string SecondVersion
{
get
{
return this._secondVersion;
}
set
{
this._secondVersion = value;
}
}
public object SyncObject
{
get
{
return this._syncObj;
}
}
bool ICollection<PersonalGroupMember>.IsReadOnly
{
get
{
return this._col.get_IsReadOnly();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -