我有一个 Java 代码块,如下所示:
Vector<NameAddress> route = dialog.getRoute();
for ( Enumeration<NameAddress> e = route.elements(); e.hasMoreElements(); ) {
// some more to copy route to another Vector<>
}
我正在尝试用 C# 转换它,这是我的错误代码:
List<NameAddress> route = dialog.getRoute();
for ( IEnumerable<NameAddress> e = route.All; e.hasMoreElements(); ) {
// some more to copy route to another List<>
}
如何解决 C# 中的 Enumeration<> 部分?