public void xml_time() { List <SXML> sXMLList = XMLMgr.instance.GetSXMLList("notice.func", ""); for (int i = 0; i < sXMLList.Count; i++) { noticeDate noticeDate = default(noticeDate); noticeDate.id = sXMLList[i].getInt("id"); noticeDate.des = sXMLList[i].getString("des"); noticeDate.func_id = sXMLList[i].getInt("func_id"); noticeDate.last = sXMLList[i].getInt("last"); noticeDate.icon = sXMLList[i].getInt("icon"); noticeDate.zhuan = sXMLList[i].getInt("zhuan"); noticeDate.level = sXMLList[i].getInt("level"); noticeDate.time = new Dictionary <float, float>(); List <SXML> nodeList = sXMLList[i].GetNodeList("time", ""); for (int j = 0; j < nodeList.Count; j++) { string @string = nodeList[j].getString("t"); string[] array = @string.Split(new char[] { ',' }); float key = float.Parse(array[0]); float value = float.Parse(array[1]); noticeDate.time[key] = value; } this.notice.Add(noticeDate); } }
// public List<float> keys = new List<float>(); public void xml_time() { List <SXML> xml = XMLMgr.instance.GetSXMLList("notice.func"); for (int i = 0; i < xml.Count; i++) { noticeDate date = new noticeDate(); date.id = xml[i].getInt("id"); date.des = xml[i].getString("des"); date.func_id = xml[i].getInt("func_id"); date.last = xml[i].getInt("last"); date.icon = xml[i].getInt("icon"); date.zhuan = xml[i].getInt("zhuan"); date.level = xml[i].getInt("level"); date.time = new Dictionary <float, float>(); List <SXML> times = xml[i].GetNodeList("time"); for (int j = 0; j < times.Count; j++) { string t = times[j].getString("t"); string[] time_point = t.Split(','); float a = float.Parse(time_point[0]); float b = float.Parse(time_point[1]); date.time[a] = b; // keys.Add(a); } notice.Add(date); } }