Beispiel #1
0
        internal static void AddToPlaylist(Playlist playlist, System.Windows.Controls.ListBox lstPlaylist,
                                           IOutPlugin plugin, bool clearPlaylist = true)
        {
            if (playlist == null)
            {
                return;
            }

            try
            {
                if (clearPlaylist)
                {
                    lstPlaylist.Items.Clear();
                }

                foreach (var item in playlist)
                {
                    if (IsFileSupport(item.Path))
                    {
                        Plalistitem play_item = new Plalistitem(item.Tag);


                        if (play_item.FirstLoad(item.Path, plugin))
                        {
                            play_item.IsWhite = lstPlaylist.Items.Count % 2 == 1;
                            lstPlaylist.Items.Add(play_item);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
Beispiel #2
0
        internal static List <Plalistitem> AddToPlaylist(string[] files, System.Windows.Controls.ListBox lstPlaylist,
                                                         IOutPlugin plugin, bool clearPlaylist)
        {
            if (files == null)
            {
                return(null);
            }

            List <Plalistitem> list = new List <Plalistitem>();

            try
            {
                if (clearPlaylist)
                {
                    lstPlaylist.Items.Clear();
                }

                foreach (var item in files)
                {
                    if (IsFileSupport(item))
                    {
                        Plalistitem play_item = new Plalistitem();

                        if (play_item.FirstLoad(item, plugin))
                        {
                            play_item.IsWhite = lstPlaylist.Items.Count % 2 == 1;
                            lstPlaylist.Items.Add(play_item);

                            list.Add(play_item);
                        }
                    }
                }
                return(list);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
            return(null);
        }