Quellcode durchsuchen

zhao:1去除登陆限制2去除视频唯一限制3去除微课用户文件夹4修改视频开始等待图片

tags/录制修改前
耀 vor 4 Jahren
Ursprung
Commit
27e339c276

+ 1
- 0
Common/system/ImageHelper.cs Datei anzeigen

@@ -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日

+ 48
- 6
XHWK.WKTool/CountdownWindow.xaml.cs Datei anzeigen

@@ -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)
@@ -60,21 +60,63 @@ namespace XHWK.WKTool
60 60
                     Dispatcher.Invoke(
61 61
                       DispatcherPriority.Send,
62 62
                       new Action(() => { 
63
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown_1.png"));
63
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_1.png"));
64 64
                       }));
65 65
                     break;
66 66
                 case 2:
67 67
                     Dispatcher.Invoke(
68 68
                       DispatcherPriority.Send,
69 69
                       new Action(() => {
70
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown_2.png"));
70
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_2.png"));
71 71
                       }));
72 72
                     break;
73 73
                 case 3:
74 74
                     Dispatcher.Invoke(
75 75
                       DispatcherPriority.Send,
76 76
                       new Action(() => {
77
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown_3.png"));
77
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_3.png"));
78
+                      }));
79
+                    break;
80
+                case 4:
81
+                    Dispatcher.Invoke(
82
+                      DispatcherPriority.Send,
83
+                      new Action(() => {
84
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_1.png"));
85
+                      }));
86
+                    break;
87
+                case 5:
88
+                    Dispatcher.Invoke(
89
+                      DispatcherPriority.Send,
90
+                      new Action(() => {
91
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_2.png"));
92
+                      }));
93
+                    break;
94
+                case 6:
95
+                    Dispatcher.Invoke(
96
+                      DispatcherPriority.Send,
97
+                      new Action(() => {
98
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_3.png"));
99
+                      }));
100
+                    break;
101
+                case 7:
102
+                    Dispatcher.Invoke(
103
+                      DispatcherPriority.Send,
104
+                      new Action(() => {
105
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_1.png"));
106
+                      }));
107
+                    break;
108
+                case 8:
109
+                    Dispatcher.Invoke(
110
+                      DispatcherPriority.Send,
111
+                      new Action(() => {
112
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_2.png"));
113
+                      }));
114
+                    break;
115
+                case 9:
116
+                    Dispatcher.Invoke(
117
+                      DispatcherPriority.Send,
118
+                      new Action(() => {
119
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_3.png"));
78 120
                       }));
79 121
                     break;
80 122
                 default:

+ 20
- 18
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs Datei anzeigen

@@ -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();

+ 70
- 59
XHWK.WKTool/FileDirectoryWindow.xaml.cs Datei anzeigen

@@ -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();
@@ -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))
379
-            //                {
380
-            //                    MessageBox.Show("文件名已存在!");
381
-            //                    return;
382
-            //                }
383
-            //                foreach (Model_WKData wKData in APP.WKDataList)
376
+            //                if (!pageData.menuList[Subscript].Name.Equals(pageData.menuList[Subscript].VideoName))
384 377
             //                {
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 Datei anzeigen


BIN
XHWK.WKTool/Images/countdown1_1.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown1_2.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown1_3.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown2_1.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown2_2.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown2_3.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown3_1.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown3_2.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown3_3.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown_1.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown_2.png Datei anzeigen


BIN
XHWK.WKTool/Images/countdown_3.png Datei anzeigen


+ 23
- 21
XHWK.WKTool/LoginWindow.xaml.cs Datei anzeigen

@@ -87,27 +87,29 @@ namespace XHWK.WKTool
87 87
                 //读取微课数据
88 88
                 APP.ReadWkData();
89 89
                 APP.ReadDrawData();
90
-                APP.WKData.WkPath += APP.UserInfo.Username + "/";
91
-                //判断微课是否存在,存在则询问
92
-                if (APP.WKDataList != null)
93
-                {
94
-                    if(APP.WKDataList.Exists(x => x.WkName == APP.WKData.WkName))
95
-                    {
96
-                        MessageBoxResult dr = System.Windows.MessageBox.Show("此微课已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
97
-                        if (dr == MessageBoxResult.OK)
98
-                        {
99
-                            FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
100
-                            FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
101
-                            APP.WKDataList.RemoveAll(x => x.WkName == APP.WKData.WkName);
102
-                        }
103
-                        else
104
-                        {
105
-                            APP.W_CreateAMicroLessonWindow.Owner = this;
106
-                            //APP.W_CreateAMicroLessonWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
107
-                            APP.W_CreateAMicroLessonWindow.ShowDialog();
108
-                        }
109
-                    }
110
-                }
90
+                #region 登陆后 根据用户名设置微课路径 废弃
91
+                //APP.WKData.WkPath += APP.UserInfo.Username + "/";
92
+                ////判断微课是否存在,存在则询问
93
+                //if (APP.WKDataList != null)
94
+                //{
95
+                //    if(APP.WKDataList.Exists(x => x.WkName == APP.WKData.WkName))
96
+                //    {
97
+                //        MessageBoxResult dr = System.Windows.MessageBox.Show("此微课已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
98
+                //        if (dr == MessageBoxResult.OK)
99
+                //        {
100
+                //            FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
101
+                //            FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
102
+                //            APP.WKDataList.RemoveAll(x => x.WkName == APP.WKData.WkName);
103
+                //        }
104
+                //        else
105
+                //        {
106
+                //            APP.W_CreateAMicroLessonWindow.Owner = this;
107
+                //            //APP.W_CreateAMicroLessonWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
108
+                //            APP.W_CreateAMicroLessonWindow.ShowDialog();
109
+                //        }
110
+                //    }
111
+                //}
112
+                #endregion
111 113
                 this.Hide();
112 114
             }
113 115
             else

+ 18
- 9
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs Datei anzeigen

@@ -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;

+ 65
- 104
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Datei anzeigen

@@ -263,32 +263,30 @@ namespace XHWK.WKTool
263 263
         /// <param name="e"></param>
264 264
         private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
265 265
         {
266
-            if (APP.IsLoginType == false)
267
-            {
268
-                Login();
269
-                return;
270
-            }
271
-            string RecordScreenPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
272
-            if (FileToolsCommon.IsExistFile(RecordScreenPathName))
273
-            {
274
-                MessageBoxResult dr = System.Windows.MessageBox.Show("已存在录屏,是否覆盖?", "提示", MessageBoxButton.OKCancel);
275
-                if (dr == MessageBoxResult.OK)
276
-                {
277
-                    try
278
-                    {
279
-                        FileToolsCommon.DeleteFile(RecordScreenPathName);
280
-                        APP.VideoList.RemoveAll(x => x.VideoPath == RecordScreenPathName);
281
-                    }
282
-                    catch (Exception ex)
283
-                    {
284
-                        LogHelper.WriteErrLog("【录屏】(BtnRecordingScreen_Click)无法移除视频," + ex.Message, ex);
285
-                    }
286
-                }
287
-                else
288
-                {
289
-                    return;
290
-                }
291
-            }
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   
289
+
292 290
             if (APP.W_ScreenRecordingToolbarWindow == null)
293 291
             {
294 292
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
@@ -309,7 +307,7 @@ namespace XHWK.WKTool
309 307
             APP.W_ScreenRecordingToolbarWindow.Topmost = true;
310 308
             APP.W_ScreenRecordingToolbarWindow.Show();
311 309
             Hide();
312
-            TxbRecordScreenWord.Text = "录屏";
310
+            TxbRecordScreenWord.Text = "录屏";
313 311
         }
314 312
         /// <summary>
315 313
         /// 上传事件
@@ -378,7 +376,7 @@ namespace XHWK.WKTool
378 376
         /// <param name="e"></param>
379 377
         private void BtnSave_Click(object sender, RoutedEventArgs e)
380 378
         {
381
-            //#region 合法性判断
379
+            #region 合法性判断
382 380
             //if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
383 381
             //{
384 382
             //    System.Windows.MessageBox.Show("路径不可为空!");
@@ -404,8 +402,7 @@ namespace XHWK.WKTool
404 402
             //    //创建文件夹
405 403
             //    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
406 404
             //}
407
-            //#endregion
408
-
405
+            #endregion
409 406
 
410 407
             if (rbnMP4.IsChecked == true)
411 408
             {
@@ -460,11 +457,6 @@ namespace XHWK.WKTool
460 457
         /// <param name="e"></param>
461 458
         private void BtnSetUp_Click(object sender, RoutedEventArgs e)
462 459
         {
463
-            if (APP.IsLoginType == false)
464
-            {
465
-                Login();
466
-                return;
467
-            }
468 460
             if (!TxbRecordingWord.Text.Equals("暂停"))
469 461
             {
470 462
                 GridMain.Visibility = Visibility.Collapsed;
@@ -667,11 +659,6 @@ namespace XHWK.WKTool
667 659
         /// <param name="e"></param>
668 660
         private void BtnScreenshot_Click(object sender, RoutedEventArgs e)
669 661
         {
670
-            if (APP.IsLoginType == false)
671
-            {
672
-                Login();
673
-                return;
674
-            }
675 662
             string time = GetTimeStamp();
676 663
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
677 664
             ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath);
@@ -761,11 +748,6 @@ namespace XHWK.WKTool
761 748
         /// <param name="e"></param>
762 749
         private void BtnImport_Click(object sender, RoutedEventArgs e)
763 750
         {
764
-            if (APP.IsLoginType == false)
765
-            {
766
-                Login();
767
-                return;
768
-            }
769 751
             try
770 752
             {
771 753
                 string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
@@ -1006,7 +988,7 @@ namespace XHWK.WKTool
1006 988
         /// <summary>
1007 989
         /// 视频保存路径
1008 990
         /// </summary>
1009
-        string RecordingPath;
991
+        //string RecordingPath;
1010 992
         /// <summary>
1011 993
         /// 图片保存路径
1012 994
         /// </summary>
@@ -1043,12 +1025,6 @@ namespace XHWK.WKTool
1043 1025
         /// <param name="e"></param>
1044 1026
         private void BtnRecord_Click(object sender, RoutedEventArgs e)
1045 1027
         {
1046
-            if (APP.IsLoginType == false)
1047
-            {
1048
-                Login();
1049
-                return;
1050
-            }
1051
-
1052 1028
             blackboard_canvas.Visibility = Visibility.Visible;
1053 1029
             StartRecord();
1054 1030
         }
@@ -1059,15 +1035,17 @@ namespace XHWK.WKTool
1059 1035
         /// <param name="e"></param>
1060 1036
         private void BtnStop_Click(object sender, RoutedEventArgs e)
1061 1037
         {
1062
-            if (APP.IsLoginType == false)
1063
-            {
1064
-                Login();
1065
-                return;
1066
-            }
1067 1038
             blackboard_canvas.Visibility = Visibility.Collapsed;
1068 1039
             EndRecord();
1069 1040
         }
1070 1041
         System.Timers.Timer timer;
1042
+
1043
+        /// <summary>
1044
+        /// 设置录屏文件地址
1045
+        /// </summary>
1046
+        void SetUpVideoPathName()
1047
+        {
1048
+        }
1071 1049
         /// <summary>
1072 1050
         /// 开始录制和暂停录制
1073 1051
         /// </summary>
@@ -1080,37 +1058,45 @@ namespace XHWK.WKTool
1080 1058
                     VideoInfo = new Model_Video();
1081 1059
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
1082 1060
                     VideoInfo.WkType = Enum_WKVidetype.RecordingLessons;
1083
-                    RecordingPath = APP.WKData.WkPath;
1061
+
1084 1062
                     ImgPath = APP.WKData.WkPath + "temp/Image/";
1085 1063
                     AudioPathName = APP.WKData.WkPath + "temp/audio/";
1086 1064
                     FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
1087
-                    FileToolsCommon.CreateDirectory(RecordingPath);
1065
+                    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
1088 1066
                     FileToolsCommon.CreateDirectory(ImgPath);
1089 1067
                     FileToolsCommon.CreateDirectory(AudioPathName);
1090 1068
                     AudioPathName += APP.WKData.WkName + ".MP3";
1091
-                    VideoSavePathName = RecordingPath + APP.WKData.WkName + "_录制." + VideoInfo.VideoType.ToString();
1092
-
1093
-                    if (FileToolsCommon.IsExistFile(VideoSavePathName))
1069
+                    VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制." + VideoInfo.VideoType.ToString();
1070
+                    int num = 1;
1071
+                    while (FileToolsCommon.IsExistFile(VideoSavePathName))
1094 1072
                     {
1095
-                        MessageBoxResult dr = System.Windows.MessageBox.Show("课程已录制,是否覆盖?", "提示", MessageBoxButton.OKCancel);
1096
-                        if (dr == MessageBoxResult.OK)
1097
-                        {
1098
-                            try
1099
-                            {
1100
-                                FileToolsCommon.DeleteFile(VideoSavePathName);
1101
-                                APP.VideoList.RemoveAll(x => x.VideoPath == VideoSavePathName);
1102
-                            }
1103
-                            catch (Exception ex)
1104
-                            {
1105
-                                LogHelper.WriteErrLog("【录制】(StartRecord)无法移除视频," + ex.Message, ex);
1106
-                            }
1107
-                        }
1108
-                        else
1109
-                        {
1110
-                            return;
1111
-                        }
1073
+                        VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制_" + num + "." + VideoInfo.VideoType.ToString();
1074
+                        num++;
1112 1075
                     }
1113 1076
 
1077
+                    #region 设置录屏唯一  废弃
1078
+                    //if (FileToolsCommon.IsExistFile(VideoSavePathName))
1079
+                    //{
1080
+                    //    MessageBoxResult dr = System.Windows.MessageBox.Show("课程已录制,是否覆盖?", "提示", MessageBoxButton.OKCancel);
1081
+                    //    if (dr == MessageBoxResult.OK)
1082
+                    //    {
1083
+                    //        try
1084
+                    //        {
1085
+                    //            FileToolsCommon.DeleteFile(VideoSavePathName);
1086
+                    //            APP.VideoList.RemoveAll(x => x.VideoPath == VideoSavePathName);
1087
+                    //        }
1088
+                    //        catch (Exception ex)
1089
+                    //        {
1090
+                    //            LogHelper.WriteErrLog("【录制】(StartRecord)无法移除视频," + ex.Message, ex);
1091
+                    //        }
1092
+                    //    }
1093
+                    //    else
1094
+                    //    {
1095
+                    //        return;
1096
+                    //    }
1097
+                    //}
1098
+                    #endregion
1099
+
1114 1100
                     #region 禁用按钮
1115 1101
                     ImgPrint.Visibility = Visibility.Collapsed;//录制中不可打印
1116 1102
                     ImgPrintTwo.Visibility = Visibility.Visible;
@@ -1341,11 +1327,6 @@ namespace XHWK.WKTool
1341 1327
         /// <param name="e"></param>
1342 1328
         private void BtnAdd_Click(object sender, RoutedEventArgs e)
1343 1329
         {
1344
-            if (APP.IsLoginType == false)
1345
-            {
1346
-                Login();
1347
-                return;
1348
-            }
1349 1330
             if (APP.pageData.pagenum < 200)
1350 1331
             {
1351 1332
                 if (APP.PageDrawList != null && APP.PageDrawList.Count > 0 && APP.PageDrawList.Count > APP.pageData.currpage - 1
@@ -1374,21 +1355,6 @@ namespace XHWK.WKTool
1374 1355
         /// <param name="e"></param>
1375 1356
         private void BtnPrint_Click(object sender, RoutedEventArgs e)
1376 1357
         {
1377
-            if (APP.IsLoginType == false)
1378
-            {
1379
-                Login();
1380
-                return;
1381
-            }
1382
-
1383
-            //for(int i=0;i< APP.pageData.pagenum; i++)
1384
-            //{
1385
-
1386
-            //}
1387
-
1388
-
1389
-
1390
-            ////string[] files = { @"C:\101\1.jpg", @"C:\101\2.jpg" };
1391
-
1392 1358
             try
1393 1359
             {
1394 1360
                 iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
@@ -1475,11 +1441,6 @@ namespace XHWK.WKTool
1475 1441
         /// <param name="e"></param>
1476 1442
         private void BtnMyMine_Click(object sender, RoutedEventArgs e)
1477 1443
         {
1478
-            if (APP.IsLoginType == false)
1479
-            {
1480
-                Login();
1481
-                return;
1482
-            }
1483 1444
         }
1484 1445
         /// <summary>
1485 1446
         /// 上一页

+ 11
- 12
XHWK.WKTool/XHWK.WKTool.csproj Datei anzeigen

@@ -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>

Laden…
Abbrechen
Speichern