Browse Source

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

tags/录制修改前
耀 4 years ago
parent
commit
27e339c276

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

+ 48
- 6
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)
60
                     Dispatcher.Invoke(
60
                     Dispatcher.Invoke(
61
                       DispatcherPriority.Send,
61
                       DispatcherPriority.Send,
62
                       new Action(() => { 
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
                     break;
65
                     break;
66
                 case 2:
66
                 case 2:
67
                     Dispatcher.Invoke(
67
                     Dispatcher.Invoke(
68
                       DispatcherPriority.Send,
68
                       DispatcherPriority.Send,
69
                       new Action(() => {
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
                     break;
72
                     break;
73
                 case 3:
73
                 case 3:
74
                     Dispatcher.Invoke(
74
                     Dispatcher.Invoke(
75
                       DispatcherPriority.Send,
75
                       DispatcherPriority.Send,
76
                       new Action(() => {
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
                     break;
121
                     break;
80
                 default:
122
                 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();

+ 70
- 59
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();
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))
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
     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

87
                 //读取微课数据
87
                 //读取微课数据
88
                 APP.ReadWkData();
88
                 APP.ReadWkData();
89
                 APP.ReadDrawData();
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
                 this.Hide();
113
                 this.Hide();
112
             }
114
             }
113
             else
115
             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;

+ 65
- 104
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
-            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
             if (APP.W_ScreenRecordingToolbarWindow == null)
290
             if (APP.W_ScreenRecordingToolbarWindow == null)
293
             {
291
             {
294
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
292
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
309
             APP.W_ScreenRecordingToolbarWindow.Topmost = true;
307
             APP.W_ScreenRecordingToolbarWindow.Topmost = true;
310
             APP.W_ScreenRecordingToolbarWindow.Show();
308
             APP.W_ScreenRecordingToolbarWindow.Show();
311
             Hide();
309
             Hide();
312
-            TxbRecordScreenWord.Text = "录屏";
310
+            TxbRecordScreenWord.Text = "录屏";
313
         }
311
         }
314
         /// <summary>
312
         /// <summary>
315
         /// 上传事件
313
         /// 上传事件
378
         /// <param name="e"></param>
376
         /// <param name="e"></param>
379
         private void BtnSave_Click(object sender, RoutedEventArgs e)
377
         private void BtnSave_Click(object sender, RoutedEventArgs e)
380
         {
378
         {
381
-            //#region 合法性判断
379
+            #region 合法性判断
382
             //if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
380
             //if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
383
             //{
381
             //{
384
             //    System.Windows.MessageBox.Show("路径不可为空!");
382
             //    System.Windows.MessageBox.Show("路径不可为空!");
404
             //    //创建文件夹
402
             //    //创建文件夹
405
             //    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
403
             //    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
406
             //}
404
             //}
407
-            //#endregion
408
-
405
+            #endregion
409
 
406
 
410
             if (rbnMP4.IsChecked == true)
407
             if (rbnMP4.IsChecked == true)
411
             {
408
             {
460
         /// <param name="e"></param>
457
         /// <param name="e"></param>
461
         private void BtnSetUp_Click(object sender, RoutedEventArgs e)
458
         private void BtnSetUp_Click(object sender, RoutedEventArgs e)
462
         {
459
         {
463
-            if (APP.IsLoginType == false)
464
-            {
465
-                Login();
466
-                return;
467
-            }
468
             if (!TxbRecordingWord.Text.Equals("暂停"))
460
             if (!TxbRecordingWord.Text.Equals("暂停"))
469
             {
461
             {
470
                 GridMain.Visibility = Visibility.Collapsed;
462
                 GridMain.Visibility = Visibility.Collapsed;
667
         /// <param name="e"></param>
659
         /// <param name="e"></param>
668
         private void BtnScreenshot_Click(object sender, RoutedEventArgs e)
660
         private void BtnScreenshot_Click(object sender, RoutedEventArgs e)
669
         {
661
         {
670
-            if (APP.IsLoginType == false)
671
-            {
672
-                Login();
673
-                return;
674
-            }
675
             string time = GetTimeStamp();
662
             string time = GetTimeStamp();
676
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
663
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
677
             ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath);
664
             ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath);
761
         /// <param name="e"></param>
748
         /// <param name="e"></param>
762
         private void BtnImport_Click(object sender, RoutedEventArgs e)
749
         private void BtnImport_Click(object sender, RoutedEventArgs e)
763
         {
750
         {
764
-            if (APP.IsLoginType == false)
765
-            {
766
-                Login();
767
-                return;
768
-            }
769
             try
751
             try
770
             {
752
             {
771
                 string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
753
                 string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
1006
         /// <summary>
988
         /// <summary>
1007
         /// 视频保存路径
989
         /// 视频保存路径
1008
         /// </summary>
990
         /// </summary>
1009
-        string RecordingPath;
991
+        //string RecordingPath;
1010
         /// <summary>
992
         /// <summary>
1011
         /// 图片保存路径
993
         /// 图片保存路径
1012
         /// </summary>
994
         /// </summary>
1043
         /// <param name="e"></param>
1025
         /// <param name="e"></param>
1044
         private void BtnRecord_Click(object sender, RoutedEventArgs e)
1026
         private void BtnRecord_Click(object sender, RoutedEventArgs e)
1045
         {
1027
         {
1046
-            if (APP.IsLoginType == false)
1047
-            {
1048
-                Login();
1049
-                return;
1050
-            }
1051
-
1052
             blackboard_canvas.Visibility = Visibility.Visible;
1028
             blackboard_canvas.Visibility = Visibility.Visible;
1053
             StartRecord();
1029
             StartRecord();
1054
         }
1030
         }
1059
         /// <param name="e"></param>
1035
         /// <param name="e"></param>
1060
         private void BtnStop_Click(object sender, RoutedEventArgs e)
1036
         private void BtnStop_Click(object sender, RoutedEventArgs e)
1061
         {
1037
         {
1062
-            if (APP.IsLoginType == false)
1063
-            {
1064
-                Login();
1065
-                return;
1066
-            }
1067
             blackboard_canvas.Visibility = Visibility.Collapsed;
1038
             blackboard_canvas.Visibility = Visibility.Collapsed;
1068
             EndRecord();
1039
             EndRecord();
1069
         }
1040
         }
1070
         System.Timers.Timer timer;
1041
         System.Timers.Timer timer;
1042
+
1043
+        /// <summary>
1044
+        /// 设置录屏文件地址
1045
+        /// </summary>
1046
+        void SetUpVideoPathName()
1047
+        {
1048
+        }
1071
         /// <summary>
1049
         /// <summary>
1072
         /// 开始录制和暂停录制
1050
         /// 开始录制和暂停录制
1073
         /// </summary>
1051
         /// </summary>
1080
                     VideoInfo = new Model_Video();
1058
                     VideoInfo = new Model_Video();
1081
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
1059
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
1082
                     VideoInfo.WkType = Enum_WKVidetype.RecordingLessons;
1060
                     VideoInfo.WkType = Enum_WKVidetype.RecordingLessons;
1083
-                    RecordingPath = APP.WKData.WkPath;
1061
+
1084
                     ImgPath = APP.WKData.WkPath + "temp/Image/";
1062
                     ImgPath = APP.WKData.WkPath + "temp/Image/";
1085
                     AudioPathName = APP.WKData.WkPath + "temp/audio/";
1063
                     AudioPathName = APP.WKData.WkPath + "temp/audio/";
1086
                     FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
1064
                     FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
1087
-                    FileToolsCommon.CreateDirectory(RecordingPath);
1065
+                    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
1088
                     FileToolsCommon.CreateDirectory(ImgPath);
1066
                     FileToolsCommon.CreateDirectory(ImgPath);
1089
                     FileToolsCommon.CreateDirectory(AudioPathName);
1067
                     FileToolsCommon.CreateDirectory(AudioPathName);
1090
                     AudioPathName += APP.WKData.WkName + ".MP3";
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
                     #region 禁用按钮
1100
                     #region 禁用按钮
1115
                     ImgPrint.Visibility = Visibility.Collapsed;//录制中不可打印
1101
                     ImgPrint.Visibility = Visibility.Collapsed;//录制中不可打印
1116
                     ImgPrintTwo.Visibility = Visibility.Visible;
1102
                     ImgPrintTwo.Visibility = Visibility.Visible;
1341
         /// <param name="e"></param>
1327
         /// <param name="e"></param>
1342
         private void BtnAdd_Click(object sender, RoutedEventArgs e)
1328
         private void BtnAdd_Click(object sender, RoutedEventArgs e)
1343
         {
1329
         {
1344
-            if (APP.IsLoginType == false)
1345
-            {
1346
-                Login();
1347
-                return;
1348
-            }
1349
             if (APP.pageData.pagenum < 200)
1330
             if (APP.pageData.pagenum < 200)
1350
             {
1331
             {
1351
                 if (APP.PageDrawList != null && APP.PageDrawList.Count > 0 && APP.PageDrawList.Count > APP.pageData.currpage - 1
1332
                 if (APP.PageDrawList != null && APP.PageDrawList.Count > 0 && APP.PageDrawList.Count > APP.pageData.currpage - 1
1374
         /// <param name="e"></param>
1355
         /// <param name="e"></param>
1375
         private void BtnPrint_Click(object sender, RoutedEventArgs e)
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
             try
1358
             try
1393
             {
1359
             {
1394
                 iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
1360
                 iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
1475
         /// <param name="e"></param>
1441
         /// <param name="e"></param>
1476
         private void BtnMyMine_Click(object sender, RoutedEventArgs e)
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
         /// <summary>
1445
         /// <summary>
1485
         /// 上一页
1446
         /// 上一页

+ 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