Mercurial > hg > ucis.core
changeset 59:4e1a5dec786a
Merge USB updates
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Wed, 09 Oct 2013 20:56:28 +0200 |
parents | 7c15c12ef965 (diff) fd63c453ff65 (current diff) |
children | 3424fa5a12c9 |
files | |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Util/ArrayUtil.cs Wed Oct 09 20:54:15 2013 +0200 +++ b/Util/ArrayUtil.cs Wed Oct 09 20:56:28 2013 +0200 @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; namespace UCIS.Util { @@ -14,6 +15,16 @@ Array.Copy(input, offset, output, 0, count); return output; } + public static Object[] ToArray(ICollection input) { + Object[] output = new Object[input.Count]; + input.CopyTo(output, 0); + return output; + } + public static T[] ToArray<T>(ICollection input) { + T[] output = new T[input.Count]; + input.CopyTo(output, 0); + return output; + } public static T[] ToArray<T>(ICollection<T> input) { T[] output = new T[input.Count]; input.CopyTo(output, 0);