public TaggedAllergyArrays(IndexedHashtable t) { if (t.Count == 0) { return; } arrays = new TaggedAllergyArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedAllergyArray((string)t.GetKey(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedAllergyArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedAllergyArray((string)t.GetKey(i), (Allergy[])t.GetValue(i)); } else { arrays[i] = new TaggedAllergyArray((string)t.GetKey(i), (Allergy)t.GetValue(i)); } } count = t.Count; }
public TaggedAllergyArrays(IndexedHashtable t) { if (t.Count == 0) { return; } arrays = new TaggedAllergyArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedAllergyArray((string)t.GetKey(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedAllergyArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType() == typeof(System.Collections.Hashtable)) { IList <Allergy> temp = ((System.Collections.Hashtable)t.GetValue(i))["reactions"] as IList <Allergy>; if (temp == null || temp.Count == 0) { arrays[i] = new TaggedAllergyArray((string)t.GetKey(i)); } else { Allergy[] ary = new Allergy[temp.Count]; temp.CopyTo(ary, 0); arrays[i] = new TaggedAllergyArray((string)t.GetKey(i), ary); } } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedAllergyArray((string)t.GetKey(i), (Allergy[])t.GetValue(i)); } else { arrays[i] = new TaggedAllergyArray((string)t.GetKey(i), (Allergy)t.GetValue(i)); } } count = t.Count; }