Пример #1
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);
        }