Silverlight和ArrayList的 [英] Silverlight and ArrayList

查看:210
本文介绍了Silverlight和ArrayList的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问Visual Studio 2010中的Silverlight支持的ArrayList?如果是的话那么如何使用它,如果没有的话,为什么?

如何在Silverlight中使用ArrayList <?/ p>

解决方案

Silverlight中不支持的ArrayList现在,看
<一href=\"http://www.infoq.com/news/2007/07/ArrayList-Gone\">http://www.infoq.com/news/2007/07/ArrayList-Gone.

编辑:
下面是从这个链接,

内容

  

要减少Silverlight运行时的大小的努力,大多数非泛型集合类型将被移除。这些措施包括一度被认为包括ArrayList中,Hashtable中,和比较。

.NET编程本质的类型

据微软基础类库队因巴尔Gazit,非泛型集合不会与Silverlight出货1.1。这意味着,虽然可以继续与主要的.NET发行使用它们,它们不能在任何装配针对Silverlight使用。受影响的类是:

  *的ArrayList
* BitArray
* CaseInsensitiveComparer
* CaseInsensitiveHash codeProvider
* CollectionBase的
*的Comparer
* CompatibleComparer
* DictionaryBase
* EmptyReadOnlyDictionaryInternal
*哈希表
* IHash codeProvider
* KeyValuePairs
* ListDictionaryInternal
*队列
* ReadOnlyCollectionBase
*排序列表
*栈

只是要清楚,微软是不是就在这个时候在主.NET分发中删除这些类或将其标记为过时的规划。

在为了支持方案,例如数据绑定其中类型不一定已知的,下面的非通用接口将保持在Silverlight

  *的IEnumerator
* IEnumerable的
* ICollection的
*的IComparer
* IDictionary的
* IDictionaryEnumerator
*的DictionaryEntry
*的IEqualityComparer
* IList的

一些泛型集合也已经从Silverlight的下降。国际竹藤组织解释说,


  

另外三个泛型也被拆除。队列,栈和LinkedList从Silverlight中被拆除。在这种情况下,这不是因为它们是非通用,但因为它们不被认为是核心组,我们认为可以提供与Silverlight基本类型的一部分​​。请记住,Silverlight是一个非常小的下载,应该只包含最小的API集合,让有用的发展。这是非常简单的实现队列和堆栈使用清单和LinkedList只是一个不同的实现具有不同的性能特征清单,因此它不是我们的核心藏品集团的重要组成部分。


不要同时检查 C# - 更换for.NET ArrayList.ToArray(类型)在Silverlight

Does Visual Studio 2010's Silverlight support ArrayList? If yes then how to use it, if not then why?

How to use ArrayList in Silverlight?

解决方案

Silverlight don't support ArrayList now, see http://www.infoq.com/news/2007/07/ArrayList-Gone.

EDIT: Here is the content from this link,

an effort to reduce the size of the Silverlight runtime, most of the non-generic collection types will be removed. These include types once considered essential to .NET programming including ArrayList, Hashtable, and Comparer.

According to Inbar Gazit of Microsoft's Base Class Library team, the non-generic collections are not going to ship with Silverlight 1.1. This means that while you can continue to use them with the main .NET distribution, they cannot be used in any assembly targeting Silverlight. The affected classes are:

* ArrayList
* BitArray
* CaseInsensitiveComparer
* CaseInsensitiveHashCodeProvider
* CollectionBase
* Comparer
* CompatibleComparer
* DictionaryBase
* EmptyReadOnlyDictionaryInternal
* Hashtable
* IHashCodeProvider
* KeyValuePairs
* ListDictionaryInternal
* Queue
* ReadOnlyCollectionBase
* SortedList
* Stack

Just to make it clear, Microsoft is not planning on removing these classes or marking them as obsolete in the main .NET distribution at this time.

In order to support scenarios such as data binding where the type is not necessarily known, the following non-generic interfaces will be kept in Silverlight.

* IEnumerator
* IEnumerable
* ICollection
* IComparer
* IDictionary
* IDictionaryEnumerator
* DictionaryEntry
* IEqualityComparer
* IList

Some generic collections have also been dropped from Silverlight. Inbar explains,

Three other generic types were also removed. Queue, Stack and LinkedList were removed from Silverlight. In this case it wasn't because they were non-generic but because they are not considered to be part of the core set of types that we deemed essential to be provided with Silverlight. Remember that Silverlight is a very small download and should only include the smallest set of APIs that will allow for useful development. It's very simple to implement Queue and Stack using List and LinkedList is just a different implementation of List with different performance characteristics and so it's not an essential part of our core collections group.

Do also check C# - Replacement for.NET ArrayList.ToArray(Type) in Silverlight.

这篇关于Silverlight和ArrayList的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆