0

I have a Java code block like following:

Vector<NameAddress> route = dialog.getRoute(); 
for ( Enumeration<NameAddress> e = route.elements(); e.hasMoreElements(); ) {
    // some more to copy route to another Vector<>
    }

I am trying to convert it in C# and here is my code:

List<NameAddress> route = dialog.getRoute();
for ( IEnumerable<NameAddress> e = route.All; e.hasMoreElements(); ) {
    // some more to copy route to another List<>
    }

How can I solve the Enumeration part in c# ?

2
Contributors
1
Reply
13
Views
4 Years
Discussion Span
Last Post by C#Jaap
1

Use can use a foreach for all IEnumerables (like List)

List<NameAddress> route = dialog.getRoute();
foreach(NameAddress nameAddress in route)
{
    //some more to copy rout to another List<>
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.