/// <summary>
        /// Copia os itens para o vetor informado.
        /// </summary>
        /// <param name="array"></param>
        /// <param name="arrayIndex"></param>
        public void CopyTo(TDestination[] array, int arrayIndex)
        {
            array.Require("array").NotNull();
            var aux = new object[array.Length - arrayIndex];

            _sourceList.CopyTo(aux, 0);
            for (var i = 0; i < aux.Length; i++)
            {
                array[i + arrayIndex] = (TDestination)aux[i];
            }
        }
Пример #2
0
 /// <summary>
 /// Convert this list to an array
 /// </summary>
 public static object[] ToArrayOfObject(this System.Collections.IList Collection)
 {
     object[] array = new object[Collection.Count];
     Collection.CopyTo(array, 0);
     return(array);
 }
Пример #3
0
 /// <summary>
 /// Convert this list to an array
 /// </summary>
 public static T[] ToArrayOfT <T>(this System.Collections.IList Collection)
 {
     T[] array = new T[Collection.Count];
     Collection.CopyTo(array, 0);
     return(array);
 }