Esempio n. 1
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (var fileDialog = new OpenFileDialog())
            {
                fileDialog.Filter = "M3U-FILES|*.m3u";
                fileDialog.Multiselect = false;

                if (fileDialog.ShowDialog() == DialogResult.OK)
                {
                    var file = fileDialog.FileName;
                    _parser = new M3UParser(file);
                    RefreshGrid();
                }
            }
        }
Esempio n. 2
0
        void mnuMainMenuFileOpenClick(object sender, EventArgs e)
        {
            try
            {
                //show open file dialog
                OpenFileDialog ofd = new OpenFileDialog();
                ofd.Filter = "M3U File (*.m3u) | *.m3u";
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    //clear input grid and data
                    this.ClearInputGridAndData();

                    //clear filter
                    this.txtSearchInput.Text = string.Empty;

                    //parse m3u file
                    M3UParser parser = new M3UParser();
                    mainModel.LoadM3UList(parser.ParseFile(ofd.FileName));

                    //refresh dgvs
                    RefreshInputData();
                    RefreshOutputData();

                    //enable manipulation controls
                    this.EnableInputManipulationControls(InputControlsDiplay.Enabled);
                    this.EnableOutputManipulationControls(OutputControlsDiplay.Enabled);
                    mnuMainMenuFileClose.Enabled = true;

                    //change app title
                    this.Text = this.appTitle + string.Format(" [{0}]", ofd.FileName);

                    //status bar - message
                    this.UpdateStatusBar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }