public static void Clear(bool onlyClearMemory = true) { if (!onlyClearMemory) { GTXmlHelper.ClearAll(XmlPath); } if (Dict != null) { Dict.Clear(); } }
public static void Update(int key, TVal obj) { if (Dict.ContainsKey(key)) { GTXmlHelper.Update(XmlPath, key.ToString(), obj, KeyType); } else { Insert(key, obj); } }
public static void Read(string path, EDataKeyType keyType) { XmlPath = path; KeyType = keyType; XmlNodeList nodeList = GTXmlHelper.GetXmlNodeList(XmlPath); for (int i = 0; i < nodeList.Count; i++) { XmlElement xe = nodeList.Item(i) as XmlElement; if (xe == null) { continue; } int key = xe.GetAttribute(KeyType.ToString()).ToInt32(); for (int j = 0; j < xe.Attributes.Count; j++) { string name = xe.Attributes[j].Name; string value = xe.Attributes[j].Value; AppendAttribute(key, name, value); } } }
public static void Delete(int key) { Dict.Remove(key); GTXmlHelper.Delete(XmlPath, key.ToString(), KeyType); }
public static void Insert(int key, TVal obj) { Dict[key] = obj; GTXmlHelper.Append(XmlPath, key.ToString(), obj, KeyType); }