Is there no System.Collections.Generic.HashSet on Windows Phone 7?
In C#, HashSet is an unordered collection of unique elements. This collection is introduced in . NET 3.5. It supports the implementation of sets and uses the hash table for storage. This collection is of the generic type collection and it is defined under System.
A HashSet is an optimized collection of unordered, unique elements that provides fast lookups and high-performance set operations. The HashSet class was first introduced in . NET 3.5 and is part of the System.
A HashSet<T> object's capacity automatically increases as elements are added to the object. A HashSet<T> collection is not sorted and cannot contain duplicate elements. HashSet<T> provides many mathematical set operations, such as set addition (unions) and set subtraction.
You can implicitly convert HashSet<T> to IEnumerable<T> , because HashSet, like ewvery other generic collection type, implements IEnumerable<T> .
The Windows Phone 7 .NET libraries are comparable to what is provided in Silverlight 3.0 (which doesn't have HashSet
). You can build something like a HashSet
using a Dictionary
. For example, see this MSDN forum post: http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/e1dd3571-dfb8-4abe-b63a-62106d6a4965/
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