Initializing ArrayList with constant literal

C# 1 or 2: private static ArrayList alFileTypes = new ArrayList(new string[] {“css”,”gif”,”htm”,”html”,”txt”,”xml”}); C# 3 using an implicitly typed array: private static ArrayList alFileTypes = new ArrayList(new[] {“css”,”gif”,”htm”,”html”,”txt”,”xml”}); C# 3 using a collection initializer: private static ArrayList alFileTypes = new ArrayList{“css”,”gif”,”htm”,”html”,”txt”,”xml”}; Or create your own helper method: public static ArrayList CreateList(params object[] items) { return … Read more

Why do my array of structs take up so much memory?

Based on my tests, I’m guessing ValueTypes in the Micro Framework are not true value types as we’re used to on the desktop CLR. At the very least, they are being boxed. And there may be another level of indirection involved too. These costs are incurred in a (quite substantial for an embedded platform) memory … Read more

File not found.