private void btnConfig_Save_Click(object sender, EventArgs e)
        {
            string tessPath = txtTesseractPath.Text, isoLang = txtIsoLang.Text;

            TesseractConfigHelper.ValidateConfiguration(ref tessPath, ref isoLang);

            epMain.Clear();

            if (tessPath == null)
            {
                epMain.SetError(txtTesseractPath, "Path is empty or invalid.");
            }
            else if (isoLang == null)
            {
                epMain.SetError(txtIsoLang, "Iso Language is empty, less than three letters or invalid.");
            }
            else
            {
                string[] config = { tessPath, isoLang };
                TesseractConfigHelper.SaveConfigurationToFile(config);

                Configuration.TesseractPath = tessPath;
                Configuration.IsoLang       = isoLang;

                this.Close();
            }
        }
Exemplo n.º 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            TesseractConfigHelper.LoadConfigurationFromFile();

            txtisolang.Text = Configuration.IsoLang;
        }