📄 dialogcollection.cs
字号:
namespace Imps.Client.Core
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
public class DialogCollection : IEnumerable<Dialog>, IEnumerable
{
private List<Dialog> _col = new List<Dialog>();
public void Add(Dialog item)
{
this._col.Add(item);
item.CurrentConversation.RaiseAddDialog(new DialogEventArgs(item));
}
public void Clear()
{
for (int i = this._col.get_Count() - 1; i >= 0; i--)
{
this.Remove(this._col.get_Item(i));
}
}
public bool Contains(Dialog item)
{
return this._col.Contains(item);
}
public IEnumerator<Dialog> GetEnumerator()
{
return this._col.GetEnumerator();
}
public void Remove(Dialog item)
{
if (this._col.Contains(item))
{
if (!item.IsClosed)
{
item.Close();
}
this._col.Remove(item);
}
}
IEnumerator IEnumerable.GetEnumerator()
{
return this._col.GetEnumerator();
}
public int Count
{
get
{
return this._col.get_Count();
}
}
public Dialog this[int index]
{
get
{
return this._col.get_Item(index);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -