We are writing new code using generic List<> , e.g. List<MyClass>.
However we have legacy functions, that are expect ArrayList as a parameter.
It is a second time, when I and my colleague asked, how to "cast" generic List<MyClass> to ArrayList.
Note that it is not real cast, it copies references to ArrayList.
var list=new List<MyClass>();
//Fill list items
ArrayList al=new ArrayList(list);//"cast"-
If you need opposite operation -Convert ArrayList to a Generic List,
List<MyClass> typedList = arrayList.OfType<MyClass>().ToList();