Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            String dirIndd        = textBox1.Text;
            String dirIllustrator = textBox2.Text;
            bool   isIndd         = checkBox1.Checked;
            bool   isIllustrator  = checkBox2.Checked;

            if (!dirIndd.Trim().Equals("") && !isInddStarted &&
                isIndd)
            {
                try
                {
                    InDesignController.start(dirIndd);
                    isInddStarted            = true;
                    this.checkBox1.ForeColor = System.Drawing.Color.Green;
                    button1.Enabled          = false;
                    button2.Enabled          = true;
                    //MessageBox.Show("InDesign Converter start successfully.");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("InDesign Converter can't be started.");
                }
            }
            if (!dirIllustrator.Trim().Equals("") && !isIllustratorStarted &&
                isIllustrator)
            {
                try
                {
                    IllustratorController.start(dirIllustrator);
                    isIllustratorStarted     = true;
                    this.checkBox2.ForeColor = System.Drawing.Color.Green;
                    button1.Enabled          = false;
                    button2.Enabled          = true;
                }
                catch (Exception em)
                {
                    MessageBox.Show("Illustrator Converter can't be started.");
                }
            }
        }
Ejemplo n.º 2
0
        private void startConverter()
        {
            String dirIndd        = textBox_dir_indesign.Text;
            String dirIllustrator = textBox_dir_illustrator.Text;
            bool   isIndd         = checkBox1.Checked;
            bool   isIllustrator  = checkBox2.Checked;

            if (!isInddStarted && isIndd)
            {
                if (!dirIndd.Trim().Equals(""))
                {
                    if (Directory.Exists(dirIndd))
                    {
                        try
                        {
                            AppConfig.UpdateAppConfig(keyInddDir, dirIndd);
                        }
                        catch { }
                        try
                        {
                            InDesignController.start(dirIndd);
                            isInddStarted            = true;
                            this.checkBox1.ForeColor = System.Drawing.Color.Green;
                            button1.Enabled          = false;
                            button2.Enabled          = true;
                            //MessageBox.Show("InDesign Converter start successfully.");
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(this, "InDesign Converter can't be started.");
                        }
                    }
                    else
                    {
                        MessageBox.Show(this, "InDesign Converter can't be started because of Directory (" + dirIndd + ") does not exists!");
                    }
                }
                else
                {
                    MessageBox.Show(this, "Please set the conversion directory first");
                }
            }
            if (!isIllustratorStarted && isIllustrator)
            {
                if (!dirIllustrator.Trim().Equals(""))
                {
                    if (Directory.Exists(dirIllustrator))
                    {
                        try
                        {
                            AppConfig.UpdateAppConfig(keyIlluDir, dirIllustrator);
                        }
                        catch { }
                        try
                        {
                            IllustratorController.start(dirIllustrator);
                            isIllustratorStarted     = true;
                            this.checkBox2.ForeColor = System.Drawing.Color.Green;
                            this.label2.ForeColor    = System.Drawing.Color.Green;

                            button2.Enabled = true;
                        }
                        catch (Exception em)
                        {
                            MessageBox.Show(this, "Illustrator Converter can't be started.");
                        }
                    }
                    else
                    {
                        MessageBox.Show(this, "Illustrator Converter can't be started because of Directory (" + dirIllustrator + ") does not exists!");
                    }
                }
                else
                {
                    MessageBox.Show(this, "Please set the conversion directory first");
                }
            }
        }