public static void GraspProgress(string word) { if (GetProgress(word) < AppInfoHelper.GetReciteNumber()) { int newprogress = AppInfoHelper.GetReciteNumber(); SetProgress(word, newprogress); StatisticsHelper.AddWordLog(word, StatisticsHelper.WordLogType.grasp); } }
public static void SetProgress(string word, int progress) { if (IsWordIn(word)) { } else { AddWordData(word, 0); } if (StatisticsHelper.IsWordInLog(word)) { } else { if (progress >= -2 && progress <= AppInfoHelper.GetReciteNumber()) { XmlDocument xdoc = new XmlDocument(); xdoc.Load(Environment.CurrentDirectory + "\\WordData.xml"); XmlNode root = xdoc.DocumentElement; foreach (XmlNode node in root.ChildNodes) { if ("item" == node.Name) { foreach (XmlNode node2 in node.ChildNodes) { if (node2.InnerText == word) { node["progress"].InnerText = progress.ToString(); node["update"].InnerText = true.ToString(); } } } } xdoc.Save(Environment.CurrentDirectory + "\\WordData.xml"); } } }