/// <summary> /// Add all videos to <see cref="VideosListView"/> from <see cref="Channels.GetAllVideos(string)"/>. /// Clears all existing videos already in the listview (if any). /// </summary> /// <param name="channelID">Channel ID to add the videos from.</param> public void AddChannelVideos(string channelID) { VideosListView.BeginUpdate(); VideosListView.Items.Clear(); IEnumerable <Database.Types.Video> videos = Database.Channels.GetAllVideos(channelID).OrderByDescending(v => v.Posted); foreach (Database.Types.Video video in videos) { AddVideoToListView(video); } VideosListView.Columns[PostedColumn.Index].TextAlign = HorizontalAlignment.Right; VideosListView.EndUpdate(); }
/// <summary> /// Add all channels to <see cref="ChannelsListView"/> from <see cref="Channels.GetAll()"/>. /// Clears all existing channels already in the listview (if any). /// </summary> public void AddAllChannels() { ChannelsListView.BeginUpdate(); VideosListView.BeginUpdate(); ChannelsListView.Items.Clear(); VideosListView.Items.Clear(); ChannelsListViewChanged(); foreach (Database.Types.Channel channel in Database.Channels.GetAll()) { AddChannelToListView(channel); } ChannelsListView.EndUpdate(); VideosListView.EndUpdate(); }