Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 private void clearSubtitleList()
 {
     FormOperations.ClearEntry(subtitleFilePathList);
     FormOperations.RefreshListViewCount(subtitleFilePathList, subtitleListView, subtitleFileCount);
 }
Exemplo n.º 6
0
 private void clearMovieList()
 {
     FormOperations.ClearEntry(movieFilePathList);
     FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount);
 }
Exemplo n.º 7
0
 private void movieRemoveEntry_Click(object sender, EventArgs e)
 {
     FormOperations.RemoveEntries(movieFilePathList, movieListView.SelectedIndices.Cast <int>().ToList());
     FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount);
 }
Exemplo n.º 8
0
 private void movieAddFolder_Click(object sender, EventArgs e)
 {
     FormOperations.AddFolder(movieAddFolderDialog, movieFilePathList);
     FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount);
 }
Exemplo n.º 9
0
 private void subtitleAddFolder_Click(object sender, EventArgs e)
 {
     FormOperations.AddFolder(subtitleAddFolderDialog, subtitleFilePathList);
     FormOperations.RefreshListViewCount(subtitleFilePathList, subtitleListView, subtitleFileCount);
 }
Exemplo n.º 10
0
 private void movieMovieBottom_Click(object sender, EventArgs e)
 {
     FormOperations.MoveListViewItemBottom(movieListView, movieFilePathList);
     FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount);
     movieListView.Focus();
 }
Exemplo n.º 11
0
 private void subtitleMoveBottom_Click(object sender, EventArgs e)
 {
     FormOperations.MoveListViewItemBottom(subtitleListView, subtitleFilePathList);
     FormOperations.RefreshListViewCount(subtitleFilePathList, subtitleListView, subtitleFileCount);
     subtitleListView.Focus();
 }
Exemplo n.º 12
0
 private void movieAutoFilter_Click(object sender, EventArgs e)
 {
     FormOperations.FilterType(movieFilePathList, FileDataInfo.FileTypeEnum.Movie);
     FormOperations.RefreshListViewCount(movieFilePathList, movieListView, movieFileCount);
 }
Exemplo n.º 13
0
 private void subtitleAutoFilter_Click(object sender, EventArgs e)
 {
     FormOperations.FilterType(subtitleFilePathList, FileDataInfo.FileTypeEnum.Subtitle);
     FormOperations.RefreshListViewCount(subtitleFilePathList, subtitleListView, subtitleFileCount);
 }