/// <summary> /// 清空所有列表项 /// </summary> public void Clear() { this.count = 0; m_arrItem = null; this.owner.Invalidate(); }
//确认存储空间 private void EnsureSpace(int elements) { if (m_arrItem == null) m_arrItem = new ChatListItem[Math.Max(elements, 4)]; else if (this.count + elements > m_arrItem.Length) { ChatListItem[] arrTemp = new ChatListItem[Math.Max(this.count + elements, m_arrItem.Length * 2)]; m_arrItem.CopyTo(arrTemp, 0); m_arrItem = arrTemp; } }