📄 labelexitemcollection.cs
字号:
namespace Imps.Client.Pc.WndlessControls
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Reflection;
public class LabelExItemCollection : ICollection<LabelExItem>, IEnumerable<LabelExItem>, IEnumerable
{
private List<LabelExItem> _col;
private WndlessLabel _owner;
public LabelExItemCollection(WndlessLabel owner)
{
this._owner = owner;
this._col = new List<LabelExItem>();
}
public void Add(LabelExItem item)
{
this._col.Add(item);
this._owner.InnerDoAutoSize(true);
}
public LabelExItem Add(string text)
{
return this.Add(text, Color.Transparent, null);
}
public LabelExItem Add(string text, Color foreColor)
{
return this.Add(text, foreColor, null);
}
public LabelExItem Add(string text, Color foreColor, Font font)
{
LabelExItem item = new LabelExItem(text, foreColor, font);
this.Add(item);
return item;
}
public void Clear()
{
this._col.Clear();
}
public bool Contains(LabelExItem item)
{
return this._col.Contains(item);
}
public IEnumerator<LabelExItem> GetEnumerator()
{
return this._col.GetEnumerator();
}
internal bool HasMultiFont()
{
List<LabelExItem>.Enumerator enumerator = this._col.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
if (enumerator.get_Current().Font != null)
{
return true;
}
}
}
finally
{
enumerator.Dispose();
}
return false;
}
public bool Remove(LabelExItem item)
{
return this._col.Remove(item);
}
void ICollection<LabelExItem>.CopyTo(LabelExItem[] array, int arrayIndex)
{
this._col.CopyTo(array, arrayIndex);
}
IEnumerator IEnumerable.GetEnumerator()
{
return this._col.GetEnumerator();
}
public int Count
{
get
{
return this._col.get_Count();
}
}
public LabelExItem this[int index]
{
get
{
return this._col.get_Item(index);
}
}
bool ICollection<LabelExItem>.IsReadOnly
{
get
{
return this._col.get_IsReadOnly();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -