Ejemplo n.º 1
0
        // Check if app config is valid
        protected void CheckConfig()
        {
            FormConfig config_dialog = null;

            try {
                if (!AppConfig.Valid)
                {
                    config_dialog = new FormConfig();
                    if (config_dialog.ShowDialog(this) != DialogResult.OK)
                    {
                        Load += (s, e) => Close();
                    }
                }
            }
            catch (Exception) {
                MessageBox.Show("Failed to open app config file.", "Error");
                Load += (s, e) => Close();
                return;
            }
            finally {
                if (config_dialog != null)
                {
                    config_dialog.Dispose();
                }
            }

            if (AppConfig.OutputDirectory.Trim() != String.Empty)
            {
                TextBoxOutput.Text = AppConfig.OutputDirectory + @"\output.mp4";
            }
        }
Ejemplo n.º 2
0
        protected override void WndProc(ref Message m)
        {
            base.WndProc(ref m);

            if ((m.Msg != WM_SYSCOMMAND) || ((int)m.WParam != SYSMENU_CONFIG_ID))
            {
                return;
            }
            if (app.proc != null && app.proc.IsRunning)
            {
                return;
            }

            var config_dialog = new FormConfig();

            config_dialog.ShowDialog(this);

            if (TextBoxOutput.Text.Trim() == String.Empty && AppConfig.OutputDirectory.Trim() != String.Empty)
            {
                TextBoxOutput.Text = AppConfig.OutputDirectory + @"\output.mp4";
            }
        }