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?
精彩评论