public ErrorListCurrentFile(TrainingWords trainingWords)
 {
     InitializeComponent();
     this.Translator = trainingWords;
     this.path       = trainingWords.Path;
     ListItialize();
 }
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            flag = false;
            Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);

            config.AppSettings.Settings["patch"].Value = FilelistBox.SelectedItem.ToString();
            config.Save();
            translators.closing();
            ErrorWord.close();
            TrainingWords.SaveBadKmow();
        }
Esempio n. 3
0
        public CreateFileByFile(TrainingWords tr, String path)
        {
            InitializeComponent();
            this.tr = tr;
            StreamReader stream = new StreamReader(path);

            while (!stream.EndOfStream)
            {
                buffer.Add(stream.ReadLine());
            }
            stream.Close();
            NextWords();
        }
        public Trainer()
        {
            InitializeComponent();
            Transletors = new TrainingWords();
            Transletors.StartTraires += new TrDel(button3Click);
            DirectoryInfo inf = new DirectoryInfo("F:\\EnglishWords");

            foreach (var item in inf.GetFiles())
            {
                if (item.Name.Contains("Words"))
                {
                    toolStripComboBox1.Items.Add(item.FullName);
                }
            }
            toolStripComboBox1.SelectedIndex = 0;
            toolStripComboBox1.SelectedItem  = ConfigurationManager.AppSettings["patch"];
        }
Esempio n. 5
0
        private void CreateFile_CR(FindNewWordsCreateFile.createdFile createdFile)
        {
            CreateFile(createdFile.patchName);
            List <string> listwords = new List <string>();

            foreach (ListViewItem item in listView1.Items)
            {
                if (item.SubItems[2].Text == "")
                {
                    listwords.Add(item.SubItems[1].Text);
                }
                else if (!isExistInColection(item.SubItems[2].Text, createdFile.Files))
                {
                    listwords.Add(item.SubItems[1].Text);
                }
            }
            trainingWords = getTranslator(createdFile.patchName);
            FindNewWordsCreateWords createWords = new FindNewWordsCreateWords(listwords.ToArray());

            createWords.CreateW += CreateWords_CreateW;
            createWords.Show();
        }
 public WordsCoachUa(TrainingWords tr, int corectValue = 0)
 {
     InitializeComponent();
     this.Transletors   = tr;
     this.corectedvalue = corectedvalue;
 }
        private void setAnsver(int id, bool correct = true)
        {
            TrainWord word = BufferWords[id];

            if (correct == true && CurrentWordF1 == false)
            {
                if (word.PerCent <= 50)
                {
                    BufferWords[id].PerCent += PercentPlus / 2;
                }
                else if (word.PerCent + PercentPlus <= 160)
                {
                    BufferWords[id].PerCent += PercentPlus;
                }
                else
                {
                    BufferWords[id].PerCent = 160;
                }
                AmountCorrectAnswer++;
                if (word.GoodTries >= 2)
                {
                    BufferWords[id].GoodTries = 0;
                    if (word.BadTries - 2 >= 0)
                    {
                        BufferWords[id].BadTries -= 2;
                        if (BufferWords[id].BadTries == 0)
                        {
                            TrainingWords.RemoveBadKnowWord(BufferWords[id]);
                        }
                    }
                }
                else
                {
                    BufferWords[id].GoodTries++;
                }
                Log.Add(this.Path, "word -" + word.Word + " corect Ansver Percent-" + word.PerCent);
            }
            else if (correct == false)
            {
                if (word.PerCent - PercentMinus >= 0)
                {
                    BufferWords[id].PerCent -= PercentMinus;
                }
                else
                {
                    BufferWords[id].PerCent = 0;
                }
                CurrentWordF1 = true;
                AmountF1++;


                if (BufferWords[id].BadTries < Convert.ToInt32(ConfigurationManager.AppSettings["BadTries"]))
                {
                    BufferWords[id].BadTries++;
                    if (BufferWords[id].GoodTries > 0)
                    {
                        BufferWords[id].GoodTries = 0;
                    }
                }
                else
                {
                    TrainingWords.AddBadKnowWord(BufferWords[id]);
                }
                Log.Add(this.Path, "word -" + word.Word + " bad Ansver Percent-" + word.PerCent);
            }
            ChangedWord(BufferWords[id], this.Path);
        }
        private TrainingWords FindNewWords_getTranslator(string path)
        {
            TrainingWords t = translators.getTTranslator(path);

            return(t);
        }
 private void MainForm_Load(object sender, EventArgs e)
 {
     TrainingWords.LoadBadKnow();
     Task.Run(new Action(() => LoadErrorList()));
     Task.Run(new Action(() => loadForm()));
 }