public static void SerializableTable(string[] valuesList, int skey, Dictionary <int, List <object> > _hash) { if ((int)_ID.MAX_RECORD != valuesList.Length) { throw TableException.ErrorReader("Load {0} error as CodeSize:{1} not Equal DataSize:{2}", GetInstanceFile(), _ID.MAX_RECORD, valuesList.Length); } Tab_StrFilter _values = new Tab_StrFilter(); _values.m_Id = Convert.ToInt32(valuesList[(int)_ID.ID_ID] as string); _values.m_SzString = valuesList[(int)_ID.ID_SZSTRING] as string; _values.m_Type [0] = Convert.ToInt16(valuesList[(int)_ID.ID_TYPE_1] as string) != 0; _values.m_Type [1] = Convert.ToInt16(valuesList[(int)_ID.ID_TYPE_2] as string) != 0; if (_hash.ContainsKey(skey)) { List <object> tList = _hash[skey]; tList.Add(_values); } else { List <object> tList = new List <object>(); tList.Add(_values); _hash.Add(skey, (List <object>)tList); } }
public void SerializableTable(ArrayList valuesList, string skey, Hashtable _hash) { if (string.IsNullOrEmpty(skey)) { throw TableException.ErrorReader("Read File{0} as key is Empty Fail!!!", GetInstanceFile()); } if ((int)_ID.MAX_RECORD != valuesList.Count) { throw TableException.ErrorReader("Load {0} error as CodeSize:{1} not Equal DataSize:{2}", GetInstanceFile(), _ID.MAX_RECORD, valuesList.Count); } Int32 nKey = Convert.ToInt32(skey); Tab_StrFilter _values = new Tab_StrFilter(); _values.m_Type = Convert.ToInt32(valuesList[(int)_ID.ID_TYPE] as string); _hash.Add(nKey, _values); }