Exemple #1
0
        private void openFile(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            //string fileName = "";
            string filePath = Path.GetFileNameWithoutExtension(openFileDialog1.FileName);
            string fileName = Path.GetFileName(openFileDialog1.FileName);

            textBox1.Text = fileName;

            ZipFile.ExtractToDirectory(openFileDialog1.FileName, filePath);
            myDictionary.open(filePath + "\\" + "dictionary.txt");
            myMonitor.open(filePath + "\\" + "monitor.txt");
            redactorRichTextBox.LoadFile(filePath + "\\" + "text.rtf");

            Directory.Delete(filePath, true);

            numericUpDown2.Value = myMonitor.normText;
            dictionaryGrid.Rows.Clear();
            int count = myDictionary.entryCount();

            for (int i = 0; i < count; i++)
            {
                Dictionary.dictionaryEntry en = myDictionary.entryGet(i);
                dictionaryGrid.Rows.Add(en.word, transcription == "en" ? en.transcriptionBritish : en.transcriptionAmerican, en.translation);
                //label3.Text = myDictionary.entryCount().ToString() + " / " + myMonitor.normWords.ToString();
                renewalMonitorLabel();
            }
        }
Exemple #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            dictionaryGrid.Rows.Clear();
            myDictionary.open("dic.txt");

            int count = myDictionary.entryCount();

            for (int i = 0; i < count; i++)
            {
                Dictionary.dictionaryEntry en = myDictionary.entryGet(i);
                dictionaryGrid.Rows.Add(en.word, transcription == "en" ? en.transcriptionBritish : en.transcriptionAmerican, en.translation);
            }
        }
Exemple #3
0
        private void button6_Click(object sender, EventArgs e)
        {
            transcription   = "en";
            button6.Enabled = false;
            button5.Enabled = true;

            dictionaryGrid.Rows.Clear();
            int count = myDictionary.entryCount();

            for (int i = 0; i < count; i++)
            {
                Dictionary.dictionaryEntry en = myDictionary.entryGet(i);
                dictionaryGrid.Rows.Add(en.word, transcription == "en" ? en.transcriptionBritish : en.transcriptionAmerican, en.translation);
            }
        }
Exemple #4
0
        private void переводToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string word = redactorRichTextBox.SelectedText;

            if (word != "")
            {
                myDictionary.entryAdd(word);
                if (myDictionary.isEmpty())
                {
                    return;
                }
                Dictionary.dictionaryEntry en = myDictionary.entryGet(myDictionary.entryCount() - 1);
                dictionaryGrid.Rows.Add(en.word, transcription == "en" ? en.transcriptionBritish : en.transcriptionAmerican, en.translation);
                //label3.Text = myDictionary.entryCount().ToString() + " / " + myMonitor.normWords.ToString();
                renewalMonitorLabel();
                metroTabControl1.SelectTab(1);
            }
        }