IList NotSupportedException IsReadOnly:是否只读
来源:互联网 发布:医用软件开发 书籍 编辑:程序博客网 时间:2024/05/29 18:25
在 .NET Framework 2.0 版中,Array 类实现 System.Collections.Generic.IList、System.Collections.Generic.ICollection 和System.Collections.Generic.IEnumerable 泛型接口。由于实现是在运行时提供给数组的,因而对于文档生成工具不可见。因此,泛型接口不会出现在Array 类的声明语法中,也不会有关于只能通过将数组强制转换为泛型接口类型(显式接口实现)才可访问的接口成员的参考主题。将某一数组强制转换为这三种接口之一时需要注意的关键一点是,添加、插入或移除元素的成员会引发NotSupportedException。
Array 实现了Ilist 接口
因此
IList<int> testArray = new int[]{1,2};
没有错误
但是
testArray.Add(3);
会抛出NotSupportedException 异常
IsReadOnly:是否只读
IList<int> arrayIList = new int[] { 2, 3 };
var isReadOnly = arrayIList.IsReadOnly;
IList<int> realList = new List<int> { 3, 4 };
var notReadOnly = realList.IsReadOnly;
参考文档:http://msdn.microsoft.com/zh-cn/library/system.array%28v=VS.80%29.aspx
- IList NotSupportedException IsReadOnly:是否只读
- IList
- IList
- 只读事务是否做无用功?
- Silverlight DataGrid中IsReadOnly
- c#判断文件是否为只读,并修改为只读
- javax.transaction.NotSupportedException翻译
- notsupportedException by active directory
- EF System.NotSupportedException
- 转换 IList 到 IList
- silverlight对属性进行操作 IsReadOnly
- isreadonly\isenable\visibility三者区别
- Ilist排序
- ilist dataset
- IList 接口
- IList排序
- IList List
- ILIST<string>
- postgresql常用函数汇总
- jQuery HTML结构的处理 1.结构的嵌套
- linux 计划任务事例
- Smoke Testing
- 自动重装,修改代码后无需重启服务器
- IList NotSupportedException IsReadOnly:是否只读
- XHProf php轻量级的性能分析工具使用手册(中文版)
- android中恶心的getDrawingCache
- VC获取文件大小
- maven搜索jar包
- udhcpc交叉编译
- 《Effective C#》Item 10:小心GetHashCode函数所存在的陷阱
- 把数据库从oracle迁移到PPAS
- 美国次级贷款来龙去脉