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()); } }
internal static Plalistitem AddToPlaylist(string file, System.Windows.Controls.ListBox lstPlaylist, IOutPlugin plugin, bool clearPlaylist) { List <Plalistitem> items = AddToPlaylist(new string[] { file }, lstPlaylist, plugin, clearPlaylist); if (items != null && items.Count > 0) { return(items[0]); } return(null); }
public OutputMenuItem(PluginSystem.IOutPlugin plugin) : base() { m_plugin = plugin; this.Header = plugin.Name; this.Foreground = Brushes.Black; this.IsEnabled = true; this.Header = plugin.Name; this.IsCheckable = true; this.IsChecked = false; this.Name = "menu_" + plugin.Name.Replace(" ", ""); }
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); }