Przeglądaj źródła

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

# Conflicts:
#	XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs
tags/录制修改前
zhangxueyang 4 lat temu
rodzic
commit
ce179b1f5d

+ 1
- 0
Common/system/ImageHelper.cs Wyświetl plik

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

+ 55
- 10
XHWK.WKTool/CountdownWindow.xaml.cs Wyświetl plik

@@ -24,12 +24,12 @@ namespace XHWK.WKTool
24 24
         /// 计时器
25 25
         /// </summary>
26 26
         System.Timers.Timer timer;
27
-        int ImgNum = 3;
27
+        int ImgNum = 9;
28 28
         public void Initialize(int changeTime=650)
29 29
         {
30
-            timer.Interval = changeTime;
30
+            timer.Interval = changeTime/3;
31 31
             timer.Enabled = true; //启动计时器
32
-            ImgNum = 3;
32
+            ImgNum = 9;
33 33
         }
34 34
 
35 35
         private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
@@ -42,10 +42,13 @@ namespace XHWK.WKTool
42 42
             else
43 43
             {
44 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 54
         /// <summary>
@@ -60,21 +63,63 @@ namespace XHWK.WKTool
60 63
                     Dispatcher.Invoke(
61 64
                       DispatcherPriority.Send,
62 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 68
                     break;
66 69
                 case 2:
67 70
                     Dispatcher.Invoke(
68 71
                       DispatcherPriority.Send,
69 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 75
                     break;
73 76
                 case 3:
74 77
                     Dispatcher.Invoke(
75 78
                       DispatcherPriority.Send,
76 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 124
                     break;
80 125
                 default:

+ 20
- 18
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs Wyświetl plik

@@ -92,24 +92,26 @@ namespace XHWK.WKTool
92 92
             FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Text);
93 93
             APP.WKData.WkName = txbExplainName.Text;
94 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 115
             if (APP.W_XHMicroLessonSystemWindow == null)
114 116
             {
115 117
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();

+ 77
- 66
XHWK.WKTool/FileDirectoryWindow.xaml.cs Wyświetl plik

@@ -1,5 +1,7 @@
1 1
 using Common.system;
2
+
2 3
 using Org.BouncyCastle.Asn1.Crmf;
4
+
3 5
 using System;
4 6
 using System.Collections.Generic;
5 7
 using System.Collections.ObjectModel;
@@ -8,6 +10,7 @@ using System.Windows;
8 10
 using System.Windows.Controls;
9 11
 using System.Windows.Input;
10 12
 using System.Windows.Media;
13
+
11 14
 using XHWK.Model;
12 15
 using XHWK.WKTool.DAL;
13 16
 
@@ -21,7 +24,7 @@ namespace XHWK.WKTool
21 24
         /// <summary>
22 25
         /// 视频模型
23 26
         /// </summary>
24
-        List<Model_Video> model_VideoList =null;
27
+        List<Model_Video> model_VideoList = null;
25 28
         /// <summary>
26 29
         /// 数据列表
27 30
         /// </summary>
@@ -41,7 +44,7 @@ namespace XHWK.WKTool
41 44
         {
42 45
             InitializeComponent();
43 46
             Initialize();
44
-        } 
47
+        }
45 48
         /// <summary>
46 49
         /// 初始化
47 50
         /// </summary>
@@ -71,7 +74,7 @@ namespace XHWK.WKTool
71 74
                 //videoinfo.VidePath;
72 75
 
73 76
                 string colour = "#FFFFFF";
74
-                if (isColour==true)
77
+                if (isColour == true)
75 78
                 {
76 79
                     colour = "#FFFFFF";
77 80
                     isColour = false;
@@ -83,10 +86,10 @@ namespace XHWK.WKTool
83 86
                 }
84 87
                 string vis = "Visible";
85 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 94
                 pageData.menuList.Add(new FileDirectoryModel()
92 95
                 {
@@ -104,7 +107,7 @@ namespace XHWK.WKTool
104 107
                     Coll = cos,
105 108
                     FileGuid = videoinfo.FileGuid,
106 109
                     VideoType = videoinfo.VideoType.ToString()
107
-                }); ; 
110
+                }); ;
108 111
                 i++;
109 112
             }
110 113
             txbSum.Text = pageData.menuList.Count.ToString();
@@ -124,15 +127,15 @@ namespace XHWK.WKTool
124 127
                         continue;
125 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,7 +167,7 @@ namespace XHWK.WKTool
164 167
         /// </summary>
165 168
         /// <param name="sender"></param>
166 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 172
             pageData.menuList[Subscript].IsEnabled = false;
170 173
             List<Button> buttons = FindChilds<Button>(listView1, "btnUpload");
@@ -187,7 +190,7 @@ namespace XHWK.WKTool
187 190
                     {
188 191
                         MessageBox.Show(ErrMessage);
189 192
                     }
190
-                    
193
+
191 194
 
192 195
                 }
193 196
             }
@@ -209,7 +212,7 @@ namespace XHWK.WKTool
209 212
                     {
210 213
                         if (wKData.VideoList == null)
211 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 217
                             try
215 218
                             {
@@ -221,7 +224,7 @@ namespace XHWK.WKTool
221 224
                             }
222 225
                             catch (Exception ex)
223 226
                             {
224
-                                MessageBox.Show("无法删除视频!"+ex.Message);
227
+                                MessageBox.Show("无法删除视频!" + ex.Message);
225 228
                                 return;
226 229
                             }
227 230
                         }
@@ -312,11 +315,10 @@ namespace XHWK.WKTool
312 315
         /// <param name="e"></param>
313 316
         private void BtnModify_Click(object sender, RoutedEventArgs e)
314 317
         {
315
-            if(IsModify)
318
+            if (IsModify)
316 319
             {
317 320
                 pageData.menuList[Subscript].IsEnabled = false;
318 321
             }
319
-
320 322
             List<Button> buttons = FindChilds<Button>(listView1, "btnModify");
321 323
             for (int i = 0; i < buttons.Count; i++)
322 324
             {
@@ -336,20 +338,19 @@ namespace XHWK.WKTool
336 338
         /// <param name="e"></param>
337 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 345
             //        pageData.menuList[Subscript].IsEnabled = false;
344 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 350
             //                string tempPath = pageData.menuList[Subscript].VideoName + pageData.menuList[Subscript].VideoType;
350 351
             //                tempPath = pageData.menuList[Subscript].Path.Replace(tempPath, "").Trim();
351 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 356
             //        catch (Exception ex)
@@ -364,58 +365,68 @@ namespace XHWK.WKTool
364 365
 
365 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 430
     public class FileDirectoryData : NotifyModel
420 431
     {
421 432
         public ObservableCollection<FileDirectoryModel> menuList { get; set; }
@@ -432,7 +443,7 @@ namespace XHWK.WKTool
432 443
         /// <summary>
433 444
         /// 序号
434 445
         /// </summary>
435
-        public int SerialNumber 
446
+        public int SerialNumber
436 447
         {
437 448
             get => _serialNumber;
438 449
             set
@@ -493,7 +504,7 @@ namespace XHWK.WKTool
493 504
                 OnPropertyChanged("VideoTime");
494 505
             }
495 506
         }
496
-        private string _colour; 
507
+        private string _colour;
497 508
         /// <summary>
498 509
         /// 颜色
499 510
         /// </summary>
@@ -549,7 +560,7 @@ namespace XHWK.WKTool
549 560
         /// <summary>
550 561
         /// 唯一编号
551 562
         /// </summary>
552
-        public string FileGuid { get; set; } 
563
+        public string FileGuid { get; set; }
553 564
         /// <summary>
554 565
         /// 视频类型
555 566
         /// </summary>

BIN
XHWK.WKTool/Images/countdown.gif Wyświetl plik


BIN
XHWK.WKTool/Images/countdown1_1.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown1_2.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown1_3.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown2_1.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown2_2.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown2_3.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown3_1.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown3_2.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown3_3.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown_1.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown_2.png Wyświetl plik


BIN
XHWK.WKTool/Images/countdown_3.png Wyświetl plik


+ 23
- 21
XHWK.WKTool/LoginWindow.xaml.cs Wyświetl plik

@@ -107,27 +107,29 @@ namespace XHWK.WKTool
107 107
                 //读取微课数据
108 108
                 APP.ReadWkData();
109 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 133
                 this.Hide();
132 134
             }
133 135
             else

+ 18
- 9
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs Wyświetl plik

@@ -20,10 +20,6 @@ namespace XHWK.WKTool
20 20
     {
21 21
         #region 初始变量
22 22
         /// <summary>
23
-        /// 视频存储路径
24
-        /// </summary>
25
-        string RecordingPath;
26
-        /// <summary>
27 23
         /// 视频保存名称
28 24
         /// </summary>
29 25
         string VideoSavePathName;
@@ -158,7 +154,23 @@ namespace XHWK.WKTool
158 154
         {
159 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 174
         /// <summary>
163 175
         /// 开始或暂停录制
164 176
         /// </summary>
@@ -174,10 +186,7 @@ namespace XHWK.WKTool
174 186
                     VideoInfo = new Model_Video();
175 187
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
176 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 190
                     IsFirstRS = false;
182 191
                 }
183 192
                 IsSuspend = false;

+ 64
- 50
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Wyświetl plik

@@ -263,27 +263,29 @@ namespace XHWK.WKTool
263 263
         /// <param name="e"></param>
264 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 289
             if (APP.W_ScreenRecordingToolbarWindow == null)
288 290
             {
289 291
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
@@ -304,7 +306,7 @@ namespace XHWK.WKTool
304 306
             APP.W_ScreenRecordingToolbarWindow.Topmost = true;
305 307
             APP.W_ScreenRecordingToolbarWindow.Show();
306 308
             Hide();
307
-            TxbRecordScreenWord.Text = "录屏";
309
+            TxbRecordScreenWord.Text = "录屏";
308 310
         }
309 311
         /// <summary>
310 312
         /// 上传事件
@@ -373,7 +375,7 @@ namespace XHWK.WKTool
373 375
         /// <param name="e"></param>
374 376
         private void BtnSave_Click(object sender, RoutedEventArgs e)
375 377
         {
376
-            //#region 合法性判断
378
+            #region 合法性判断
377 379
             //if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
378 380
             //{
379 381
             //    System.Windows.MessageBox.Show("路径不可为空!");
@@ -399,8 +401,7 @@ namespace XHWK.WKTool
399 401
             //    //创建文件夹
400 402
             //    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
401 403
             //}
402
-            //#endregion
403
-
404
+            #endregion
404 405
 
405 406
             if (rbnMP4.IsChecked == true)
406 407
             {
@@ -982,7 +983,7 @@ namespace XHWK.WKTool
982 983
         /// <summary>
983 984
         /// 视频保存路径
984 985
         /// </summary>
985
-        string RecordingPath;
986
+        //string RecordingPath;
986 987
         /// <summary>
987 988
         /// 图片保存路径
988 989
         /// </summary>
@@ -1019,7 +1020,6 @@ namespace XHWK.WKTool
1019 1020
         /// <param name="e"></param>
1020 1021
         private void BtnRecord_Click(object sender, RoutedEventArgs e)
1021 1022
         {
1022
-
1023 1023
             blackboard_canvas.Visibility = Visibility.Visible;
1024 1024
             StartRecord();
1025 1025
         }
@@ -1034,6 +1034,13 @@ namespace XHWK.WKTool
1034 1034
             EndRecord();
1035 1035
         }
1036 1036
         System.Timers.Timer timer;
1037
+
1038
+        /// <summary>
1039
+        /// 设置录屏文件地址
1040
+        /// </summary>
1041
+        void SetUpVideoPathName()
1042
+        {
1043
+        }
1037 1044
         /// <summary>
1038 1045
         /// 开始录制和暂停录制
1039 1046
         /// </summary>
@@ -1046,37 +1053,45 @@ namespace XHWK.WKTool
1046 1053
                     VideoInfo = new Model_Video();
1047 1054
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
1048 1055
                     VideoInfo.WkType = Enum_WKVidetype.RecordingLessons;
1049
-                    RecordingPath = APP.WKData.WkPath;
1056
+
1050 1057
                     ImgPath = APP.WKData.WkPath + "temp/Image/";
1051 1058
                     AudioPathName = APP.WKData.WkPath + "temp/audio/";
1052 1059
                     FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
1053
-                    FileToolsCommon.CreateDirectory(RecordingPath);
1060
+                    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
1054 1061
                     FileToolsCommon.CreateDirectory(ImgPath);
1055 1062
                     FileToolsCommon.CreateDirectory(AudioPathName);
1056 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 1095
                     #region 禁用按钮
1081 1096
                     ImgPrint.Visibility = Visibility.Collapsed;//录制中不可打印
1082 1097
                     ImgPrintTwo.Visibility = Visibility.Visible;
@@ -1406,7 +1421,6 @@ namespace XHWK.WKTool
1406 1421
 
1407 1422
             //}
1408 1423
         }
1409
-        /// <summary>
1410 1424
         /// 上一页
1411 1425
         /// </summary>
1412 1426
         /// <param name="sender"></param>

+ 11
- 12
XHWK.WKTool/XHWK.WKTool.csproj Wyświetl plik

@@ -1298,18 +1298,6 @@
1298 1298
     <Resource Include="Images\microLessonSystem_8.png" />
1299 1299
     <Resource Include="Images\microLessonSystem_9.png" />
1300 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 1301
   <ItemGroup>
1314 1302
     <Resource Include="Images\Toobar0.png" />
1315 1303
     <Resource Include="Images\Toobar1.png" />
@@ -1497,5 +1485,16 @@
1497 1485
   <ItemGroup>
1498 1486
     <Resource Include="256.ico" />
1499 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 1499
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1501 1500
 </Project>

Ładowanie…
Anuluj
Zapisz