Esempio n. 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (isInddStarted)
     {
         InDesignController.stop();
         isInddStarted   = false;
         button2.Enabled = false;
         button1.Enabled = true;
     }
 }
Esempio n. 2
0
        private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            InDesignController.stop();
            this.notifyIcon1.Visible = false;

            Application.Exit();
            Process[] pary = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
            foreach (Process p in pary)
            {
                p.Kill();
            }
        }
Esempio n. 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            bool isIndd = true;

            if (isInddStarted && isIndd)
            {
                showStatus("Stopping converter...", StatusColor.normal);
                InDesignController.stop();
                isInddStarted   = false;
                button2.Enabled = false;
                button1.Enabled = true;
                showStatus("Converter stopped.", StatusColor.normal);
            }
        }
Esempio n. 4
0
        private void startConverter()
        {
            String dirIndd = textBox_dir_indesign.Text;
            bool   isIndd  = true;

            if (isIndd)
            {
                if (!dirIndd.Trim().Equals(""))
                {
                    if (Directory.Exists(dirIndd))
                    {
                        try
                        {
                            AppConfig.UpdateAppConfig(keyInddDir, dirIndd);
                        }
                        catch { }
                        try
                        {
                            showStatus("Starting converter...", StatusColor.normal);
                            InDesignController.start(dirIndd);
                            isInddStarted   = true;
                            button1.Enabled = false;
                            button2.Enabled = true;
                            //MessageBox.Show("InDesign Converter start successfully.");
                            showStatus("Converter started.", StatusColor.success);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(this, "InDesign Converter can't be started.");
                            showStatus("Error occur, please check the log.", StatusColor.failed);
                        }
                    }
                    else
                    {
                        MessageBox.Show(this, "InDesign Converter can't be started because of Directory (" + dirIndd + ") does not exists!");
                        showStatus("Conversion directory does not exists!", StatusColor.failed);
                    }
                }
                else
                {
                    MessageBox.Show(this, "Please set the conversion directory first");
                    showStatus("Please set the conversion directory first.", StatusColor.failed);
                }
            }
        }
Esempio n. 5
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.");
                }
            }
        }
Esempio n. 6
0
        private void startConverter()
        {
            String dirIndd = textBox_dir_indesign.Text;

            if (!isInddStarted)
            {
                if (!dirIndd.Trim().Equals(""))
                {
                    if (Directory.Exists(dirIndd))
                    {
                        try
                        {
                            AppConfig.UpdateAppConfig(keyInddDir, dirIndd);
                        }
                        catch { }
                        try
                        {
                            InDesignController.start(dirIndd);
                            isInddStarted   = true;
                            button1.Enabled = false;
                            button2.Enabled = true;
                        }
                        catch (Exception e)
                        {
                            MessageBox.Show(this, "Idml Converter can't be started.");
                        }
                    }
                    else
                    {
                        MessageBox.Show(this, "Idml Converter can't be started because of Directory (" + dirIndd + ") does not exist!");
                    }
                }
                else
                {
                    MessageBox.Show(this, "Please set the conversion directory first");
                }
            }
        }
Esempio n. 7
0
        private void button2_Click(object sender, EventArgs e)
        {
            bool isIndd        = checkBox1.Checked;
            bool isIllustrator = checkBox2.Checked;

            if (isInddStarted && isIndd)
            {
                InDesignController.stop();
                isInddStarted            = false;
                this.checkBox1.ForeColor = System.Drawing.Color.OrangeRed;
                button2.Enabled          = false;
                button1.Enabled          = true;
            }

            if (isIllustratorStarted && isIllustrator)
            {
                IllustratorController.stop();
                isIllustratorStarted     = false;
                this.checkBox2.ForeColor = System.Drawing.Color.OrangeRed;
                button2.Enabled          = false;
                button1.Enabled          = true;
            }
        }
Esempio n. 8
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");
                }
            }
        }