+ if (si != null)
+ {
+ generation = (int) si.GetValue("Version", typeof(int));
+ comparer = (IEqualityComparer<T>) si.GetValue("Comparer",
+ typeof(IEqualityComparer<T>));
+ int capacity = (int) si.GetValue("Capacity", typeof(int));
+
+ empty_slot = NO_SLOT;
+ if (capacity > 0) {
+ table = new int[capacity];
+ slots = new T[capacity];
+
+ T[] tableArray = (T[]) si.GetValue("Elements", typeof(T[]));
+ if (tableArray == null)
+ throw new SerializationException("Missing Elements");
+
+ for (int iElement = 0; iElement < tableArray.Length; iElement++) {
+ Add(tableArray[iElement]);
+ }
+ } else
+ table = null;