Browse Source

Merge remote-tracking branch 'origin/zyy' into zhangxueyang

# Conflicts:
#	XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs
tags/录制修改前
zhangxueyang 4 years ago
parent
commit
ce179b1f5d

+ 1
- 0
Common/system/ImageHelper.cs View File

104
         }
104
         }
105
 
105
 
106
         #endregion 获取RGB
106
         #endregion 获取RGB
107
+
107
         #region 截图统一方法
108
         #region 截图统一方法
108
         /// <summary>
109
         /// <summary>
109
         /// 截图通用方法 创建人:赵耀 创建时间:2020年8月11日
110
         /// 截图通用方法 创建人:赵耀 创建时间:2020年8月11日

+ 55
- 10
XHWK.WKTool/CountdownWindow.xaml.cs View File

24
         /// 计时器
24
         /// 计时器
25
         /// </summary>
25
         /// </summary>
26
         System.Timers.Timer timer;
26
         System.Timers.Timer timer;
27
-        int ImgNum = 3;
27
+        int ImgNum = 9;
28
         public void Initialize(int changeTime=650)
28
         public void Initialize(int changeTime=650)
29
         {
29
         {
30
-            timer.Interval = changeTime;
30
+            timer.Interval = changeTime/3;
31
             timer.Enabled = true; //启动计时器
31
             timer.Enabled = true; //启动计时器
32
-            ImgNum = 3;
32
+            ImgNum = 9;
33
         }
33
         }
34
 
34
 
35
         private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
35
         private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
42
             else
42
             else
43
             {
43
             {
44
                 timer.Enabled = false;
44
                 timer.Enabled = false;
45
-                Dispatcher.Invoke(() =>
46
-                {
47
-                    Hide();
48
-                });
45
+                Dispatcher.Invoke(
46
+                  DispatcherPriority.Send,
47
+                  new Action(() =>
48
+                  {
49
+                      imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_3.png"));
50
+                      Hide();
51
+                  }));
49
             }
52
             }
50
         }
53
         }
51
         /// <summary>
54
         /// <summary>
60
                     Dispatcher.Invoke(
63
                     Dispatcher.Invoke(
61
                       DispatcherPriority.Send,
64
                       DispatcherPriority.Send,
62
                       new Action(() => { 
65
                       new Action(() => { 
63
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown_1.png"));
66
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_1.png"));
64
                       }));
67
                       }));
65
                     break;
68
                     break;
66
                 case 2:
69
                 case 2:
67
                     Dispatcher.Invoke(
70
                     Dispatcher.Invoke(
68
                       DispatcherPriority.Send,
71
                       DispatcherPriority.Send,
69
                       new Action(() => {
72
                       new Action(() => {
70
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown_2.png"));
73
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_2.png"));
71
                       }));
74
                       }));
72
                     break;
75
                     break;
73
                 case 3:
76
                 case 3:
74
                     Dispatcher.Invoke(
77
                     Dispatcher.Invoke(
75
                       DispatcherPriority.Send,
78
                       DispatcherPriority.Send,
76
                       new Action(() => {
79
                       new Action(() => {
77
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown_3.png"));
80
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_3.png"));
81
+                      }));
82
+                    break;
83
+                case 4:
84
+                    Dispatcher.Invoke(
85
+                      DispatcherPriority.Send,
86
+                      new Action(() => {
87
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_1.png"));
88
+                      }));
89
+                    break;
90
+                case 5:
91
+                    Dispatcher.Invoke(
92
+                      DispatcherPriority.Send,
93
+                      new Action(() => {
94
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_2.png"));
95
+                      }));
96
+                    break;
97
+                case 6:
98
+                    Dispatcher.Invoke(
99
+                      DispatcherPriority.Send,
100
+                      new Action(() => {
101
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_3.png"));
102
+                      }));
103
+                    break;
104
+                case 7:
105
+                    Dispatcher.Invoke(
106
+                      DispatcherPriority.Send,
107
+                      new Action(() => {
108
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_1.png"));
109
+                      }));
110
+                    break;
111
+                case 8:
112
+                    Dispatcher.Invoke(
113
+                      DispatcherPriority.Send,
114
+                      new Action(() => {
115
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_2.png"));
116
+                      }));
117
+                    break;
118
+                case 9:
119
+                    Dispatcher.Invoke(
120
+                      DispatcherPriority.Send,
121
+                      new Action(() => {
122
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_3.png"));
78
                       }));
123
                       }));
79
                     break;
124
                     break;
80
                 default:
125
                 default:

+ 20
- 18
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs View File

92
             FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Text);
92
             FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Text);
93
             APP.WKData.WkName = txbExplainName.Text;
93
             APP.WKData.WkName = txbExplainName.Text;
94
             APP.WKData.WkCreateDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
94
             APP.WKData.WkCreateDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
95
-            //判断微课是否存在,存在则询问
96
-            if (APP.WKDataList != null&& APP.WKDataList.Count>0)
97
-            {
98
-                if (APP.WKDataList.Exists(x => x.WkName == APP.WKData.WkName))
99
-                {
100
-                    MessageBoxResult dr = System.Windows.MessageBox.Show("此微课已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
101
-                    if (dr == MessageBoxResult.OK)
102
-                    {
103
-                        FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
104
-                        FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
105
-                        APP.WKDataList.RemoveAll(x => x.WkName == APP.WKData.WkName);
106
-                    }
107
-                    else
108
-                    {
109
-                        return;
110
-                    }
111
-                }
112
-            }
95
+            #region 微课不允许有多个视频 废弃
96
+            ////判断微课是否存在,存在则询问
97
+            //if (APP.WKDataList != null&& APP.WKDataList.Count>0)
98
+            //{
99
+            //    if (APP.WKDataList.Exists(x => x.WkName == APP.WKData.WkName))
100
+            //    {
101
+            //        MessageBoxResult dr = System.Windows.MessageBox.Show("此微课已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
102
+            //        if (dr == MessageBoxResult.OK)
103
+            //        {
104
+            //            FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
105
+            //            FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
106
+            //            APP.WKDataList.RemoveAll(x => x.WkName == APP.WKData.WkName);
107
+            //        }
108
+            //        else
109
+            //        {
110
+            //            return;
111
+            //        }
112
+            //    }
113
+            //}
114
+            #endregion
113
             if (APP.W_XHMicroLessonSystemWindow == null)
115
             if (APP.W_XHMicroLessonSystemWindow == null)
114
             {
116
             {
115
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
117
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();

+ 77
- 66
XHWK.WKTool/FileDirectoryWindow.xaml.cs View File

1
 using Common.system;
1
 using Common.system;
2
+
2
 using Org.BouncyCastle.Asn1.Crmf;
3
 using Org.BouncyCastle.Asn1.Crmf;
4
+
3
 using System;
5
 using System;
4
 using System.Collections.Generic;
6
 using System.Collections.Generic;
5
 using System.Collections.ObjectModel;
7
 using System.Collections.ObjectModel;
8
 using System.Windows.Controls;
10
 using System.Windows.Controls;
9
 using System.Windows.Input;
11
 using System.Windows.Input;
10
 using System.Windows.Media;
12
 using System.Windows.Media;
13
+
11
 using XHWK.Model;
14
 using XHWK.Model;
12
 using XHWK.WKTool.DAL;
15
 using XHWK.WKTool.DAL;
13
 
16
 
21
         /// <summary>
24
         /// <summary>
22
         /// 视频模型
25
         /// 视频模型
23
         /// </summary>
26
         /// </summary>
24
-        List<Model_Video> model_VideoList =null;
27
+        List<Model_Video> model_VideoList = null;
25
         /// <summary>
28
         /// <summary>
26
         /// 数据列表
29
         /// 数据列表
27
         /// </summary>
30
         /// </summary>
41
         {
44
         {
42
             InitializeComponent();
45
             InitializeComponent();
43
             Initialize();
46
             Initialize();
44
-        } 
47
+        }
45
         /// <summary>
48
         /// <summary>
46
         /// 初始化
49
         /// 初始化
47
         /// </summary>
50
         /// </summary>
71
                 //videoinfo.VidePath;
74
                 //videoinfo.VidePath;
72
 
75
 
73
                 string colour = "#FFFFFF";
76
                 string colour = "#FFFFFF";
74
-                if (isColour==true)
77
+                if (isColour == true)
75
                 {
78
                 {
76
                     colour = "#FFFFFF";
79
                     colour = "#FFFFFF";
77
                     isColour = false;
80
                     isColour = false;
83
                 }
86
                 }
84
                 string vis = "Visible";
87
                 string vis = "Visible";
85
                 string cos = "Collapsed";
88
                 string cos = "Collapsed";
86
-                if(!videoinfo.IsUpload)
89
+                if (!videoinfo.IsUpload)
87
                 {
90
                 {
88
-                    vis= "Collapsed";
89
-                    cos= "Visible";
91
+                    vis = "Collapsed";
92
+                    cos = "Visible";
90
                 }
93
                 }
91
                 pageData.menuList.Add(new FileDirectoryModel()
94
                 pageData.menuList.Add(new FileDirectoryModel()
92
                 {
95
                 {
104
                     Coll = cos,
107
                     Coll = cos,
105
                     FileGuid = videoinfo.FileGuid,
108
                     FileGuid = videoinfo.FileGuid,
106
                     VideoType = videoinfo.VideoType.ToString()
109
                     VideoType = videoinfo.VideoType.ToString()
107
-                }); ; 
110
+                }); ;
108
                 i++;
111
                 i++;
109
             }
112
             }
110
             txbSum.Text = pageData.menuList.Count.ToString();
113
             txbSum.Text = pageData.menuList.Count.ToString();
124
                         continue;
127
                         continue;
125
                     foreach (Model_Video videoinfo in Vdata.VideoList)
128
                     foreach (Model_Video videoinfo in Vdata.VideoList)
126
                     {
129
                     {
127
-                        if (!string.IsNullOrWhiteSpace(videoinfo.VideoPath))
130
+                        if (string.IsNullOrWhiteSpace(videoinfo.VideoPath))
128
                         {
131
                         {
129
-                            if (string.IsNullOrWhiteSpace(videoinfo.VideoSize) || videoinfo.VideoSize == "0 MB")
130
-                            {
131
-                                videoinfo.VideoSize = FileToolsCommon.GetFileSizeByMB(videoinfo.VideoPath).ToString() + " MB";
132
-                            }
133
-
134
-                            model_VideoList.Add(videoinfo);
132
+                            continue;
133
+                        }
134
+                        if (string.IsNullOrWhiteSpace(videoinfo.VideoSize) || videoinfo.VideoSize == "0 MB")
135
+                        {
136
+                            videoinfo.VideoSize = FileToolsCommon.GetFileSizeByMB(videoinfo.VideoPath).ToString() + " MB";
135
                         }
137
                         }
138
+                        model_VideoList.Add(videoinfo);
136
                     }
139
                     }
137
                 }
140
                 }
138
             }
141
             }
164
         /// </summary>
167
         /// </summary>
165
         /// <param name="sender"></param>
168
         /// <param name="sender"></param>
166
         /// <param name="e"></param>
169
         /// <param name="e"></param>
167
-        private void BtnUpload_Click(object sender, RoutedEventArgs e) 
170
+        private void BtnUpload_Click(object sender, RoutedEventArgs e)
168
         {
171
         {
169
             pageData.menuList[Subscript].IsEnabled = false;
172
             pageData.menuList[Subscript].IsEnabled = false;
170
             List<Button> buttons = FindChilds<Button>(listView1, "btnUpload");
173
             List<Button> buttons = FindChilds<Button>(listView1, "btnUpload");
187
                     {
190
                     {
188
                         MessageBox.Show(ErrMessage);
191
                         MessageBox.Show(ErrMessage);
189
                     }
192
                     }
190
-                    
193
+
191
 
194
 
192
                 }
195
                 }
193
             }
196
             }
209
                     {
212
                     {
210
                         if (wKData.VideoList == null)
213
                         if (wKData.VideoList == null)
211
                             continue;
214
                             continue;
212
-                        if(wKData.VideoList.Exists(x=>x.FileGuid==pageData.menuList[i].FileGuid))
215
+                        if (wKData.VideoList.Exists(x => x.FileGuid == pageData.menuList[i].FileGuid))
213
                         {
216
                         {
214
                             try
217
                             try
215
                             {
218
                             {
221
                             }
224
                             }
222
                             catch (Exception ex)
225
                             catch (Exception ex)
223
                             {
226
                             {
224
-                                MessageBox.Show("无法删除视频!"+ex.Message);
227
+                                MessageBox.Show("无法删除视频!" + ex.Message);
225
                                 return;
228
                                 return;
226
                             }
229
                             }
227
                         }
230
                         }
312
         /// <param name="e"></param>
315
         /// <param name="e"></param>
313
         private void BtnModify_Click(object sender, RoutedEventArgs e)
316
         private void BtnModify_Click(object sender, RoutedEventArgs e)
314
         {
317
         {
315
-            if(IsModify)
318
+            if (IsModify)
316
             {
319
             {
317
                 pageData.menuList[Subscript].IsEnabled = false;
320
                 pageData.menuList[Subscript].IsEnabled = false;
318
             }
321
             }
319
-
320
             List<Button> buttons = FindChilds<Button>(listView1, "btnModify");
322
             List<Button> buttons = FindChilds<Button>(listView1, "btnModify");
321
             for (int i = 0; i < buttons.Count; i++)
323
             for (int i = 0; i < buttons.Count; i++)
322
             {
324
             {
336
         /// <param name="e"></param>
338
         /// <param name="e"></param>
337
         private void Window_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
339
         private void Window_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
338
         {
340
         {
339
-            //if(IsModify)
341
+            //if (IsModify)
340
             //{
342
             //{
341
-            //    if(MouseNumber>0&& pageData.menuList.Count> Subscript)
343
+            //    if (MouseNumber > 0 && pageData.menuList.Count > Subscript)
342
             //    {
344
             //    {
343
             //        pageData.menuList[Subscript].IsEnabled = false;
345
             //        pageData.menuList[Subscript].IsEnabled = false;
344
             //        try
346
             //        try
345
             //        {
347
             //        {
346
-            //            if(!pageData.menuList[Subscript].Name.Equals(pageData.menuList[Subscript].VideoName))
348
+            //            if (!pageData.menuList[Subscript].Name.Equals(pageData.menuList[Subscript].VideoName))
347
             //            {
349
             //            {
348
-
349
             //                string tempPath = pageData.menuList[Subscript].VideoName + pageData.menuList[Subscript].VideoType;
350
             //                string tempPath = pageData.menuList[Subscript].VideoName + pageData.menuList[Subscript].VideoType;
350
             //                tempPath = pageData.menuList[Subscript].Path.Replace(tempPath, "").Trim();
351
             //                tempPath = pageData.menuList[Subscript].Path.Replace(tempPath, "").Trim();
351
             //                tempPath = tempPath + pageData.menuList[Subscript].Name;
352
             //                tempPath = tempPath + pageData.menuList[Subscript].Name;
352
-            //                FileToolsCommon.MoveDirectory(pageData.menuList[Subscript].Path, tempPath,out string Message);
353
+            //                FileToolsCommon.MoveDirectory(pageData.menuList[Subscript].Path, tempPath, out string Message);
353
             //            }
354
             //            }
354
             //        }
355
             //        }
355
             //        catch (Exception ex)
356
             //        catch (Exception ex)
364
 
365
 
365
         private void Window_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
366
         private void Window_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
366
         {
367
         {
367
-            //if (IsModify)
368
-            //{
369
-            //    if (MouseNumber > 2 && pageData.menuList.Count > Subscript)
368
+            //    if (IsModify)
370
             //    {
369
             //    {
371
-            //        pageData.menuList[Subscript].IsEnabled = false;
372
-            //        try
370
+            //        if (MouseNumber > 0 && pageData.menuList.Count > Subscript)
373
             //        {
371
             //        {
374
-            //            if (!pageData.menuList[Subscript].Name.Equals(pageData.menuList[Subscript].VideoName))
372
+            //        MouseNumber = 0;
373
+            //            pageData.menuList[Subscript].IsEnabled = false;
374
+            //            try
375
             //            {
375
             //            {
376
-            //                MouseNumber = 0;
377
-            //                string tempPath = pageData.menuList[Subscript].FilePath + pageData.menuList[Subscript].VideoName+"."+ pageData.menuList[Subscript].VideoType;
378
-            //                if(FileToolsCommon.IsExistFile(tempPath))
376
+            //                if (!pageData.menuList[Subscript].Name.Equals(pageData.menuList[Subscript].VideoName))
379
             //                {
377
             //                {
380
-            //                    MessageBox.Show("文件名已存在!");
381
-            //                    return;
382
-            //                }
383
-            //                foreach (Model_WKData wKData in APP.WKDataList)
384
-            //                {
385
-            //                    if (wKData.VideoList == null)
386
-            //                        continue;
387
-            //                    if (wKData.VideoList.Exists(x => x.FileGuid == pageData.menuList[Subscript].FileGuid))
378
+            //                    MouseNumber = 0;
379
+            //                    string tempPath = pageData.menuList[Subscript].FilePath + pageData.menuList[Subscript].VideoName + "." + pageData.menuList[Subscript].VideoType;
380
+            //                    if (FileToolsCommon.IsExistFile(tempPath))
388
             //                    {
381
             //                    {
389
-            //                        try
390
-            //                        {
391
-            //                            //FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[Subscript].FileGuid).VideoPath);
392
-            //                            //FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[Subscript].FileGuid).ThumbnailPath);
393
-            //                            //wKData.VideoList.Remove(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[Subscript].FileGuid));
394
-            //                            //Initialize();
395
-            //                            //return;
396
-            //                        }
397
-            //                        catch (Exception ex)
382
+            //                        MessageBox.Show("文件名已存在!");
383
+            //                        return;
384
+            //                    }
385
+            //                    foreach (Model_WKData wKData in APP.WKDataList)
386
+            //                    {
387
+            //                        if (wKData.VideoList == null)
388
+            //                            continue;
389
+            //                        if (wKData.VideoList.Exists(x => x.FileGuid == pageData.menuList[Subscript].FileGuid))
398
             //                        {
390
             //                        {
399
-            //                            MessageBox.Show("无法删除视频!" + ex.Message);
400
-            //                            return;
391
+            //                            try
392
+            //                            {
393
+            //                                //FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[Subscript].FileGuid).VideoPath);
394
+            //                                //FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[Subscript].FileGuid).ThumbnailPath);
395
+            //                                //wKData.VideoList.Remove(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[Subscript].FileGuid));
396
+            //                                //Initialize();
397
+            //                                //return;
398
+            //                            }
399
+            //                            catch (Exception ex)
400
+            //                            {
401
+            //                                MessageBox.Show("无法删除视频!" + ex.Message);
402
+            //                                return;
403
+            //                            }
401
             //                        }
404
             //                        }
402
             //                    }
405
             //                    }
406
+            //                    FileToolsCommon.Copy(pageData.menuList[Subscript].Path, tempPath);
403
             //                }
407
             //                }
404
-
405
-
406
-            //                FileToolsCommon.Copy(pageData.menuList[Subscript].Path, tempPath); 
408
+            //            }
409
+            //            catch (Exception ex)
410
+            //            {
411
+            //                MessageBox.Show("无法修改视频名称!" + ex.Message);
412
+            //                return;
407
             //            }
413
             //            }
408
             //        }
414
             //        }
409
-            //        catch (Exception ex)
410
-            //        {
411
-            //            MessageBox.Show("无法修改视频名称!" + ex.Message);
412
-            //            return;
413
-            //        }
415
+            //        MouseNumber++;
414
             //    }
416
             //    }
415
-            //    MouseNumber++;
416
-            //}
417
         }
417
         }
418
     }
418
     }
419
+
420
+    ///// <summary>
421
+    ///// 修改文件名
422
+    ///// </summary>
423
+    ///// <param name="Guid">唯一编号</param>
424
+    ///// <param name="NewName">文件名带后缀 不带路径</param>
425
+    ///// <returns></returns>
426
+    //bool ModifyPathName(string Guid,string NewName)
427
+    //{
428
+
429
+    //}
419
     public class FileDirectoryData : NotifyModel
430
     public class FileDirectoryData : NotifyModel
420
     {
431
     {
421
         public ObservableCollection<FileDirectoryModel> menuList { get; set; }
432
         public ObservableCollection<FileDirectoryModel> menuList { get; set; }
432
         /// <summary>
443
         /// <summary>
433
         /// 序号
444
         /// 序号
434
         /// </summary>
445
         /// </summary>
435
-        public int SerialNumber 
446
+        public int SerialNumber
436
         {
447
         {
437
             get => _serialNumber;
448
             get => _serialNumber;
438
             set
449
             set
493
                 OnPropertyChanged("VideoTime");
504
                 OnPropertyChanged("VideoTime");
494
             }
505
             }
495
         }
506
         }
496
-        private string _colour; 
507
+        private string _colour;
497
         /// <summary>
508
         /// <summary>
498
         /// 颜色
509
         /// 颜色
499
         /// </summary>
510
         /// </summary>
549
         /// <summary>
560
         /// <summary>
550
         /// 唯一编号
561
         /// 唯一编号
551
         /// </summary>
562
         /// </summary>
552
-        public string FileGuid { get; set; } 
563
+        public string FileGuid { get; set; }
553
         /// <summary>
564
         /// <summary>
554
         /// 视频类型
565
         /// 视频类型
555
         /// </summary>
566
         /// </summary>

BIN
XHWK.WKTool/Images/countdown.gif View File


BIN
XHWK.WKTool/Images/countdown1_1.png View File


BIN
XHWK.WKTool/Images/countdown1_2.png View File


BIN
XHWK.WKTool/Images/countdown1_3.png View File


BIN
XHWK.WKTool/Images/countdown2_1.png View File


BIN
XHWK.WKTool/Images/countdown2_2.png View File


BIN
XHWK.WKTool/Images/countdown2_3.png View File


BIN
XHWK.WKTool/Images/countdown3_1.png View File


BIN
XHWK.WKTool/Images/countdown3_2.png View File


BIN
XHWK.WKTool/Images/countdown3_3.png View File


BIN
XHWK.WKTool/Images/countdown_1.png View File


BIN
XHWK.WKTool/Images/countdown_2.png View File


BIN
XHWK.WKTool/Images/countdown_3.png View File


+ 23
- 21
XHWK.WKTool/LoginWindow.xaml.cs View File

107
                 //读取微课数据
107
                 //读取微课数据
108
                 APP.ReadWkData();
108
                 APP.ReadWkData();
109
                 APP.ReadDrawData();
109
                 APP.ReadDrawData();
110
-                APP.WKData.WkPath += APP.UserInfo.Username + "/";
111
-                //判断微课是否存在,存在则询问
112
-                if (APP.WKDataList != null)
113
-                {
114
-                    if(APP.WKDataList.Exists(x => x.WkName == APP.WKData.WkName))
115
-                    {
116
-                        MessageBoxResult dr = System.Windows.MessageBox.Show("此微课已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
117
-                        if (dr == MessageBoxResult.OK)
118
-                        {
119
-                            FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
120
-                            FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
121
-                            APP.WKDataList.RemoveAll(x => x.WkName == APP.WKData.WkName);
122
-                        }
123
-                        else
124
-                        {
125
-                            APP.W_CreateAMicroLessonWindow.Owner = this;
126
-                            //APP.W_CreateAMicroLessonWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
127
-                            APP.W_CreateAMicroLessonWindow.ShowDialog();
128
-                        }
129
-                    }
130
-                }
110
+                #region 登陆后 根据用户名设置微课路径 废弃
111
+                //APP.WKData.WkPath += APP.UserInfo.Username + "/";
112
+                ////判断微课是否存在,存在则询问
113
+                //if (APP.WKDataList != null)
114
+                //{
115
+                //    if(APP.WKDataList.Exists(x => x.WkName == APP.WKData.WkName))
116
+                //    {
117
+                //        MessageBoxResult dr = System.Windows.MessageBox.Show("此微课已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
118
+                //        if (dr == MessageBoxResult.OK)
119
+                //        {
120
+                //            FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
121
+                //            FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
122
+                //            APP.WKDataList.RemoveAll(x => x.WkName == APP.WKData.WkName);
123
+                //        }
124
+                //        else
125
+                //        {
126
+                //            APP.W_CreateAMicroLessonWindow.Owner = this;
127
+                //            //APP.W_CreateAMicroLessonWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
128
+                //            APP.W_CreateAMicroLessonWindow.ShowDialog();
129
+                //        }
130
+                //    }
131
+                //}
132
+                #endregion
131
                 this.Hide();
133
                 this.Hide();
132
             }
134
             }
133
             else
135
             else

+ 18
- 9
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs View File

20
     {
20
     {
21
         #region 初始变量
21
         #region 初始变量
22
         /// <summary>
22
         /// <summary>
23
-        /// 视频存储路径
24
-        /// </summary>
25
-        string RecordingPath;
26
-        /// <summary>
27
         /// 视频保存名称
23
         /// 视频保存名称
28
         /// </summary>
24
         /// </summary>
29
         string VideoSavePathName;
25
         string VideoSavePathName;
158
         {
154
         {
159
             _state = State.End;
155
             _state = State.End;
160
         }
156
         }
161
-        #region 录制
157
+        #region 录屏
158
+        /// <summary>
159
+        /// 设置录屏文件地址
160
+        /// </summary>
161
+        void SetUpVideoPathName()
162
+        {
163
+            //FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
164
+            FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
165
+            FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
166
+            VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
167
+            int num = 1;
168
+            while(FileToolsCommon.IsExistFile(VideoSavePathName))
169
+            {
170
+                VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_"+ num + "." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
171
+                num++;
172
+            }
173
+        }
162
         /// <summary>
174
         /// <summary>
163
         /// 开始或暂停录制
175
         /// 开始或暂停录制
164
         /// </summary>
176
         /// </summary>
174
                     VideoInfo = new Model_Video();
186
                     VideoInfo = new Model_Video();
175
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
187
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
176
                     VideoInfo.WkType = Enum_WKVidetype.RecordingScreen;
188
                     VideoInfo.WkType = Enum_WKVidetype.RecordingScreen;
177
-                    RecordingPath = APP.WKData.WkPath;
178
-                    //FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
179
-                    FileToolsCommon.CreateDirectory(RecordingPath);
180
-                    VideoSavePathName = RecordingPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
189
+                    SetUpVideoPathName();
181
                     IsFirstRS = false;
190
                     IsFirstRS = false;
182
                 }
191
                 }
183
                 IsSuspend = false;
192
                 IsSuspend = false;

+ 64
- 50
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

263
         /// <param name="e"></param>
263
         /// <param name="e"></param>
264
         private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
264
         private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
265
         {
265
         {
266
-            string RecordScreenPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
267
-            if (FileToolsCommon.IsExistFile(RecordScreenPathName))
268
-            {
269
-                MessageBoxResult dr = System.Windows.MessageBox.Show("已存在录屏,是否覆盖?", "提示", MessageBoxButton.OKCancel);
270
-                if (dr == MessageBoxResult.OK)
271
-                {
272
-                    try
273
-                    {
274
-                        FileToolsCommon.DeleteFile(RecordScreenPathName);
275
-                        APP.VideoList.RemoveAll(x => x.VideoPath == RecordScreenPathName);
276
-                    }
277
-                    catch (Exception ex)
278
-                    {
279
-                        LogHelper.WriteErrLog("【录屏】(BtnRecordingScreen_Click)无法移除视频," + ex.Message, ex);
280
-                    }
281
-                }
282
-                else
283
-                {
284
-                    return;
285
-                }
286
-            }
266
+            #region 限制只允许录制一个录屏  废弃
267
+            //string RecordScreenPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
268
+            //if (FileToolsCommon.IsExistFile(RecordScreenPathName))
269
+            //{
270
+            //    MessageBoxResult dr = System.Windows.MessageBox.Show("已存在录屏,是否覆盖?", "提示", MessageBoxButton.OKCancel);
271
+            //    if (dr == MessageBoxResult.OK)
272
+            //    {
273
+            //        try
274
+            //        {
275
+            //            FileToolsCommon.DeleteFile(RecordScreenPathName);
276
+            //            APP.VideoList.RemoveAll(x => x.VideoPath == RecordScreenPathName);
277
+            //        }
278
+            //        catch (Exception ex)
279
+            //        {
280
+            //            LogHelper.WriteErrLog("【录屏】(BtnRecordingScreen_Click)无法移除视频," + ex.Message, ex);
281
+            //        }
282
+            //    }
283
+            //    else
284
+            //    {
285
+            //        return;
286
+            //    }
287
+            //}
288
+            #endregion   
287
             if (APP.W_ScreenRecordingToolbarWindow == null)
289
             if (APP.W_ScreenRecordingToolbarWindow == null)
288
             {
290
             {
289
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
291
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
304
             APP.W_ScreenRecordingToolbarWindow.Topmost = true;
306
             APP.W_ScreenRecordingToolbarWindow.Topmost = true;
305
             APP.W_ScreenRecordingToolbarWindow.Show();
307
             APP.W_ScreenRecordingToolbarWindow.Show();
306
             Hide();
308
             Hide();
307
-            TxbRecordScreenWord.Text = "录屏";
309
+            TxbRecordScreenWord.Text = "录屏";
308
         }
310
         }
309
         /// <summary>
311
         /// <summary>
310
         /// 上传事件
312
         /// 上传事件
373
         /// <param name="e"></param>
375
         /// <param name="e"></param>
374
         private void BtnSave_Click(object sender, RoutedEventArgs e)
376
         private void BtnSave_Click(object sender, RoutedEventArgs e)
375
         {
377
         {
376
-            //#region 合法性判断
378
+            #region 合法性判断
377
             //if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
379
             //if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
378
             //{
380
             //{
379
             //    System.Windows.MessageBox.Show("路径不可为空!");
381
             //    System.Windows.MessageBox.Show("路径不可为空!");
399
             //    //创建文件夹
401
             //    //创建文件夹
400
             //    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
402
             //    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
401
             //}
403
             //}
402
-            //#endregion
403
-
404
+            #endregion
404
 
405
 
405
             if (rbnMP4.IsChecked == true)
406
             if (rbnMP4.IsChecked == true)
406
             {
407
             {
982
         /// <summary>
983
         /// <summary>
983
         /// 视频保存路径
984
         /// 视频保存路径
984
         /// </summary>
985
         /// </summary>
985
-        string RecordingPath;
986
+        //string RecordingPath;
986
         /// <summary>
987
         /// <summary>
987
         /// 图片保存路径
988
         /// 图片保存路径
988
         /// </summary>
989
         /// </summary>
1019
         /// <param name="e"></param>
1020
         /// <param name="e"></param>
1020
         private void BtnRecord_Click(object sender, RoutedEventArgs e)
1021
         private void BtnRecord_Click(object sender, RoutedEventArgs e)
1021
         {
1022
         {
1022
-
1023
             blackboard_canvas.Visibility = Visibility.Visible;
1023
             blackboard_canvas.Visibility = Visibility.Visible;
1024
             StartRecord();
1024
             StartRecord();
1025
         }
1025
         }
1034
             EndRecord();
1034
             EndRecord();
1035
         }
1035
         }
1036
         System.Timers.Timer timer;
1036
         System.Timers.Timer timer;
1037
+
1038
+        /// <summary>
1039
+        /// 设置录屏文件地址
1040
+        /// </summary>
1041
+        void SetUpVideoPathName()
1042
+        {
1043
+        }
1037
         /// <summary>
1044
         /// <summary>
1038
         /// 开始录制和暂停录制
1045
         /// 开始录制和暂停录制
1039
         /// </summary>
1046
         /// </summary>
1046
                     VideoInfo = new Model_Video();
1053
                     VideoInfo = new Model_Video();
1047
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
1054
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
1048
                     VideoInfo.WkType = Enum_WKVidetype.RecordingLessons;
1055
                     VideoInfo.WkType = Enum_WKVidetype.RecordingLessons;
1049
-                    RecordingPath = APP.WKData.WkPath;
1056
+
1050
                     ImgPath = APP.WKData.WkPath + "temp/Image/";
1057
                     ImgPath = APP.WKData.WkPath + "temp/Image/";
1051
                     AudioPathName = APP.WKData.WkPath + "temp/audio/";
1058
                     AudioPathName = APP.WKData.WkPath + "temp/audio/";
1052
                     FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
1059
                     FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
1053
-                    FileToolsCommon.CreateDirectory(RecordingPath);
1060
+                    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
1054
                     FileToolsCommon.CreateDirectory(ImgPath);
1061
                     FileToolsCommon.CreateDirectory(ImgPath);
1055
                     FileToolsCommon.CreateDirectory(AudioPathName);
1062
                     FileToolsCommon.CreateDirectory(AudioPathName);
1056
                     AudioPathName += APP.WKData.WkName + ".MP3";
1063
                     AudioPathName += APP.WKData.WkName + ".MP3";
1057
-                    VideoSavePathName = RecordingPath + APP.WKData.WkName + "_录制." + VideoInfo.VideoType.ToString();
1058
-
1059
-                    if (FileToolsCommon.IsExistFile(VideoSavePathName))
1064
+                    VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制." + VideoInfo.VideoType.ToString();
1065
+                    int num = 1;
1066
+                    while (FileToolsCommon.IsExistFile(VideoSavePathName))
1060
                     {
1067
                     {
1061
-                        MessageBoxResult dr = System.Windows.MessageBox.Show("课程已录制,是否覆盖?", "提示", MessageBoxButton.OKCancel);
1062
-                        if (dr == MessageBoxResult.OK)
1063
-                        {
1064
-                            try
1065
-                            {
1066
-                                FileToolsCommon.DeleteFile(VideoSavePathName);
1067
-                                APP.VideoList.RemoveAll(x => x.VideoPath == VideoSavePathName);
1068
-                            }
1069
-                            catch (Exception ex)
1070
-                            {
1071
-                                LogHelper.WriteErrLog("【录制】(StartRecord)无法移除视频," + ex.Message, ex);
1072
-                            }
1073
-                        }
1074
-                        else
1075
-                        {
1076
-                            return;
1077
-                        }
1068
+                        VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制_" + num + "." + VideoInfo.VideoType.ToString();
1069
+                        num++;
1078
                     }
1070
                     }
1079
 
1071
 
1072
+                    #region 设置录屏唯一  废弃
1073
+                    //if (FileToolsCommon.IsExistFile(VideoSavePathName))
1074
+                    //{
1075
+                    //    MessageBoxResult dr = System.Windows.MessageBox.Show("课程已录制,是否覆盖?", "提示", MessageBoxButton.OKCancel);
1076
+                    //    if (dr == MessageBoxResult.OK)
1077
+                    //    {
1078
+                    //        try
1079
+                    //        {
1080
+                    //            FileToolsCommon.DeleteFile(VideoSavePathName);
1081
+                    //            APP.VideoList.RemoveAll(x => x.VideoPath == VideoSavePathName);
1082
+                    //        }
1083
+                    //        catch (Exception ex)
1084
+                    //        {
1085
+                    //            LogHelper.WriteErrLog("【录制】(StartRecord)无法移除视频," + ex.Message, ex);
1086
+                    //        }
1087
+                    //    }
1088
+                    //    else
1089
+                    //    {
1090
+                    //        return;
1091
+                    //    }
1092
+                    //}
1093
+                    #endregion
1094
+
1080
                     #region 禁用按钮
1095
                     #region 禁用按钮
1081
                     ImgPrint.Visibility = Visibility.Collapsed;//录制中不可打印
1096
                     ImgPrint.Visibility = Visibility.Collapsed;//录制中不可打印
1082
                     ImgPrintTwo.Visibility = Visibility.Visible;
1097
                     ImgPrintTwo.Visibility = Visibility.Visible;
1406
 
1421
 
1407
             //}
1422
             //}
1408
         }
1423
         }
1409
-        /// <summary>
1410
         /// 上一页
1424
         /// 上一页
1411
         /// </summary>
1425
         /// </summary>
1412
         /// <param name="sender"></param>
1426
         /// <param name="sender"></param>

+ 11
- 12
XHWK.WKTool/XHWK.WKTool.csproj View File

1298
     <Resource Include="Images\microLessonSystem_8.png" />
1298
     <Resource Include="Images\microLessonSystem_8.png" />
1299
     <Resource Include="Images\microLessonSystem_9.png" />
1299
     <Resource Include="Images\microLessonSystem_9.png" />
1300
   </ItemGroup>
1300
   </ItemGroup>
1301
-  <ItemGroup>
1302
-    <Resource Include="Images\countdown.gif" />
1303
-  </ItemGroup>
1304
-  <ItemGroup>
1305
-    <Resource Include="Images\countdown_2.png" />
1306
-  </ItemGroup>
1307
-  <ItemGroup>
1308
-    <Resource Include="Images\countdown_3.png" />
1309
-  </ItemGroup>
1310
-  <ItemGroup>
1311
-    <Resource Include="Images\countdown_1.png" />
1312
-  </ItemGroup>
1313
   <ItemGroup>
1301
   <ItemGroup>
1314
     <Resource Include="Images\Toobar0.png" />
1302
     <Resource Include="Images\Toobar0.png" />
1315
     <Resource Include="Images\Toobar1.png" />
1303
     <Resource Include="Images\Toobar1.png" />
1497
   <ItemGroup>
1485
   <ItemGroup>
1498
     <Resource Include="256.ico" />
1486
     <Resource Include="256.ico" />
1499
   </ItemGroup>
1487
   </ItemGroup>
1488
+  <ItemGroup>
1489
+    <Resource Include="Images\countdown1_1.png" />
1490
+    <Resource Include="Images\countdown1_2.png" />
1491
+    <Resource Include="Images\countdown1_3.png" />
1492
+    <Resource Include="Images\countdown2_1.png" />
1493
+    <Resource Include="Images\countdown2_2.png" />
1494
+    <Resource Include="Images\countdown2_3.png" />
1495
+    <Resource Include="Images\countdown3_1.png" />
1496
+    <Resource Include="Images\countdown3_2.png" />
1497
+    <Resource Include="Images\countdown3_3.png" />
1498
+  </ItemGroup>
1500
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1499
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1501
 </Project>
1500
 </Project>

Loading…
Cancel
Save