示例#1
0
 public void AddWord(IrregularVerb word)
 {
     if (!containWord(word))
     {
         word.path  = Path;
         word.Index = BufferWords.Count + 1;
         word.Url1  = word.AddAudio(word.Word1);
         word.Url2  = word.AddAudio(word.Word2);
         word.Url3  = word.AddAudio(word.Word3);
         File.AppendAllText(Path, word.ToString());
         BufferWords.Add(word);
         CountLocalWords++;
     }
 }
        public static IrregularVerb Parse(string src, string path)
        {
            IrregularVerb temp = new IrregularVerb();

            string[] m = src.Split('%');
            temp.Index     = Convert.ToInt32(m[0]);
            temp.path      = path;
            temp.Word1     = m[1];
            temp.Word2     = m[2];
            temp.Word3     = m[3];
            temp.Translete = m[4];
            temp.PerCent   = Convert.ToInt32(m[5]);
            if (m.Length > 6)
            {
                temp.Url1 = m[6];
                temp.Url2 = m[7];
                temp.Url3 = m[8];
                if (temp.Url1 == string.Empty)
                {
                    temp.Url1 = temp.AddAudio(temp.Word1);
                }
                if (temp.Url2 == string.Empty)
                {
                    temp.Url2 = temp.AddAudio(temp.Word2);
                }
                if (temp.Url3 == string.Empty)
                {
                    temp.Url3 = temp.AddAudio(temp.Word3);
                }
            }
            else
            {
                temp.Url1 = temp.AddAudio(temp.Word1);
                temp.Url2 = temp.AddAudio(temp.Word2);
                temp.Url3 = temp.AddAudio(temp.Word3);
            }
            return(temp);
        }