Exemplo n.º 1
0
 private void FeatureDataGridView_DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
 {
     FeatureDataGridView.ClearSelection();
 }
Exemplo n.º 2
0
        private void FolderInputSourceButton_Click(object sender, EventArgs e)
        {
            string       myinput      = "";
            string       outputFolder = "";
            DialogResult dr;

            input.Clear();

            if (FolderSelection.Checked)
            {
                folderBrowserDialog1.SelectedPath        = MainForm.Instance.Settings.Eac3toLastFolderPath;
                folderBrowserDialog1.Description         = "Choose an input directory";
                folderBrowserDialog1.ShowNewFolderButton = false;
                dr = folderBrowserDialog1.ShowDialog();
                if (dr != DialogResult.OK)
                {
                    return;
                }
                MainForm.Instance.Settings.Eac3toLastFolderPath = folderBrowserDialog1.SelectedPath;

                inputType = 1;
                if (folderBrowserDialog1.SelectedPath.EndsWith(":\\"))
                {
                    myinput = folderBrowserDialog1.SelectedPath;
                }
                else
                {
                    myinput = folderBrowserDialog1.SelectedPath + System.IO.Path.DirectorySeparatorChar;
                }
                outputFolder = myinput.Substring(0, myinput.LastIndexOf("\\") + 1);
                input.Add(myinput);
            }
            else
            {
                openFileDialog1.InitialDirectory = MainForm.Instance.Settings.Eac3toLastFilePath;
                dr = openFileDialog1.ShowDialog();
                if (dr != DialogResult.OK)
                {
                    return;
                }
                MainForm.Instance.Settings.Eac3toLastFilePath = System.IO.Path.GetDirectoryName(openFileDialog1.FileName);

                inputType = 2;
                int idx = 0;
                foreach (String file in openFileDialog1.FileNames)
                {
                    if (idx == 0)
                    {
                        outputFolder = System.IO.Path.GetDirectoryName(file);
                        myinput      = file;
                        input.Add(file);
                    }
                    else // seamless branching
                    {
                        myinput += "+" + file;
                        input.Add(file);
                    }
                    idx++;
                }
            }

            FolderInputTextBox.Text = myinput;
            if (String.IsNullOrEmpty(FolderInputTextBox.Text))
            {
                return;
            }

            if (String.IsNullOrEmpty(FolderOutputTextBox.Text))
            {
                FolderOutputTextBox.Text = MeGUI.core.util.FileUtil.GetOutputFolder(outputFolder);
                if (!MeGUI.core.util.FileUtil.IsDirWriteable(FolderOutputTextBox.Text) && !String.IsNullOrEmpty(MainForm.Instance.Settings.Eac3toLastDestinationPath))
                {
                    FolderOutputTextBox.Text = MainForm.Instance.Settings.Eac3toLastDestinationPath;
                }
            }

            FeatureDataGridView.DataSource = null;
            FeatureDataGridView.Rows.Clear();
            FeatureDataGridView.ClearSelection();
            StreamDataGridView.DataSource = null;
            StreamDataGridView.Rows.Clear();
            StreamDataGridView.ClearSelection();

            _oEac3toInfo = new Eac3toInfo(input, null, null);
            _oEac3toInfo.FetchInformationCompleted += new OnFetchInformationCompletedHandler(SetData);
            _oEac3toInfo.ProgressChanged           += new OnProgressChangedHandler(SetProgress);

            ResetCursor(Cursors.WaitCursor);
            _oEac3toInfo.FetchFeatureInformation();
        }