开发者

What is the rationale not to use ArrayList in Silverlight?

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜