使用泛型类型System.Collections.Generic.Icomparer <T> 需要一个类型参数
2011-05-13 17:05
1201 查看
.net2005中报错:“使用泛型类型System.Collections.Generic.Icomparer <T> 需要一个类型参数 ”
解决方法:using了System.Collections.Generic,造成class ListViewItemComparer : IComparer这一行中的IComparer被认为是System.Collections.Generic.Icomparer <T> ,所以要实现int Compare (T x,T y),或者把using中改为System.Collections
System.Collections.Generic:泛型
System.Collections :非泛型
解决方法:using了System.Collections.Generic,造成class ListViewItemComparer : IComparer这一行中的IComparer被认为是System.Collections.Generic.Icomparer <T> ,所以要实现int Compare (T x,T y),或者把using中改为System.Collections
System.Collections.Generic:泛型
System.Collections :非泛型
相关文章推荐
- 使用泛型 类型“System.Collections.Generic.IEnumerator<T>”需要 1 个类型参数
- 使用泛型 类型System.Collections.Generic.KeyValuePair需要2个类型参数
- “System.Collections.Generic.IEnumerable<decimal>”不包含“ToArray”的定义,并且找不到可接受类型为“System.Collections.Generic.IEnumerable<decimal>”的第一个参数的扩展方法“ToArray”
- 类型“string”必须是不可以为 null 值的类型才能用作泛型类型或方法“System.Nullable<T>”中的参数“T”
- MVC 无法将类型“System.Collections.Generic.List<AnonymousType#1>”隐式转换为“System.Collections.Generic.IList<Mvc3Modeltest.Models.Movie>”。存在一个显式转换(是否缺少强制转换?))
- 无法跨越程序集边界使用程序集“DataCheck, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”中的类型“List<ILayer>”,因为该类型有一个为嵌入互操作类型的泛型类型参数
- System.Collections.Generic.IEnumerable<T>接口
- 类型“string”必须是不可为 null 的值类型才能用作泛型类型或方法“System.Nullable<T>”中的参数“T”
- ArrayList<Integer> list = new ArrayList<Integer>();在这个泛型为 Integer 的 ArrayList 中存放一个 String 类型的对象。
- NHibernate无法将类型“System.Collections.Generic.IList<T>”隐式转换为“System.Collections.Generic.IList<IT>
- 一个提醒...such as implement System.Collections.Generic.IComparer<T>
- C#定义泛型方法错误-类型“T”必须是引用类型才能用作泛型类型或方法“System.Data.Linq.Table<TEntity>”中的参数“TEntity”
- “System.Collections.Generic.IEnumerable<TestDAL.HistoryData>”不包含“ToList”的定义
- System.ArgumentException: 回发或回调参数无效。在配置中使用 < pages enableEventValidation="true"/> 或在页面中使用 <% @ Page
- System.ArgumentException: 回发或回调参数无效。在配置中使用 < pages enableEventValidation="true"/>
- Dictionary&lt;string, string&gt;是一个泛型使用说明
- mybatis在<if>中传入一个简单类型参数的两种写法。
- [corefx注释说]-System.Collections.Generic.Stack<T>
- [corefx注释说]-System.Collections.Generic.Queue<T>
- 写一个MyList<T>的类,内部用T[]实现(不能使用系统的List<T>类),需要实现的接口如下: