コード例 #1
0
        /// <summary>
        /// 删除场景
        /// </summary>
        /// <param name="sceneName"></param>
        public static void DeleteScene(string sceneName)
        {
            if (String.IsNullOrEmpty(sceneName))
            {
                return;
            }
            string videoPath     = FileHelper.GetFileAbsolutePath("CombVideos\\") + sceneName + ".mp4";
            string thumbnailPath = FileHelper.GetFileAbsolutePath("VideoThumbnails\\") + sceneName + ".jpg";
            string videoListPath = FileHelper.GetFileAbsolutePath("VideoLists\\") + sceneName + ".txt";

            ShellFileOperation.Delete(videoPath);
            ShellFileOperation.Delete(videoListPath);
            ShellFileOperation.Delete(thumbnailPath);
        }
コード例 #2
0
ファイル: FormCombine.cs プロジェクト: swy5178/VideoCombine
        //删除视频
        private void simpleButtonDel_Click(object sender, EventArgs e)
        {
            int rowHandle = gridView1.FocusedRowHandle;
            List <VideoInfo> videoInfoList = GetSelectVideos();

            if (videoInfoList == null)
            {
                return;
            }
            if (navBarGroupVideos.SelectedLink.ItemName.Equals("navBarItemAll"))
            {   //视频资源删除
                DialogResult dialogResult = MessageBox.Show(@"确定要永久性的删除选中的视频吗?", @"删除提示", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    //删除本地视频
                    foreach (var videoInfo in videoInfoList)
                    {
                        ShellFileOperation.Delete(videoInfo.VideoPath);
                    }
                    FreshVideosList();
                    gridView1.FocusedRowHandle = rowHandle - 1;
                }
            }
            else
            {
                DialogResult dialogResult = MessageBox.Show(@"确定要移除当前场景下选中的视频吗?", @"移除提示", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    //移除选中视频
                    _sceneVideoInfoList         = _sceneVideoInfoList.Except(videoInfoList).ToList();
                    gridControl1.DataSource     = _sceneVideoInfoList;
                    _changeMark                 = true;
                    simpleButtonCombine.Visible = true;
                }
            }
        }