Example #1
0
        private void PlayVideo(bool isnew = true)
        {
            ReturnRepetition re    = (ReturnRepetition)gridView1.GetRow(gridView1.FocusedRowHandle);
            VideoPlay        play  = new VideoPlay();
            List <VideoPlay> plays = new List <VideoPlay>();

            if (isnew)
            {
                play = VideoData.GetIndexVideoInfo(re.ID);
                plays.Add(play);
            }
            else
            {
                if (re.DuplicateId == 0)
                {
                    return;
                }
                play = VideoData.GetIndexVideoInfo(re.DuplicateId);
                foreach (var item in re.Duplicates)
                {
                    VideoPlay video = VideoData.GetIndexVideoInfo(item.Id);
                    plays.Add(video);
                }
            }
            if (play == null)
            {
                MessageBox.Show("不存在该视频或者已经被删除");
                return;
            }
            VideoRecording recording = new VideoRecording(play, plays);

            if (play == null || play.Uri == null)
            {
                return;
            }
            if (File.Exists(AppSettings.ReturnStringUrl(Methods.ConversionString(play.Uri))))
            {
                recording.Show();
                Program.log.Error($"打开{AppSettings.ReturnStringUrl(Methods.ConversionString(play.Uri))}", new Exception("打开成功"));
            }
            else
            {
                DialogResult MsgBoxResult = MessageBox.Show("指定目录没有找到该视频,是否继续标注", "提示", MessageBoxButtons.YesNo,
                                                            MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
                if (MsgBoxResult != DialogResult.Yes)
                {
                    return;
                }
                recording.Show();
                Program.log.Error($"打开{AppSettings.ReturnStringUrl(Methods.ConversionString(play.Uri))}", new Exception("没有找到视频"));
            }
        }
Example #2
0
        private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ReturnRepetition re = (ReturnRepetition)gridView1.GetRow(gridView1.FocusedRowHandle);

            if (MessageBox.Show($"是否删除编号{re.ID}的视频?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            if (!VideoData.DeleteVideo(re.ID))
            {
                MessageBox.Show("删除失败");
                Program.log.Error($"删除{re.ID}失败", new Exception($"{re.ID}"));
                return;
            }
            if (!VideoData.DeleteRepetitionVideo(re.ID))
            {
                MessageBox.Show("删除失败");
                Program.log.Error($"删除{re.ID}失败", new Exception($"{re.ID}"));
                return;
            }
            MessageBox.Show("删除成功");
        }
Example #3
0
        private void ShowFolder()
        {
            ReturnRepetition re = (ReturnRepetition)gridView1.GetRow(gridView1.FocusedRowHandle);

            Methods.OpenFolderAndSelectFile(AppSettings.ReturnStringUrl(Methods.ConversionString(re.Path)));
        }