I believe the following is the fastest way to convert a non-typed list to a strongly typed (generic) list using C# .NET:
public List ConvertToGenericList(IList listOfObjects) {
ArrayList notStronglyTypedList = new ArrayList(listOfObjects);
return new List(notStronglyTypedList.ToArray(typeof(T)) as T[]);
}
Note that this will fail if the non-typed collection contains anything that cannot be casted to type of T.
Please let me know if there's a more efficient way to do this!
Billy