Load elements into a generic list from an array
//http://tinyerp.codeplex.com/
//GNU Library General Public License (LGPL)
//-----------------------------------------------------------------------
// <copyright file="SysUtil.cs" company="Pyramid Consulting">
// Copyright (c) Pyramid Consulting. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
namespace Bamboo.Core.Common
{
public class SysUtil
{
/// <summary>
/// Load elements into a generic list from an array
/// </summary>
/// <typeparam name="T">type of the element</typeparam>
/// <param name="list">dest list</param>
/// <param name="array">source array</param>
public static void LoadListFromArray<T>(System.Collections.Generic.List<T> list, T[] array)
{
list.Clear();
for (int i = 0; i < array.Length; i++)
{
list.Add(array[i]);
}
}
}
}
Related examples in the same category