I have come across this code snippet in a source code
#if SILVERLIGHT
internal static System.Collections.IList CreateArrayList()
{
return new List<object>();
}
#else
internal static System.Collections.IList CreateArrayList()
{
return new ArrayList();
}
#endif
What might be the purpose of this different treatment?
Silverlight doesn't have the deprecated non-generic collection classes; they are not merely discouraged; they're not there at all.
What is bizarre about that code is: clearly it works for the SilverLight case, so why leave the old code in at all? There's no compelling benefit to using the ArrayList, is there?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With