Created
May 24, 2013 16:05
-
-
Save deapsquatter/5644550 to your computer and use it in GitHub Desktop.
Useful in Xamarin.Droid when having to deal with Java.Util.IEnumeration. Now you can use Linq.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Extensions | |
{ | |
public static IEnumerable<T> GetEnumerable<T>(this Java.Util.IEnumeration enumeration) where T : class | |
{ | |
while (enumeration.HasMoreElements) | |
yield return enumeration.NextElement() as T; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment