Created
December 27, 2016 03:56
-
-
Save ichengzi/f0a69167a9f49f06038f2a302b447522 to your computer and use it in GitHub Desktop.
Extensions
This file contains hidden or 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 void AddRange<T>(this ObservableCollection<T> oc, IEnumerable<T> collection) | |
{ | |
if (collection == null) | |
{ | |
throw new ArgumentNullException("collection"); | |
} | |
collection.ToList().ForEach( oc.Add); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment