Beispiel #1
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            Parser pars = new Parser();

            for (int i = 0; i < ParserGrid.Rows.Count; i++)
            {
                DataGridViewRow currentRow = ParserGrid.Rows[i];
                if (currentRow.Cells[0].Value != null)
                {
                    if (currentRow.Cells[1].Value == null)
                        currentRow.Cells[1].Value = "";

                    if (currentRow.Cells[2].Value == null)
                        currentRow.Cells[2].Value = "";

                    if (currentRow.Cells[3].Value == null)
                        currentRow.Cells[3].Value = "";

                    //pars.addRule(currentRow.Cells[0].Value.ToString(), currentRow.Cells[1].Value.ToString(), currentRow.Cells[2].Value.ToString(), currentRow.Cells[3].Value.ToString());
                    try
                    {
                        pars.addRule(currentRow.Cells[0].Value.ToString(), currentRow.Cells[1].Value.ToString(), currentRow.Cells[2].Value.ToString(), currentRow.Cells[3].Value.ToString());
                    }
                    catch (Exception exp)
                    {
                        //MessageBox.Show("data" + currentRow.Cells[2].Value.ToString());
                    }
                }

            }
            pars.saveToFile();
            MessageBox.Show("Внимание! После изменения настроек парсера необходимо перезапустить программу.");
            Close();
        }