示例#1
0
    void LoadConfig(string path)
    {
        ABData.datas.Clear();
        XmlDocument doc = new XmlDocument();

        doc.Load(path);
        var root = doc.SelectSingleNode("ABConfig");

        if (root.Attributes["lastConfigIndex"] != null)
        {
            lastSelectConfigIndex = Convert.ToInt32(root.Attributes["lastConfigIndex"].Value);
        }
        var nodes = root.SelectNodes("data");

        ABData.datas.Clear();
        for (int i = 0; i < nodes.Count; ++i)
        {
            var abPath = nodes[i].Attributes["path"].Value;
            var data   = ABData.DeserializeFromXml(nodes[i], null);
            ABData.datas.Add(abPath, data);
        }
    }