//http://tinyerp.codeplex.com/
//GNU Library General Public License (LGPL)
//-----------------------------------------------------------------------
//
// Copyright (c) Pyramid Consulting. All rights reserved.
//
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
namespace Bamboo.Core.Common
{
public class SysUtil
{
///
/// Convert a ArrayList object to a array
///
/// dest ArrayList to convert
/// dest array
public static Object[] List2Array(System.Collections.ArrayList alList)
{
if (alList.Count == 0) return null;
Object[] objSize = new Object[1];
objSize[0] = alList.Count;
Type[] types = new Type[1];
types[0] = typeof(int);
Object[] objArray = (Object[])alList[0].GetType().MakeArrayType().GetConstructor(types).Invoke(objSize);
for (int i = 0; i < alList.Count; i++)
{
objArray[i] = alList[i];
}
return objArray;
}
}
}