Ejemplo n.º 1
0
        private void ParseToJson_btn_Click(object sender, EventArgs e)
        {
            ConvertButtonsEnabled(false);
            saveFileDialog.Filter   = "JSON File|*.json";
            saveFileDialog.FileName = null;
            DialogResult result = saveFileDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                Cursor.Current = Cursors.WaitCursor;
                try
                {
                    JSONWriter.WriteData(ExcelReader.GetInstance(Source_path_textBox.Text), saveFileDialog.FileName);
                    MessageBox.Show("Finished");
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message + "\n" + exc.InnerException + " " + exc.StackTrace, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            ConvertButtonsEnabled(true);
        }