public void LoadShows(List <TvShow> shows) { if (shows.Count <= 0) { return; } var scheduleShows = new BaseRepository <UserSchedule>().Get(sc => sc.User.Id == CurrentUserId).ToList(); var schShowsIdList = scheduleShows.Select(show => show.TvShow.Id).ToList(); lvShowPrograms.Items.Clear(); ListViewItem[] arrTvShowsItems = ProgrammeToListViewItem(shows).ToArray(); lvShowPrograms.BeginUpdate(); ListView.ListViewItemCollection lvic = new ListView.ListViewItemCollection(lvShowPrograms); lvic.AddRange(arrTvShowsItems); foreach (ListViewItem item in arrTvShowsItems) { if (schShowsIdList.Any(schedule => schedule == item.SubItems[5].Text.GetInt())) { item.Checked = true; } } lvShowPrograms.EndUpdate(); }
async Task getProgrammersAsync() { List <ListViewItem> programmers = new List <ListViewItem>(); if (checkNetwork()) { var response = await new GitHubClient(new ProductHeaderValue("OneDumper")) .Repository .Content.GetAllContents("OneLabsTools", "Programmers"); IReadOnlyList <RepositoryContent> files = response; foreach (RepositoryContent file in files) { if (!file.Name.Contains("QCOM_USB_Driver")) { programmers.Add(new ListViewItem(file.Name, programmerList.Groups[1])); } } } if (Directory.Exists("CustomProgrammers")) { foreach (string file in Directory.GetFiles("CustomProgrammers", "*.*").Where(s => s.EndsWith(".mbn") || s.EndsWith(".elf") || s.EndsWith(".bin")).Select(p => Path.GetFileName(p)).ToArray()) { programmers.Add(new ListViewItem(file, programmerList.Groups[0])); } } programmerList.BeginUpdate(); ListView.ListViewItemCollection lvic = new ListView.ListViewItemCollection(programmerList); lvic.AddRange(programmers.ToArray()); programmerList.EndUpdate(); }
public void SetFilesList(ListViewItem[] items, ImageList icons) { listViewFiles.SmallImageList = icons; BuildHeaders(listViewFiles); listViewFiles.BeginUpdate(); ListView.ListViewItemCollection lvic = new ListView.ListViewItemCollection(listViewFiles); lvic.AddRange(items); listViewFiles.EndUpdate(); CancelSelection(); }
private void LoadAllChannelsList() { //var number = 1; var allChannels = new BaseRepository <Channel>().GetAll().ToList(); if (!allChannels.Any()) { return; } ListViewItem[] arrChannelItems = ChannelsToListViewItem(allChannels).ToArray(); lvChannelsList.BeginUpdate(); ListView.ListViewItemCollection lvic = new ListView.ListViewItemCollection(lvChannelsList); lvic.AddRange(arrChannelItems); lvChannelsList.EndUpdate(); }