实现ICollection
来源:互联网 发布:淘宝店为什么要刷销量 编辑:程序博客网 时间:2024/06/06 02:55
using System;
using System.Collections;//注意using Collections
using System.Collections.Generic;
using System.Text;
namespace CollectionTest
{
class Program
{
static void Main(string[] args)
{
WordCollection words = new WordCollection();
foreach (string value in words)
{
Console.WriteLine(value);
}
Console.Read();
}
}
public class WordCollection : ICollection
{
private string[] _list;
private object _root = new object();
public WordCollection()
{
_list = new string[] { "You", "and", "me", "!" };
}
#region ICollection Members
public void CopyTo(Array array, int index)
{
_list.CopyTo(array, index);
}
public int Count
{
get { return _list.Length; }
}
public bool IsSynchronized
{
get { return true; }
}
public object SyncRoot
{
get { return _root; }
}
#endregion
#region IEnumerable Members
public IEnumerator GetEnumerator()
{
return _list.GetEnumerator();
}
#endregion
}
}
- 实现ICollection
- ICollection实现
- ICollection的简单实现
- ICollection
- 实现Icollection接口的对象
- ICollection接口
- IList,ICollection,IEnumerable,IListIList,ICollection,IEnumerable辨析
- IList,ICollection,IEnumerable,IListIList,ICollection,IEnumerable辨析
- xml序列化 ICollection
- C#中的ICollection接口
- IEnumerable,ICollection ,IList ,ArrayList
- IEnumerable IListIList,ICollection,IEnumerable
- IList,ICollection,IEnumerable辨析
- C#中的ICollection接口
- Implement the functions as ICollection.Sort() and ICollection.Compare()
- IList、ICollection、IEnumerable 之辨析
- IList,ICollection,IEnumerable,IEnumerator,IQueryable
- IEnumerable、ICollection和IList接口
- oracle数据库监听配置
- 网游企业圈钱十宗罪
- Smarty模板快速入门
- Spring结合Quartz实现多任务定时调用
- MapXtreme2004常用代码
- 实现ICollection
- Linux常用命令
- 编译原理学习导论--作者四川大学唐良
- 2009 年度最佳 jQuery 插件
- .Net 下利用ICSharpCode.SharpZipLib.dll实现文件、文件夹压缩、解压缩
- 积分不够
- arm伪指令
- .NET DES加密、解密
- 备份还原 数据库