private void autoDropPanel_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { string[] selectedPaths = (string[])e.Data.GetData(DataFormats.FileDrop); foreach (string selectedPath in selectedPaths) { if (File.Exists(selectedPath)) { if (FileDataInfo.ParseFileType(selectedPath) == FileDataInfo.FileTypeEnum.Movie) { movieFilePathList.Add(selectedPath); } else if (FileDataInfo.ParseFileType(selectedPath) == FileDataInfo.FileTypeEnum.Subtitle) { subtitleFilePathList.Add(selectedPath); } } if (Directory.Exists(selectedPath)) { subtitleFilePathList.AddRange(Directory.EnumerateFiles(selectedPath).Select(x => new FileDataInfo(x)).Where(x => x.FileType == FileDataInfo.FileTypeEnum.Subtitle)); movieFilePathList.AddRange(Directory.EnumerateFiles(selectedPath).Select(x => new FileDataInfo(x)).Where(x => x.FileType == FileDataInfo.FileTypeEnum.Movie)); } } } FormOperations.RefreshListViewCount(subtitleFilePathList, subtitleListView, subtitleFileCount); FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount); }
private void displayModeDiscrepancyName_CheckedChanged(object sender, EventArgs e) { FormOperations.DisplayMode = DisplayModeOption.DiscrepancyOnly; subtitleFilePathList.DisplayMode = DisplayModeOption.DiscrepancyOnly; movieFilePathList.DisplayMode = DisplayModeOption.DiscrepancyOnly; FormOperations.RefreshListViewItemDisplayMode(subtitleListView); FormOperations.RefreshListViewItemDisplayMode(movieListView); }
private void movieFilterButton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(movieFilterBox.Text)) { MessageBox.Show("The filter key cannot be blank", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } FormOperations.FilterEntry(movieFilePathList, movieFilterBox.Text); FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount); }
private void movieListView_DragDrop(object sender, DragEventArgs e) { Point clientPoint = movieListView.PointToClient(new Point(e.X, e.Y)); var lvi = movieListView.GetItemAt(clientPoint.X, clientPoint.Y); if (e.Data.GetDataPresent(DataFormats.FileDrop)) { FormOperations.AddEntryByDragDrop(movieFilePathList, (string[])e.Data.GetData(DataFormats.FileDrop), lvi?.Index ?? null); } else if (e.Data.GetDataPresent(typeof(ListView.SelectedListViewItemCollection)) || e.Data.GetDataPresent(typeof(ListView.SelectedIndexCollection))) { FormOperations.ReorderListViewItemByDragDrop(movieFilePathList, movieListView.SelectedIndices.Cast <int>().ToList(), lvi?.Index ?? null); } FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount); }
private void clearSubtitleList() { FormOperations.ClearEntry(subtitleFilePathList); FormOperations.RefreshListViewCount(subtitleFilePathList, subtitleListView, subtitleFileCount); }
private void clearMovieList() { FormOperations.ClearEntry(movieFilePathList); FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount); }
private void movieRemoveEntry_Click(object sender, EventArgs e) { FormOperations.RemoveEntries(movieFilePathList, movieListView.SelectedIndices.Cast <int>().ToList()); FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount); }
private void movieAddFolder_Click(object sender, EventArgs e) { FormOperations.AddFolder(movieAddFolderDialog, movieFilePathList); FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount); }
private void subtitleAddFolder_Click(object sender, EventArgs e) { FormOperations.AddFolder(subtitleAddFolderDialog, subtitleFilePathList); FormOperations.RefreshListViewCount(subtitleFilePathList, subtitleListView, subtitleFileCount); }
private void movieMovieBottom_Click(object sender, EventArgs e) { FormOperations.MoveListViewItemBottom(movieListView, movieFilePathList); FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount); movieListView.Focus(); }
private void subtitleMoveBottom_Click(object sender, EventArgs e) { FormOperations.MoveListViewItemBottom(subtitleListView, subtitleFilePathList); FormOperations.RefreshListViewCount(subtitleFilePathList, subtitleListView, subtitleFileCount); subtitleListView.Focus(); }
private void movieAutoFilter_Click(object sender, EventArgs e) { FormOperations.FilterType(movieFilePathList, FileDataInfo.FileTypeEnum.Movie); FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount); }
private void subtitleAutoFilter_Click(object sender, EventArgs e) { FormOperations.FilterType(subtitleFilePathList, FileDataInfo.FileTypeEnum.Subtitle); FormOperations.RefreshListViewCount(subtitleFilePathList, subtitleListView, subtitleFileCount); }