THRIFT-1694 Re-Enable serialization for WP7 Silverlight
Patch: Jens Geyer
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1387715 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/csharp/src/Collections/THashSet.cs b/lib/csharp/src/Collections/THashSet.cs
index e2fc8b5..b71a8d2 100644
--- a/lib/csharp/src/Collections/THashSet.cs
+++ b/lib/csharp/src/Collections/THashSet.cs
@@ -21,14 +21,23 @@
using System.Collections;
using System.Collections.Generic;
+#if SILVERLIGHT
+using System.Runtime.Serialization;
+#endif
+
namespace Thrift.Collections
{
-#if !SILVERLIGHT
- [Serializable]
+#if SILVERLIGHT
+ [DataContract]
+#else
+ [Serializable]
#endif
public class THashSet<T> : ICollection<T>
{
#if NET_2_0 || SILVERLIGHT
+#if SILVERLIGHT
+ [DataMember]
+#endif
TDictSet<T> set = new TDictSet<T>();
#else
HashSet<T> set = new HashSet<T>();
@@ -79,8 +88,14 @@
}
#if NET_2_0 || SILVERLIGHT
+#if SILVERLIGHT
+ [DataContract]
+#endif
private class TDictSet<V> : ICollection<V>
{
+#if SILVERLIGHT
+ [DataMember]
+#endif
Dictionary<V, TDictSet<V>> dict = new Dictionary<V, TDictSet<V>>();
public int Count