コード例 #1
0
        private void playlistToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var openFileDialog = new OpenFileDialog()
            {
                Filter = @"Playlist file (*.plst)|*.plst",
                Title  = @"Save playlist"
            };

            if (openFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            try
            {
                using (var fileStream = new FileStream(openFileDialog.FileName, FileMode.Open))
                {
                    IFormatter   formater = new BinaryFormatter();
                    Playlist     playlist = (Playlist)formater.Deserialize(fileStream);
                    PlaylistForm pf       = new PlaylistForm(PlayListPlayClicked, playlist);
                    pf.Show();
                }
            }
            catch (Exception)
            {
                MessageBox.Show(@"Could not read file: " + openFileDialog.FileName);
            }
        }
コード例 #2
0
 private void InitializePlaylistForm()
 {
     // create playlist component
     _playlistForm         = new PlaylistForm();
     _playlistForm.Visible = false;
     _playlistForm.AllowMulti(false);
     UpdatePlaylistFormPosition();
 }
コード例 #3
0
 private void InsertIntoPlaylist(string fileIndex, string filePath)
 {
     SafeCall(() =>
     {
         int index;
         int.TryParse(fileIndex, NumberStyles.Number, CultureInfo.InvariantCulture, out index);
         PlaylistForm.InsertFile(index, filePath);
     });
 }
コード例 #4
0
        private void InitializePlaylistForm()
        {
            // create playlist component
            _playlistForm         = new PlaylistForm();
            _playlistForm.Visible = false;
            _playlistForm.AllowMulti(false);
            UpdatePlaylistFormPosition();

            // set playlist events
            _playlistForm.ItemDoubleClickedEvent += new PlaylistControl.PlaylistActionEventHandler(OnPlaylistDoubleClickedItem);
        }
コード例 #5
0
        private void SaveRegex()
        {
            var regexList = new List <string>();

            foreach (var c in s_RegexForm.Controls)
            {
                var cb = c as CheckBox;
                if (cb == null)
                {
                    continue;
                }

                Settings.StripDirectoryInFileName = cb.Checked;
            }

            foreach (var c in s_RegexForm.Controls)
            {
                var flowPanel = c as FlowLayoutPanel;
                if (flowPanel == null)
                {
                    continue;
                }

                foreach (var c1 in flowPanel.Controls)
                {
                    var panel = c1 as Panel;
                    if (panel == null)
                    {
                        continue;
                    }

                    foreach (var c2 in panel.Controls)
                    {
                        var t = c2 as TextBox;
                        if (t != null)
                        {
                            if (!string.IsNullOrEmpty(t.Text))
                            {
                                regexList.Add(t.Text);
                            }
                        }
                    }
                }
            }

            PlaylistForm.UpdatePlaylistWithRegexFilter(regexList, Settings.StripDirectoryInFileName);
        }
コード例 #6
0
        private void playlistToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            PlaylistForm pf = new PlaylistForm(PlayListPlayClicked);

            pf.Show();
        }