Beispiel #1
0
        private void ParserButton_Click(object sender, RoutedEventArgs e)
        {
            ParserButton.IsEnabled = false;
            Answer.Text            = "";
            OpenFileDialog openDialog = new OpenFileDialog();

            openDialog.Filter      = "Text documents (*.txt)|*.txt|All files (*.*)|*.*";
            openDialog.FilterIndex = 2;
            openDialog.Multiselect = true;
            Nullable <bool> openResult = openDialog.ShowDialog();

            if (openResult == true)
            {
                string[] filenames = openDialog.FileNames;
                t.Reader(filenames);
            }
            Answer.Text = t.ChangeAnswer();
            t.Parser(PunctBox.IsChecked.Value, CountWord.Text);
            Answer.Text = t.ChangeAnswer();
            for (int i = 0; i < t.GetFIleCount(); i++)
            {
                SaveFileDialog saveDialog = new SaveFileDialog();
                saveDialog.Filter      = "Text documents (*.txt)|*.txt|All files (*.*)|*.*";
                saveDialog.FilterIndex = 2;
                Nullable <bool> saveResult = saveDialog.ShowDialog();
                t.Writter(saveDialog.FileName, i);
                Answer.Text = t.ChangeAnswer();
            }
            Answer.Text           += "Работа с файлами окончена. \r\n";
            ParserButton.IsEnabled = true;
        }