Esempio n. 1
0
        public static void AutoSubtractProgress(string word)
        {
            int newprogress = GetProgress(word) - 3;

            if (newprogress < -2)
            {
                newprogress = -2;
            }
            SetProgress(word, newprogress);
            Console.WriteLine(newprogress);
            StatisticsHelper.AddWordLog(word, StatisticsHelper.WordLogType.ungrasp);
        }
Esempio n. 2
0
 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");
         }
     }
 }