Просмотр исходного кода

解决截图软件未最小化的问题

解决录屏未合并直接开始录制的问题
master
张剑 1 год назад
Родитель
Сommit
21299c6f87

+ 1
- 1
XHWK.WKTool/App.config Просмотреть файл

@@ -5,7 +5,7 @@
5 5
   </startup>
6 6
   <appSettings>
7 7
     <!--0正式 1测试-->
8
-    <add key="IsDebug" value="0" />
8
+    <add key="IsDebug" value="1" />
9 9
     <!--参数是否加密 0不加密 1加密-->
10 10
     <add key="IsParameterEncryption" value="0" />
11 11
     <!--版本号-->

+ 1
- 1
XHWK.WKTool/App.xaml Просмотреть файл

@@ -1,5 +1,5 @@
1 1
 <Application
2
-    x:Class="XHWK.WKTool.APP"
2
+    x:Class="XHWK.WKTool.App"
3 3
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4 4
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5 5
     StartupUri="Welcome.xaml">

+ 55
- 71
XHWK.WKTool/App.xaml.cs Просмотреть файл

@@ -1,7 +1,5 @@
1 1
 using ComeCapture;
2
-
3 2
 using Common.system;
4
-
5 3
 using System;
6 4
 using System.Collections.Generic;
7 5
 using System.Diagnostics;
@@ -11,14 +9,13 @@ using System.Reflection;
11 9
 using System.Security.Principal;
12 10
 using System.Threading.Tasks;
13 11
 using System.Windows;
14
-
15 12
 using XHWK.Model;
16 13
 using XHWK.WKTool.Helpers;
17 14
 using XHWK.WKTool.Skin;
18 15
 
19 16
 namespace XHWK.WKTool
20 17
 {
21
-    public partial class APP : Application
18
+    public partial class App
22 19
     {
23 20
         #region 全局变量
24 21
 
@@ -46,7 +43,7 @@ namespace XHWK.WKTool
46 43
         /// <summary>
47 44
         /// 服务地址
48 45
         /// </summary>
49
-        public static Model_ServiceAddress ServiceAddress = null;
46
+        public static Model_ServiceAddress ServiceAddress;
50 47
 
51 48
         /// <summary>
52 49
         /// 接口地址
@@ -136,7 +133,7 @@ namespace XHWK.WKTool
136 133
         /// <summary>
137 134
         /// 用户信息
138 135
         /// </summary>
139
-        public static Model_UserInfo UserInfo = null;
136
+        public static Model_UserInfo UserInfo;
140 137
 
141 138
         /// <summary>
142 139
         /// 接口返回消息
@@ -180,17 +177,17 @@ namespace XHWK.WKTool
180 177
         /// <summary>
181 178
         /// 用户微课列表模型
182 179
         /// </summary>
183
-        public static List<Model_WKData> WKDataList = null;
180
+        public static List<Model_WKData> WKDataList;
184 181
 
185 182
         /// <summary>
186 183
         /// 微课模型
187 184
         /// </summary>
188
-        public static Model_WKData WKData = null;
185
+        public static Model_WKData WKData;
189 186
 
190 187
         /// <summary>
191 188
         /// 微课视频列表
192 189
         /// </summary>
193
-        public static List<Model_Video> VideoList = null;
190
+        public static List<Model_Video> VideoList;
194 191
 
195 192
         /// <summary>
196 193
         /// 画板模型
@@ -259,12 +256,7 @@ namespace XHWK.WKTool
259 256
         public static MainWindow W_XHMicroLessonSystemWindow = null;
260 257
 
261 258
         /// <summary>
262
-        /// 创建微课页面
263
-        /// </summary>
264
-        public static CreateAMicroLessonWindow W_CreateAMicroLessonWindow = null;
265
-
266
-        /// <summary>
267
-        /// 开始录像
259
+        /// 倒计时窗口
268 260
         /// </summary>
269 261
         public static CountdownWindow W_CountdownWindow = null;
270 262
 
@@ -317,15 +309,13 @@ namespace XHWK.WKTool
317 309
 
318 310
         #endregion 全局变量
319 311
 
320
-        public APP()
312
+        public App()
321 313
         {
322
-            Console.WriteLine("初始化APP");
314
+            Console.WriteLine(@"初始化APP");
323 315
             LogHelper.InitLog4Net();
324
-
325 316
             myloading = new LoadDialog();
326 317
             StopSameProcess();
327 318
             Killffmpeg();
328
-
329 319
             try
330 320
             {
331 321
                 UserInfo = new Model_UserInfo();
@@ -341,15 +331,15 @@ namespace XHWK.WKTool
341 331
 
342 332
                 try
343 333
                 {
344
-                    if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "Temp"))//清除临时文件
334
+                    if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "Temp")) //清除临时文件
345 335
                     {
346 336
                         Directory.Delete(AppDomain.CurrentDomain.BaseDirectory + "Temp", true);
347 337
                     }
348 338
                 }
349 339
                 catch (Exception)
350 340
                 {
341
+                    // ignored
351 342
                 }
352
-
353 343
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
354 344
                 {
355 345
                     SkinConfig.InitSkin();
@@ -380,8 +370,8 @@ namespace XHWK.WKTool
380 370
             }
381 371
             catch (Exception ex)
382 372
             {
383
-                string ErrMessage = "【进程】(Main):进程意外关闭。 " + ex.Message;
384
-                LogHelper.WriteErrLog(ErrMessage, ex);
373
+                string errMessage = "【进程】(Main):进程意外关闭。 " + ex.Message;
374
+                LogHelper.WriteErrLog(errMessage, ex);
385 375
             }
386 376
         }
387 377
 
@@ -406,6 +396,7 @@ namespace XHWK.WKTool
406 396
                         }
407 397
                         catch (Exception)
408 398
                         {
399
+                            // ignored
409 400
                         }
410 401
                     }
411 402
                 }
@@ -417,10 +408,10 @@ namespace XHWK.WKTool
417 408
         /// </summary>
418 409
         public static void Killffmpeg()
419 410
         {
420
-            Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
421
-            foreach (Process KillProcess in KillProcessArray)
411
+            Process[] killProcessArray = Process.GetProcessesByName("ffmpeg");
412
+            foreach (Process killProcess in killProcessArray)
422 413
             {
423
-                KillProcess.Kill();
414
+                killProcess.Kill();
424 415
             }
425 416
         }
426 417
 
@@ -429,7 +420,7 @@ namespace XHWK.WKTool
429 420
         private void RegisterEvents()
430 421
         {
431 422
             //Task线程内未捕获异常处理事件
432
-            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;//Task异常
423
+            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; //Task异常
433 424
 
434 425
             //UI线程未捕获异常处理事件(UI主线程)
435 426
             DispatcherUnhandledException += App_DispatcherUnhandledException;
@@ -473,10 +464,6 @@ namespace XHWK.WKTool
473 464
             {
474 465
                 HandleException(ex);
475 466
             }
476
-            finally
477
-            {
478
-                //ignore
479
-            }
480 467
         }
481 468
 
482 469
         //UI线程未捕获异常处理事件(UI主线程)
@@ -523,13 +510,12 @@ namespace XHWK.WKTool
523 510
                     WKDataList = new List<Model_WKData>();
524 511
                 }
525 512
                 WKDataList.Add(WKData);
526
-
527
-                string WkDateXmlStr = XmlUtilHelper.XmlSerialize(WKDataList);
528
-                string SavePath = FileToolsCommon.GetFileAbsolutePath("/Data/");
529
-                FileToolsCommon.CreateDirectory(SavePath);
530
-                string SaveName = SavePath + "WkDate.d";
531
-                FileToolsCommon.DeleteFile(SaveName);
532
-                FileToolsCommon.WriteText(SaveName, WkDateXmlStr);
513
+                string wkDateXmlStr = XmlUtilHelper.XmlSerialize(WKDataList);
514
+                string savePath = FileToolsCommon.GetFileAbsolutePath("/Data/");
515
+                FileToolsCommon.CreateDirectory(savePath);
516
+                string saveName = savePath + "WkDate.d";
517
+                FileToolsCommon.DeleteFile(saveName);
518
+                FileToolsCommon.WriteText(saveName, wkDateXmlStr);
533 519
             }
534 520
             catch (Exception ex)
535 521
             {
@@ -540,26 +526,26 @@ namespace XHWK.WKTool
540 526
         /// <summary>
541 527
         /// 读取微课信息
542 528
         /// </summary>
543
-        public static void ReadWkData(string WkPath)
529
+        public static void ReadWkData(string wkPath)
544 530
         {
545 531
             try
546 532
             {
547
-                string SavePath = FileToolsCommon.GetFileAbsolutePath("/Data/");
548
-                FileToolsCommon.CreateDirectory(SavePath);
549
-                string SaveName = SavePath + "WkDate.d";
533
+                string savePath = FileToolsCommon.GetFileAbsolutePath("/Data/");
534
+                FileToolsCommon.CreateDirectory(savePath);
535
+                string saveName = savePath + "WkDate.d";
550 536
                 //文件若存在则读取
551
-                if (FileToolsCommon.IsExistFile(SaveName))
537
+                if (FileToolsCommon.IsExistFile(saveName))
552 538
                 {
553
-                    string WkDateXmlStr = FileToolsCommon.FileToString(SaveName);
554
-                    WKDataList = XmlUtilHelper.DESerializer<List<Model_WKData>>(WkDateXmlStr);
539
+                    string wkDateXmlStr = FileToolsCommon.FileToString(saveName);
540
+                    WKDataList = XmlUtilHelper.DESerializer<List<Model_WKData>>(wkDateXmlStr);
555 541
                     foreach (Model_WKData wklist in WKDataList)
556 542
                     {
557 543
                         //移除找不到视频的微课数据
558 544
                         wklist.VideoList.RemoveAll(x => !FileToolsCommon.IsExistFile(x.VideoPath));
559 545
                     }
560
-                    if (WKDataList.Exists(x => x.WkPath == WkPath))
546
+                    if (WKDataList.Exists(x => x.WkPath == wkPath))
561 547
                     {
562
-                        WKData = WKDataList.Find(x => x.WkPath == WkPath);
548
+                        WKData = WKDataList.Find(x => x.WkPath == wkPath);
563 549
                         VideoList = new List<Model_Video>();
564 550
                         WKData.VideoList = WKData.VideoList.Where((x, i) => WKData.VideoList.FindIndex(z => z.FileGuid == x.FileGuid) == i).ToList();
565 551
                         VideoList = WKData.VideoList;
@@ -588,10 +574,10 @@ namespace XHWK.WKTool
588 574
                     return;
589 575
                 }
590 576
                 FileToolsCommon.CreateDirectory(WKData.WkPath);
591
-                string SavePath = WKData.WkPath + "PageData.xml";
592
-                FileToolsCommon.DeleteFile(SavePath);
593
-                string PageDataXmlStr = XmlUtilHelper.XmlSerialize(PageDrawList);
594
-                FileToolsCommon.WriteText(SavePath, PageDataXmlStr);
577
+                string savePath = WKData.WkPath + "PageData.xml";
578
+                FileToolsCommon.DeleteFile(savePath);
579
+                string pageDataXmlStr = XmlUtilHelper.XmlSerialize(PageDrawList);
580
+                FileToolsCommon.WriteText(savePath, pageDataXmlStr);
595 581
             }
596 582
             catch (Exception ex)
597 583
             {
@@ -607,11 +593,11 @@ namespace XHWK.WKTool
607 593
             try
608 594
             {
609 595
                 PageDrawList = new List<Model_DrawData>();
610
-                string SavePath = WKData.WkPath + "PageData.xml";
611
-                if (FileToolsCommon.IsExistFile(SavePath))
596
+                string savePath = WKData.WkPath + "PageData.xml";
597
+                if (FileToolsCommon.IsExistFile(savePath))
612 598
                 {
613
-                    string PageDataXmlStr = FileToolsCommon.FileToString(SavePath);
614
-                    PageDrawList = XmlUtilHelper.DESerializer<List<Model_DrawData>>(PageDataXmlStr);
599
+                    string pageDataXmlStr = FileToolsCommon.FileToString(savePath);
600
+                    PageDrawList = XmlUtilHelper.DESerializer<List<Model_DrawData>>(pageDataXmlStr);
615 601
                 }
616 602
                 else
617 603
                 {
@@ -639,15 +625,13 @@ namespace XHWK.WKTool
639 625
                 {
640 626
                     return;
641 627
                 }
642
-                string DateXmlStr = XmlUtilHelper.XmlSerialize(ServiceAddress);
643
-                string SavePath = DataPath;
644
-                FileToolsCommon.CreateDirectory(SavePath);
645
-
646
-                string SaveName = SavePath + (isDebug ? "ServiceAddress_debug.xml" : "ServiceAddress_release.xml");
647
-
648
-                Console.WriteLine("保存路径为:");
649
-                FileToolsCommon.DeleteFile(SaveName);
650
-                FileToolsCommon.WriteText(SaveName, DateXmlStr);
628
+                string dateXmlStr = XmlUtilHelper.XmlSerialize(ServiceAddress);
629
+                string savePath = DataPath;
630
+                FileToolsCommon.CreateDirectory(savePath);
631
+                string saveName = savePath + (isDebug ? "ServiceAddress_debug.xml" : "ServiceAddress_release.xml");
632
+                Console.WriteLine(@"保存路径为:");
633
+                FileToolsCommon.DeleteFile(saveName);
634
+                FileToolsCommon.WriteText(saveName, dateXmlStr);
651 635
             }
652 636
             catch (Exception ex)
653 637
             {
@@ -662,14 +646,14 @@ namespace XHWK.WKTool
662 646
         {
663 647
             try
664 648
             {
665
-                string SavePath = DataPath;
666
-                FileToolsCommon.CreateDirectory(SavePath);
667
-                string SaveName = SavePath + (isDebug ? "ServiceAddress_debug.xml" : "ServiceAddress_release.xml");
649
+                string savePath = DataPath;
650
+                FileToolsCommon.CreateDirectory(savePath);
651
+                string saveName = savePath + (isDebug ? "ServiceAddress_debug.xml" : "ServiceAddress_release.xml");
668 652
                 //文件若存在则读取
669
-                if (FileToolsCommon.IsExistFile(SaveName))
653
+                if (FileToolsCommon.IsExistFile(saveName))
670 654
                 {
671
-                    string DateXmlStr = FileToolsCommon.FileToString(SaveName);
672
-                    ServiceAddress = XmlUtilHelper.DESerializer<Model_ServiceAddress>(DateXmlStr);
655
+                    string dateXmlStr = FileToolsCommon.FileToString(saveName);
656
+                    ServiceAddress = XmlUtilHelper.DESerializer<Model_ServiceAddress>(dateXmlStr);
673 657
                     SwitchAddress();
674 658
                 }
675 659
             }
@@ -709,4 +693,4 @@ namespace XHWK.WKTool
709 693
             base.OnStartup(e);
710 694
         }
711 695
     }
712
-}
696
+}

+ 2
- 3
XHWK.WKTool/AppUpdateWin.xaml.cs Просмотреть файл

@@ -49,8 +49,7 @@ namespace XHWK.WKTool
49 49
 
50 50
         private void gengxinClick(object sender, RoutedEventArgs e)
51 51
         {
52
-            string fileUrl = APP.showImageUrl + pageData.appModel.versionpath;
53
-
52
+            string fileUrl = App.showImageUrl + pageData.appModel.versionpath;
54 53
             string path = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
55 54
             DirectoryInfo info = new DirectoryInfo(path);
56 55
             if (!info.Exists)
@@ -112,4 +111,4 @@ namespace XHWK.WKTool
112 111
             MessageWindow.Show(msg);
113 112
         }
114 113
     }
115
-}
114
+}

+ 80
- 245
XHWK.WKTool/CountdownWindow.xaml.cs Просмотреть файл

@@ -1,30 +1,47 @@
1
-using Common.system;
2
-
3
-using System;
4
-using System.Threading;
1
+using System;
5 2
 using System.Windows;
6 3
 using System.Windows.Media.Imaging;
7 4
 using System.Windows.Threading;
8 5
 
9 6
 namespace XHWK.WKTool
10 7
 {
8
+    using System.Collections.Generic;
9
+    using System.Linq;
10
+    using System.Threading.Tasks;
11
+
11 12
     /// <summary>
12 13
     /// 录屏等待 CountdownWindow.xaml 的交互逻辑
13 14
     /// </summary>
14
-    public partial class CountdownWindow : Window
15
+    public partial class CountdownWindow
15 16
     {
17
+        private readonly List<BitmapImage> _images = new List<BitmapImage>();
18
+
16 19
         public CountdownWindow()
17 20
         {
18 21
             InitializeComponent();
22
+            foreach (var imgName in _imgNames)
23
+            {
24
+                _images.Add(new BitmapImage(new Uri("pack://application:,,/Images/" + imgName)));
25
+            }
19 26
         }
20 27
 
21 28
         /// <summary>
22 29
         /// 计时器
23 30
         /// </summary>
24
-        private int ImgNum = 22;
25
-        public void Initialize(bool ShowlblShortcut = false, int changeTime = 3000)
31
+        private int _imgNum = 22;
32
+
33
+        public void Initialize(bool showlblShortcut = false, int changeTime = 3000)
26 34
         {
27
-            if (ShowlblShortcut)
35
+            imgLoding.Opacity = 0.1;
36
+            imgLoding.Source = _images.Last();
37
+            Init(showlblShortcut, changeTime);
38
+        }
39
+
40
+        private System.Timers.Timer _timer;
41
+
42
+        private async void Init(bool showlblShortcut, int changeTime)
43
+        {
44
+            if (showlblShortcut)
28 45
             {
29 46
                 lblShortcut.Visibility = Visibility.Visible;
30 47
                 borShortcut.Visibility = Visibility.Visible;
@@ -34,254 +51,72 @@ namespace XHWK.WKTool
34 51
                 lblShortcut.Visibility = Visibility.Hidden;
35 52
                 borShortcut.Visibility = Visibility.Hidden;
36 53
             }
37
-            ImgNum = 22;
38
-            bool IsStart = true;
39
-            new Thread(new ThreadStart(new Action(() =>
40
-            {
41
-                while (IsStart)
42
-                {
43
-                    try
44
-                    {
45
-                        if (ImgNum >= 0)
46
-                        {
47
-                            loadingImg(ImgNum);
48
-                            ImgNum--;
49
-                            Thread.Sleep(changeTime / 22);
50
-                        }
51
-                        else
52
-                        {
53
-                            IsStart = false;
54
-                            Dispatcher.Invoke(
55
-                                      DispatcherPriority.Send,
56
-                                      new Action(() =>
57
-                                      {
58
-                                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_1.png"));
59
-                                          Hide();
60
-                                      }));
61
-                        }
62
-                    }
63
-                    catch (Exception ex)
64
-                    {
65
-                        LogHelper.WriteErrLog("【录屏等待】(Initialize)" + ex.Message, ex);
66
-                    }
67
-                }
68
-            }))).Start();
69
-
54
+            _imgNum = 22;
55
+            _timer = new System.Timers.Timer();
56
+            _timer.Enabled = true;
57
+            _timer.Interval = 1.0 * changeTime / 22;
58
+            _timer.Elapsed += Timer_Elapsed;
59
+            _timer.Start();
60
+            await Task.Delay(300);
61
+            imgLoding.Opacity = 1;
70 62
         }
71 63
 
72 64
         private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
73 65
         {
74
-            if (ImgNum >= 1)
66
+            if (_imgNum >= 0)
75 67
             {
76
-                loadingImg(ImgNum);
77
-                ImgNum--;
68
+                Dispatcher.Invoke
69
+                (
70
+                    () =>
71
+                    {
72
+                        // 执行操作
73
+                        imgLoding.Source = _images[_imgNum];
74
+                    },
75
+                    DispatcherPriority.Send
76
+                );
77
+                _imgNum--;
78 78
             }
79 79
             else
80 80
             {
81
-                //timer.Enabled = false;
82
-                Dispatcher.Invoke(
83
-                  DispatcherPriority.Send,
84
-                  new Action(() =>
85
-                  {
86
-                      imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_1.png"));
87
-                      Hide();
88
-                  }));
89
-            }
90
-        }
91
-
92
-        /// <summary>
93
-        /// 加载图片
94
-        /// </summary>
95
-        /// <param name="num"></param>
96
-        private void loadingImg(int num)
97
-        {
98
-            switch (num)
99
-            {
100
-                case 1:
101
-                    Dispatcher.Invoke(
102
-                      DispatcherPriority.Send,
103
-                      new Action(() =>
104
-                      {
105
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_7.png"));
106
-                      }));
107
-                    break;
108
-                case 2:
109
-                    Dispatcher.Invoke(
110
-                      DispatcherPriority.Send,
111
-                      new Action(() =>
112
-                      {
113
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_6.png"));
114
-                      }));
115
-                    break;
116
-                case 3:
117
-                    Dispatcher.Invoke(
118
-                      DispatcherPriority.Send,
119
-                      new Action(() =>
120
-                      {
121
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_5.png"));
122
-                      }));
123
-                    break;
124
-                case 4:
125
-                    Dispatcher.Invoke(
126
-                      DispatcherPriority.Send,
127
-                      new Action(() =>
128
-                      {
129
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_4.png"));
130
-                      }));
131
-                    break;
132
-                case 5:
133
-                    Dispatcher.Invoke(
134
-                      DispatcherPriority.Send,
135
-                      new Action(() =>
136
-                      {
137
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_3.png"));
138
-                      }));
139
-                    break;
140
-                case 6:
141
-                    Dispatcher.Invoke(
142
-                      DispatcherPriority.Send,
143
-                      new Action(() =>
144
-                      {
145
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_2.png"));
146
-                      }));
147
-                    break;
148
-                case 7:
149
-                    Dispatcher.Invoke(
150
-                      DispatcherPriority.Send,
151
-                      new Action(() =>
152
-                      {
153
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_1.png"));
154
-                      }));
155
-                    break;
156
-                case 8:
157
-                    Dispatcher.Invoke(
158
-                      DispatcherPriority.Send,
159
-                      new Action(() =>
160
-                      {
161
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_7.png"));
162
-                      }));
163
-                    break;
164
-                case 9:
165
-                    Dispatcher.Invoke(
166
-                      DispatcherPriority.Send,
167
-                      new Action(() =>
168
-                      {
169
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_6.png"));
170
-                      }));
171
-                    break;
172
-                case 10:
173
-                    Dispatcher.Invoke(
174
-                      DispatcherPriority.Send,
175
-                      new Action(() =>
176
-                      {
177
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_5.png"));
178
-                      }));
179
-                    break;
180
-                case 11:
181
-                    Dispatcher.Invoke(
182
-                      DispatcherPriority.Send,
183
-                      new Action(() =>
184
-                      {
185
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_4.png"));
186
-                      }));
187
-                    break;
188
-                case 12:
189
-                    Dispatcher.Invoke(
190
-                      DispatcherPriority.Send,
191
-                      new Action(() =>
192
-                      {
193
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_3.png"));
194
-                      }));
195
-                    break;
196
-                case 13:
197
-                    Dispatcher.Invoke(
198
-                      DispatcherPriority.Send,
199
-                      new Action(() =>
200
-                      {
201
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_2.png"));
202
-                      }));
203
-                    break;
204
-                case 14:
205
-                    Dispatcher.Invoke(
206
-                      DispatcherPriority.Send,
207
-                      new Action(() =>
208
-                      {
209
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_1.png"));
210
-                      }));
211
-                    break;
212
-                case 15:
213
-                    Dispatcher.Invoke(
214
-                      DispatcherPriority.Send,
215
-                      new Action(() =>
216
-                      {
217
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_8.png"));
218
-                      }));
219
-                    break;
220
-                case 16:
221
-                    Dispatcher.Invoke(
222
-                      DispatcherPriority.Send,
223
-                      new Action(() =>
224
-                      {
225
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_7.png"));
226
-                      }));
227
-                    break;
228
-                case 17:
229
-                    Dispatcher.Invoke(
230
-                      DispatcherPriority.Send,
231
-                      new Action(() =>
232
-                      {
233
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_6.png"));
234
-                      }));
235
-                    break;
236
-                case 18:
237
-                    Dispatcher.Invoke(
238
-                      DispatcherPriority.Send,
239
-                      new Action(() =>
240
-                      {
241
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_5.png"));
242
-                      }));
243
-                    break;
244
-                case 19:
245
-                    Dispatcher.Invoke(
246
-                      DispatcherPriority.Send,
247
-                      new Action(() =>
248
-                      {
249
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_4.png"));
250
-                      }));
251
-                    break;
252
-                case 20:
253
-                    Dispatcher.Invoke(
254
-                      DispatcherPriority.Send,
255
-                      new Action(() =>
256
-                      {
257
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_3.png"));
258
-                      }));
259
-                    break;
260
-                case 21:
261
-                    Dispatcher.Invoke(
262
-                      DispatcherPriority.Send,
263
-                      new Action(() =>
264
-                      {
265
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_2.png"));
266
-                      }));
267
-                    break;
268
-                case 22:
269
-                    Dispatcher.Invoke(
270
-                      DispatcherPriority.Send,
271
-                      new Action(() =>
272
-                      {
273
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_1.png"));
274
-                      }));
275
-                    break;
276
-                default:
277
-                    break;
81
+                _timer.Stop();
82
+                Dispatcher.Invoke
83
+                (
84
+                    () =>
85
+                    {
86
+                        // 执行操作
87
+                        imgLoding.Source = _images.Last();
88
+                        Hide();
89
+                    },
90
+                    DispatcherPriority.Send
91
+                );
278 92
             }
279 93
         }
280 94
 
281
-        private void Window_ContentRendered(object sender, EventArgs e)
95
+        readonly string[] _imgNames =
282 96
         {
283
-
284
-        }
285
-
97
+            "countdown1_7.png",
98
+            "countdown1_6.png",
99
+            "countdown1_5.png",
100
+            "countdown1_4.png",
101
+            "countdown1_3.png",
102
+            "countdown1_2.png",
103
+            "countdown1_1.png",
104
+            "countdown2_7.png",
105
+            "countdown2_6.png",
106
+            "countdown2_5.png",
107
+            "countdown2_4.png",
108
+            "countdown2_3.png",
109
+            "countdown2_2.png",
110
+            "countdown2_1.png",
111
+            "countdown3_8.png",
112
+            "countdown3_7.png",
113
+            "countdown3_6.png",
114
+            "countdown3_5.png",
115
+            "countdown3_4.png",
116
+            "countdown3_3.png",
117
+            "countdown3_2.png",
118
+            "countdown3_1.png",
119
+            "countdown3_1.png",
120
+        };
286 121
     }
287 122
 }

+ 11
- 16
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs Просмотреть файл

@@ -249,10 +249,10 @@ namespace XHWK.WKTool
249 249
                 try
250 250
                 {
251 251
                     //读取微课数据
252
-                    APP.ReadWkData(wkpath);
253
-                    if (APP.WKData == null)
252
+                    App.ReadWkData(wkpath);
253
+                    if (App.WKData == null)
254 254
                     {
255
-                        APP.WKData = new Model_WKData
255
+                        App.WKData = new Model_WKData
256 256
                         {
257 257
                             WkPath = wkpath,
258 258
                             WkName = wkName,
@@ -263,7 +263,7 @@ namespace XHWK.WKTool
263 263
                     try
264 264
                     {
265 265
                         //创建文件夹
266
-                        FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
266
+                        FileToolsCommon.CreateDirectory(App.WKData.WkPath);
267 267
                         FileToolsCommon.DeleteDirectory(wkpath + "temp");
268 268
                         FileToolsCommon.DeleteDirectory(wkpath + "_temppath");
269 269
                     }
@@ -274,21 +274,18 @@ namespace XHWK.WKTool
274 274
 
275 275
                     //存储文件
276 276
                     FileToolsCommon.SetConfigValue("VideoSavePath", storagePath);
277
-
278
-                    APP.ReadDrawData();
277
+                    App.ReadDrawData();
279 278
                 }
280 279
                 catch (Exception ex)
281 280
                 {
282 281
                     LogHelper.WriteErrLog("【微课创建课程】读取课堂数据失败:" + ex.Message, ex);
283 282
                 }
284 283
             });
285
-
286
-            if (APP.W_XHMicroLessonSystemWindow == null)
284
+            if (App.W_XHMicroLessonSystemWindow == null)
287 285
             {
288
-                APP.W_XHMicroLessonSystemWindow = new MainWindow();
286
+                App.W_XHMicroLessonSystemWindow = new MainWindow();
289 287
             }
290
-
291
-            APP.W_XHMicroLessonSystemWindow.Show();
288
+            App.W_XHMicroLessonSystemWindow.Show();
292 289
             LblCreate.Visibility = Visibility.Hidden;
293 290
             Hide();
294 291
         }
@@ -315,16 +312,14 @@ namespace XHWK.WKTool
315 312
             new Thread(o =>
316 313
             {
317 314
                 //读取本地
318
-                APP.ReadServiceAddressData();
315
+                App.ReadServiceAddressData();
319 316
                 int versionThis = int.Parse(FileToolsCommon.GetConfigValue("VersionCode"));
320 317
                 if (versionThis < 0)
321 318
                 {
322 319
                     //软件是否更新,版本号小于0不更新
323 320
                     return;
324 321
                 }
325
-
326
-                string url = APP.apiUrl + "/sapi/apprecord/get_new";
327
-
322
+                string url = App.apiUrl + "/sapi/apprecord/get_new";
328 323
                 string result = HttpHelper.PostAndRespStr(url, "{}");
329 324
                 var resultObj = JsonHelper.JsonToObj<ResultVo<Model_App>>(result);
330 325
                 if (result != null && resultObj.code == 0)
@@ -378,4 +373,4 @@ namespace XHWK.WKTool
378 373
             Environment.Exit(0);
379 374
         }
380 375
     }
381
-}
376
+}

+ 19
- 20
XHWK.WKTool/DAL/DAL_Upload.cs Просмотреть файл

@@ -16,7 +16,7 @@ namespace XHWK.WKTool.DAL
16 16
     /// </summary>
17 17
     public class DalUpload
18 18
     {
19
-        private readonly string _fileRequestAddress = APP.uploadUrl;
19
+        private readonly string _fileRequestAddress = App.uploadUrl;
20 20
 
21 21
         //private string schoolfileRequestAddress = APP.showImageUrl;
22 22
         /// <summary>
@@ -53,8 +53,7 @@ namespace XHWK.WKTool.DAL
53 53
 
54 54
                         Model.ResultVo<Model_ResourceAddTwo> resultObj =
55 55
                             JsonHelper.JsonToObj<Model.ResultVo<Model_ResourceAddTwo>>(jo.ToString());
56
-
57
-                        APP.ResourceAddTwo = resultObj.obj;
56
+                        App.ResourceAddTwo = resultObj.obj;
58 57
                         //已存在 不允许上传
59 58
                         return false;
60 59
                     }
@@ -109,11 +108,11 @@ namespace XHWK.WKTool.DAL
109 108
                         return false;
110 109
                     }
111 110
                     Model.ResultVo<Model_ResourceAddTwo> resultObj = JsonHelper.JsonToObj<Model.ResultVo<Model_ResourceAddTwo>>(jo.ToString());
112
-                    APP.ResourceAddTwo = new Model_ResourceAddTwo();
111
+                    App.ResourceAddTwo = new Model_ResourceAddTwo();
113 112
                     //0成功,1失败
114 113
                     if (resultObj.code == 0 && resultObj.obj != null)
115 114
                     {
116
-                        APP.ResourceAddTwo = resultObj.obj;
115
+                        App.ResourceAddTwo = resultObj.obj;
117 116
                         return true;
118 117
                     }
119 118
                     else
@@ -147,13 +146,12 @@ namespace XHWK.WKTool.DAL
147 146
             try
148 147
             {
149 148
                 Model_Video videoInfo = null;
150
-                foreach (Model_WKData vdata in APP.WKDataList)
149
+                foreach (Model_WKData vdata in App.WKDataList)
151 150
                 {
152 151
                     if (vdata.VideoList == null)
153 152
                     {
154 153
                         continue;
155 154
                     }
156
-
157 155
                     foreach (Model_Video videoinfo in vdata.VideoList)
158 156
                     {
159 157
                         if (videoinfo.FileGuid == videoGuid)
@@ -162,7 +160,6 @@ namespace XHWK.WKTool.DAL
162 160
                             break;
163 161
                         }
164 162
                     }
165
-
166 163
                     if (videoInfo != null)
167 164
                     {
168 165
                         break;
@@ -203,13 +200,12 @@ namespace XHWK.WKTool.DAL
203 200
             try
204 201
             {
205 202
                 Model_Video videoInfo = null;
206
-                foreach (Model_WKData vdata in APP.WKDataList)
203
+                foreach (Model_WKData vdata in App.WKDataList)
207 204
                 {
208 205
                     if (vdata.VideoList == null)
209 206
                     {
210 207
                         continue;
211 208
                     }
212
-
213 209
                     foreach (Model_Video videoinfo in vdata.VideoList)
214 210
                     {
215 211
                         if (videoinfo.FileGuid == videoGuid)
@@ -218,7 +214,6 @@ namespace XHWK.WKTool.DAL
218 214
                             break;
219 215
                         }
220 216
                     }
221
-
222 217
                     if (videoInfo != null)
223 218
                     {
224 219
                         break;
@@ -266,10 +261,12 @@ namespace XHWK.WKTool.DAL
266 261
                             #region 合并文件
267 262
 
268 263
                             //合并文件
269
-                            bool isres =
270
-                                ReportFileMerge(
271
-                                    APP.UserInfo.cloudcode + "/" + APP.UserInfo.Schoolid.ToString() + "/resource",
272
-                                    videoInfo.FileGuid, out errMessage);
264
+                            bool isres = ReportFileMerge
265
+                            (
266
+                                App.UserInfo.cloudcode + "/" + App.UserInfo.Schoolid.ToString() + "/resource",
267
+                                videoInfo.FileGuid,
268
+                                out errMessage
269
+                            );
273 270
                             if (isres)
274 271
                             {
275 272
                                 videoInfo.IsUpload = true;
@@ -350,10 +347,12 @@ namespace XHWK.WKTool.DAL
350 347
                         #region 合并文件
351 348
 
352 349
                         //合并文件
353
-                        bool isres =
354
-                            ReportFileMerge(
355
-                                APP.UserInfo.cloudcode + "/" + APP.UserInfo.Schoolid.ToString() + "/resource",
356
-                                videoInfo.FileGuid, out errMessage);
350
+                        bool isres = ReportFileMerge
351
+                        (
352
+                            App.UserInfo.cloudcode + "/" + App.UserInfo.Schoolid.ToString() + "/resource",
353
+                            videoInfo.FileGuid,
354
+                            out errMessage
355
+                        );
357 356
                         if (isres)
358 357
                         {
359 358
                             //VideoInfo.IsUpload = true;
@@ -375,4 +374,4 @@ namespace XHWK.WKTool.DAL
375 374
             return false;
376 375
         }
377 376
     }
378
-}
377
+}

+ 44
- 47
XHWK.WKTool/DAL/XHApi.cs Просмотреть файл

@@ -24,7 +24,7 @@ namespace XHWK.WKTool.DAL
24 24
         {
25 25
             try
26 26
             {
27
-                string url = APP.certapiUrl + "/activation/add";//地址
27
+                string url = App.certapiUrl + "/activation/add"; //地址
28 28
                 Dictionary<string, object> dic = new Dictionary<string, object>
29 29
                 {
30 30
                     { "mac", mac },
@@ -37,7 +37,7 @@ namespace XHWK.WKTool.DAL
37 37
 
38 38
                 if (string.IsNullOrEmpty(xmlDoc))
39 39
                 {
40
-                    APP.ServerMsg = "网络异常!";
40
+                    App.ServerMsg = "网络异常!";
41 41
                     return 1;
42 42
                 }
43 43
                 else
@@ -47,19 +47,23 @@ namespace XHWK.WKTool.DAL
47 47
                     {
48 48
                         if (obj["code"].ToString().Equals("0"))
49 49
                         {
50
-                            APP.Signature = obj["obj"].ToString();
51
-                            if (!Directory.Exists(APP.DataPath))
50
+                            App.Signature = obj["obj"].ToString();
51
+                            if (!Directory.Exists(App.DataPath))
52 52
                             {
53
-                                Directory.CreateDirectory(APP.DataPath);
53
+                                Directory.CreateDirectory(App.DataPath);
54 54
                             }
55
-                            string ApplicationData = APP.DataPath + "signature.txt";
56
-
57
-                            System.IO.File.WriteAllText(ApplicationData, APP.Signature, Encoding.Default);//存放签名
55
+                            string ApplicationData = App.DataPath + "signature.txt";
56
+                            System.IO.File.WriteAllText
57
+                            (
58
+                                ApplicationData,
59
+                                App.Signature,
60
+                                Encoding.Default
61
+                            ); //存放签名
58 62
                             return 0;
59 63
                         }
60 64
                         else
61 65
                         {
62
-                            APP.ServerMsg = obj["msg"].ToString();
66
+                            App.ServerMsg = obj["msg"].ToString();
63 67
                             return Convert.ToInt32(obj["code"].ToString());
64 68
                         }
65 69
                     }
@@ -71,7 +75,7 @@ namespace XHWK.WKTool.DAL
71 75
             }
72 76
             catch (Exception ex)
73 77
             {
74
-                APP.ServerMsg = "网络异常!";
78
+                App.ServerMsg = "网络异常!";
75 79
                 LogHelper.WriteErrLog("【调用接口(RegisterController)】错误日志:" + ex.Message, ex);
76 80
                 return 1;
77 81
             }
@@ -88,11 +92,8 @@ namespace XHWK.WKTool.DAL
88 92
         {
89 93
             try
90 94
             {
91
-                string url = APP.certapiUrl + "/activation/add_history";
92
-                Dictionary<string, object> dic = new Dictionary<string, object>
93
-                {
94
-                    { "sign", APP.Signature }
95
-                };
95
+                string url = App.certapiUrl + "/activation/add_history";
96
+                Dictionary<string, object> dic = new Dictionary<string, object> { { "sign", App.Signature } };
96 97
                 string body = JsonHelper.ToJson(dic);
97 98
                 string xmlDoc = HttpHelper.HttpPost(body, url);
98 99
 
@@ -106,7 +107,7 @@ namespace XHWK.WKTool.DAL
106 107
                     JObject obj = JObject.Parse(xmlDoc);
107 108
                     if (obj != null)
108 109
                     {
109
-                        APP.ServerMsg = obj["msg"].ToString();
110
+                        App.ServerMsg = obj["msg"].ToString();
110 111
                         return Convert.ToInt32(obj["code"].ToString());
111 112
                     }
112 113
                     else
@@ -132,7 +133,7 @@ namespace XHWK.WKTool.DAL
132 133
         public int Login(string loginname, string loginpwd)
133 134
         {
134 135
             Console.WriteLine(FileToolsCommon.GetConfigValue("APIRequestAddress"));
135
-            string url = APP.apiUrl + "/suser/user/login";//地址
136
+            string url = App.apiUrl + "/suser/user/login"; //地址
136 137
 
137 138
             //1.193.37.200
138 139
             string Address = "";//河南 郑州
@@ -150,18 +151,18 @@ namespace XHWK.WKTool.DAL
150 151
             ResultVo<Model_UserInfo> result = HttpHelper.PostAndRespSignle<ResultVo<Model_UserInfo>>(url, postData: body);
151 152
             if (result != null)
152 153
             {
153
-                APP.UserInfo = new Model_UserInfo();
154
-                APP.ServerMsg = result.msg;
154
+                App.UserInfo = new Model_UserInfo();
155
+                App.ServerMsg = result.msg;
155 156
                 if (result.obj != null)
156 157
                 {
157
-                    APP.UserInfo = result.obj;
158
+                    App.UserInfo = result.obj;
158 159
                 }
159 160
                 return result.code;
160 161
             }
161 162
             else
162 163
             {
163
-                APP.ServerMsg = "网络异常!";
164
-                APP.UserInfo = new Model_UserInfo();
164
+                App.ServerMsg = "网络异常!";
165
+                App.UserInfo = new Model_UserInfo();
165 166
                 return 1;
166 167
             }
167 168
         }
@@ -177,7 +178,7 @@ namespace XHWK.WKTool.DAL
177 178
         /// </returns>
178 179
         public bool DownloadAvatar(string headPortrait, string SavePath)
179 180
         {
180
-            string url = APP.showImageUrl + headPortrait;
181
+            string url = App.showImageUrl + headPortrait;
181 182
             bool result = HttpHelper.GetDataGetHtml(url, SavePath, "");
182 183
             return result;
183 184
         }
@@ -191,25 +192,22 @@ namespace XHWK.WKTool.DAL
191 192
         /// </returns>
192 193
         public int TsubjectbookList()
193 194
         {
194
-            APP.TsubjectbookList = new List<Model_TsubjectbookList>();
195
+            App.TsubjectbookList = new List<Model_TsubjectbookList>();
195 196
             try
196 197
             {
197
-                string url = APP.apiUrl + "/sstudy/tsubjectbook/list";//地址
198
-                Dictionary<string, int> dic = new Dictionary<string, int>
199
-                {
200
-                    { "teacherid",APP.UserInfo.Userid}
201
-                };
198
+                string url = App.apiUrl + "/sstudy/tsubjectbook/list"; //地址
199
+                Dictionary<string, int> dic = new Dictionary<string, int> { { "teacherid", App.UserInfo.Userid } };
202 200
                 string body = JsonHelper.ToJson(dic);
203 201
                 ResultVo<List<Model_TsubjectbookList>> result = HttpHelper.PostAndRespSignle<ResultVo<List<Model_TsubjectbookList>>>(url, postData: body);
204 202
                 if (result != null)
205 203
                 {
206
-                    APP.ServerMsg = result.msg;
207
-                    APP.TsubjectbookList = result.obj;
204
+                    App.ServerMsg = result.msg;
205
+                    App.TsubjectbookList = result.obj;
208 206
                     return result.code;
209 207
                 }
210 208
                 else
211 209
                 {
212
-                    APP.ServerMsg = "网络异常!";
210
+                    App.ServerMsg = "网络异常!";
213 211
                     return 1;
214 212
                 }
215 213
             }
@@ -229,10 +227,10 @@ namespace XHWK.WKTool.DAL
229 227
         /// </returns>
230 228
         public int DirectorList(string lsbid, int belong, int createid)
231 229
         {
232
-            APP.DirectorList = new List<Model_DirectorList>();
230
+            App.DirectorList = new List<Model_DirectorList>();
233 231
             try
234 232
             {
235
-                string url = APP.apiUrl + "/sstudy/director/list";//地址
233
+                string url = App.apiUrl + "/sstudy/director/list"; //地址
236 234
                 Dictionary<string, string> dic = new Dictionary<string, string>
237 235
                 {
238 236
                     { "lsbid", lsbid },
@@ -243,13 +241,13 @@ namespace XHWK.WKTool.DAL
243 241
                 ResultVo<List<Model_DirectorList>> result = HttpHelper.PostAndRespSignle<ResultVo<List<Model_DirectorList>>>(url, postData: body);
244 242
                 if (result != null)
245 243
                 {
246
-                    APP.ServerMsg = result.msg;
247
-                    APP.DirectorList = result.obj;
244
+                    App.ServerMsg = result.msg;
245
+                    App.DirectorList = result.obj;
248 246
                     return result.code;
249 247
                 }
250 248
                 else
251 249
                 {
252
-                    APP.ServerMsg = "网络异常!";
250
+                    App.ServerMsg = "网络异常!";
253 251
                     return 1;
254 252
                 }
255 253
             }
@@ -269,10 +267,10 @@ namespace XHWK.WKTool.DAL
269 267
         /// </returns>
270 268
         public int ResourceAdd(Model_ResourceAdd model)
271 269
         {
272
-            APP.DirectorList = new List<Model_DirectorList>();
270
+            App.DirectorList = new List<Model_DirectorList>();
273 271
             try
274 272
             {
275
-                string url = APP.apiUrl + "/sstudy/resource/add";//地址
273
+                string url = App.apiUrl + "/sstudy/resource/add"; //地址
276 274
                 Dictionary<string, object> dic = new Dictionary<string, object>
277 275
                 {
278 276
                     //            converted: 0
@@ -322,18 +320,18 @@ namespace XHWK.WKTool.DAL
322 320
                 JObject obj = JObject.Parse(xmlDoc);
323 321
                 if (obj != null)
324 322
                 {
325
-                    APP.ServerMsg = obj["msg"].ToString();
323
+                    App.ServerMsg = obj["msg"].ToString();
326 324
                     return Convert.ToInt32(obj["code"].ToString());
327 325
                 }
328 326
                 else
329 327
                 {
330
-                    APP.ServerMsg = "网络异常!";
328
+                    App.ServerMsg = "网络异常!";
331 329
                     return 1;
332 330
                 }
333 331
             }
334 332
             catch (Exception ex)
335 333
             {
336
-                APP.ServerMsg = "网络异常!";
334
+                App.ServerMsg = "网络异常!";
337 335
                 LogHelper.WriteErrLog("【调用接口(RegisterController)】错误日志:" + ex.Message, ex);
338 336
                 return 1;
339 337
             }
@@ -348,8 +346,7 @@ namespace XHWK.WKTool.DAL
348 346
         /// </returns>
349 347
         public bool GetServiceAddress(string Schoolcode, out string Message)
350 348
         {
351
-            string url = APP.certapiUrl + "/school/find_code";//地址
352
-
349
+            string url = App.certapiUrl + "/school/find_code"; //地址
353 350
             Dictionary<string, object> dic = new Dictionary<string, object>
354 351
             {
355 352
                 { "schoolcode", Schoolcode}
@@ -363,8 +360,8 @@ namespace XHWK.WKTool.DAL
363 360
                     if (result.obj != null)
364 361
                     {
365 362
                         Message = result.msg;
366
-                        APP.ServiceAddress = result.obj;
367
-                        APP.SaveServiceAddressData();
363
+                        App.ServiceAddress = result.obj;
364
+                        App.SaveServiceAddressData();
368 365
                         return true;
369 366
                     }
370 367
                     else
@@ -386,4 +383,4 @@ namespace XHWK.WKTool.DAL
386 383
             }
387 384
         }
388 385
     }
389
-}
386
+}

+ 3
- 3
XHWK.WKTool/DeviceWindow.xaml.cs Просмотреть файл

@@ -93,7 +93,7 @@ namespace XHWK.WKTool
93 93
             if (allCamera.Count > 0)
94 94
             {
95 95
                 CmbCameraList.SelectedIndex = 0;
96
-                APP.CameraName = allCamera[0].MonikerString;
96
+                App.CameraName = allCamera[0].MonikerString;
97 97
             }
98 98
         }
99 99
 
@@ -118,7 +118,7 @@ namespace XHWK.WKTool
118 118
                 if (CmbCameraList.SelectedIndex >= 0)
119 119
                 {
120 120
                     var info = CmbCameraList.SelectedItem as FilterInfo;
121
-                    APP.CameraName = info.MonikerString;
121
+                    App.CameraName = info.MonikerString;
122 122
                     _camera = new VideoCaptureDevice(info.MonikerString);
123 123
                     //配置录像参数(宽,高,帧率,比特率等参数)VideoCapabilities这个属性会返回摄像头支持哪些配置
124 124
                     _camera.VideoResolution = _camera.VideoCapabilities[0];
@@ -455,4 +455,4 @@ namespace XHWK.WKTool
455 455
 
456 456
         #endregion 事件
457 457
     }
458
-}
458
+}

+ 5
- 5
XHWK.WKTool/JieTuWindow.xaml.cs Просмотреть файл

@@ -126,8 +126,8 @@ namespace ComeCapture
126 126
             {
127 127
                 k_hook.Stop();
128 128
                 Current.OnCancel();
129
-                APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
130
-                APP.W_XHMicroLessonSystemWindow.WindowType();
129
+                App.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
130
+                App.W_XHMicroLessonSystemWindow.WindowType();
131 131
                 Hide();
132 132
             }
133 133
         }
@@ -261,9 +261,9 @@ namespace ComeCapture
261 261
             {
262 262
                 Directory.CreateDirectory(tempPath);
263 263
             }
264
-            APP.ImgPath = string.Empty;
264
+            App.ImgPath = string.Empty;
265 265
             string imagePath = Path.Combine(tempPath, time + ".jpg");
266
-            APP.ImgPath = imagePath;
266
+            App.ImgPath = imagePath;
267 267
             //LogHelper.WriteInfoLog(imagePath);
268 268
             //this.Close();
269 269
             //string imagePath = ImageHelper.GetImagePath(out string serverSavePath);
@@ -544,4 +544,4 @@ namespace ComeCapture
544 544
         /// </summary>
545 545
         public event CloseJietuWindowClick click_closeJietuWindowClick;
546 546
     }
547
-}
547
+}

+ 22
- 22
XHWK.WKTool/KeyVerification.xaml.cs Просмотреть файл

@@ -49,7 +49,7 @@ namespace XHWK.WKTool
49 49
                 TxbKey.Text = _projectcode.Substring(0, 8);
50 50
                 return;
51 51
             }
52
-            APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationAddServering, InvokeActivationAddServerCompate);
52
+            App.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationAddServering, InvokeActivationAddServerCompate);
53 53
         }
54 54
 
55 55
         private string _projectcode = string.Empty;
@@ -64,7 +64,7 @@ namespace XHWK.WKTool
64 64
             string device = "pcwk";
65 65
             string mac = GetMacAddress();
66 66
             _serverReturnCode = _registerController.ActivationAdd(mac, device, _projectcode);
67
-            return APP.ServerMsg;
67
+            return App.ServerMsg;
68 68
         }
69 69
 
70 70
         /// <summary>
@@ -77,22 +77,23 @@ namespace XHWK.WKTool
77 77
             if (_serverReturnCode == 0)
78 78
             {
79 79
                 MessageWindow.Show("产品激活成功");
80
-                APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationAddHistoryServering,
81
-                    InvokeActivationAddHistoryServerCompate);
82
-                Dispatcher.Invoke(() =>
83
-                {
84
-                    Hide();
85
-                    CreateAMicroLessonWindow win = new CreateAMicroLessonWindow();
86
-                    //win.Topmost = true;
87
-                    win.Show();
88
-
89
-                    Thread.Sleep(200);
90
-                    Close();
91
-                });
80
+                App.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationAddHistoryServering, InvokeActivationAddHistoryServerCompate);
81
+                Dispatcher.Invoke
82
+                (
83
+                    () =>
84
+                    {
85
+                        Hide();
86
+                        CreateAMicroLessonWindow win = new CreateAMicroLessonWindow();
87
+                        //win.Topmost = true;
88
+                        win.Show();
89
+                        Thread.Sleep(200);
90
+                        Close();
91
+                    }
92
+                );
92 93
             }
93 94
             else
94 95
             {
95
-                MessageWindow.Show(APP.ServerMsg);
96
+                MessageWindow.Show(App.ServerMsg);
96 97
             }
97 98
         }
98 99
 
@@ -104,7 +105,7 @@ namespace XHWK.WKTool
104 105
         private object InvokeActivationAddHistoryServering()
105 106
         {
106 107
             _serverReturnCode = _registerController.ActivationAddHistory();
107
-            return APP.ServerMsg;
108
+            return App.ServerMsg;
108 109
         }
109 110
 
110 111
         /// <summary>
@@ -114,12 +115,11 @@ namespace XHWK.WKTool
114 115
         /// </returns>
115 116
         public void InvokeActivationAddHistoryServerCompate(object obj)
116 117
         {
117
-            if (!Directory.Exists(APP.DataPath))
118
+            if (!Directory.Exists(App.DataPath))
118 119
             {
119
-                Directory.CreateDirectory(APP.DataPath);
120
+                Directory.CreateDirectory(App.DataPath);
120 121
             }
121
-
122
-            string applicationData = APP.DataPath + "signatureTime.txt";
122
+            string applicationData = App.DataPath + "signatureTime.txt";
123 123
             string currentTime = DateTime.Now.ToLongDateString(); //当前时间
124 124
             File.WriteAllText(applicationData, currentTime, Encoding.Default); //存放签名验证日期
125 125
         }
@@ -161,8 +161,8 @@ namespace XHWK.WKTool
161 161
 
162 162
         private void CloseAction()
163 163
         {
164
-            APP.myloading.Show();
164
+            App.myloading.Show();
165 165
             new Thread(o => { Dispatcher.Invoke(() => { Environment.Exit(0); }); }).Start();
166 166
         }
167 167
     }
168
-}
168
+}

+ 24
- 26
XHWK.WKTool/LoginWindow.xaml.cs Просмотреть файл

@@ -32,16 +32,16 @@ namespace XHWK.WKTool
32 32
 
33 33
         public void Initialize()
34 34
         {
35
-            if (FileToolsCommon.IsExistFile(APP.DataPath + "accountNumber.txt"))
35
+            if (FileToolsCommon.IsExistFile(App.DataPath + "accountNumber.txt"))
36 36
             {
37
-                string accountNumber = System.IO.File.ReadAllText(APP.DataPath + "accountNumber.txt", Encoding.Default);
37
+                string accountNumber = System.IO.File.ReadAllText(App.DataPath + "accountNumber.txt", Encoding.Default);
38 38
                 if (!string.IsNullOrWhiteSpace(accountNumber))
39 39
                 {
40 40
                     TxbAccountNumber.Text = accountNumber;
41 41
                     CkSaveName.IsChecked = true;
42 42
                 }
43 43
             }
44
-            DataContext = APP.PageContextData;
44
+            DataContext = App.PageContextData;
45 45
         }
46 46
 
47 47
         /// <summary>
@@ -69,7 +69,7 @@ namespace XHWK.WKTool
69 69
         {
70 70
             #region 获取服务接口地址 --2021年7月9日赵耀
71 71
 
72
-            if (APP.ServiceAddress == null)
72
+            if (App.ServiceAddress == null)
73 73
             {
74 74
                 MessageWindow.Show("首次使用需设置服务地址。");
75 75
                 BtnServiceAddress_Click(null, null);
@@ -98,7 +98,7 @@ namespace XHWK.WKTool
98 98
                 MessageWindow.Show("密码长度不能高于16位");
99 99
                 return;
100 100
             }
101
-            APP.myloading.Show();
101
+            App.myloading.Show();
102 102
             Login();
103 103
         }
104 104
 
@@ -115,8 +115,8 @@ namespace XHWK.WKTool
115 115
             int code = xhapi.Login(accountNumber, password);
116 116
             if (code == 0)
117 117
             {
118
-                FileToolsCommon.CreateDirectory(APP.DataPath);
119
-                string applicationData = APP.DataPath + "accountNumber.txt";
118
+                FileToolsCommon.CreateDirectory(App.DataPath);
119
+                string applicationData = App.DataPath + "accountNumber.txt";
120 120
                 if (CkSaveName.IsChecked == true)
121 121
                 {
122 122
                     string accountNumbers = TxbAccountNumber.Text;
@@ -137,20 +137,19 @@ namespace XHWK.WKTool
137 137
                         Encoding.Default
138 138
                     ); //存放账号
139 139
                 }
140
-
141
-                APP.myloading.Hide();
140
+                App.myloading.Hide();
142 141
                 //UpdateSettingString("userName", txbAccountNumber.Text);
143
-                APP.IsLoginType = true;
142
+                App.IsLoginType = true;
144 143
                 TxbAccountNumber.Text = string.Empty;
145 144
                 pobPassword.Password = string.Empty;
146 145
 
147 146
                 #region 下载头像
148 147
 
149
-                string HeadpicPath = FileToolsCommon.GetFileAbsolutePath("/Data/" + APP.UserInfo.Username + ".png");
150
-                if (!string.IsNullOrWhiteSpace(APP.UserInfo.Headpic))
148
+                string HeadpicPath = FileToolsCommon.GetFileAbsolutePath("/Data/" + App.UserInfo.Username + ".png");
149
+                if (!string.IsNullOrWhiteSpace(App.UserInfo.Headpic))
151 150
                 {
152 151
                     //FileToolsCommon.
153
-                    xhapi.DownloadAvatar(APP.UserInfo.Headpic, HeadpicPath);
152
+                    xhapi.DownloadAvatar(App.UserInfo.Headpic, HeadpicPath);
154 153
                 }
155 154
 
156 155
                 #endregion 下载头像
@@ -159,9 +158,9 @@ namespace XHWK.WKTool
159 158
             }
160 159
             else
161 160
             {
162
-                APP.IsLoginType = false;
163
-                APP.myloading.Hide();
164
-                MessageWindow.Show(APP.ServerMsg);
161
+                App.IsLoginType = false;
162
+                App.myloading.Hide();
163
+                MessageWindow.Show(App.ServerMsg);
165 164
             }
166 165
         }
167 166
 
@@ -295,9 +294,8 @@ namespace XHWK.WKTool
295 294
             {
296 295
                 if (xhapi.GetServiceAddress(TbxServiceAddress.Text, out string Message))
297 296
                 {
298
-                    APP.SaveServiceAddressData();
299
-                    APP.SwitchAddress();
300
-
297
+                    App.SaveServiceAddressData();
298
+                    App.SwitchAddress();
301 299
                     MessageWindow.Show("设置成功!");
302 300
                     BtnCancel_Click(null, null);
303 301
                 }
@@ -322,11 +320,11 @@ namespace XHWK.WKTool
322 320
         /// </param>
323 321
         private void RbnIsOutsideSchool_Checked(object sender, RoutedEventArgs e)
324 322
         {
325
-            APP.IsOutsideSchool = true;
323
+            App.IsOutsideSchool = true;
326 324
             FileToolsCommon.SetConfigValue("IsOutsideSchool", "1");
327
-            if (APP.ServiceAddress != null)
325
+            if (App.ServiceAddress != null)
328 326
             {
329
-                APP.SwitchAddress();
327
+                App.SwitchAddress();
330 328
             }
331 329
         }
332 330
 
@@ -339,11 +337,11 @@ namespace XHWK.WKTool
339 337
         /// </param>
340 338
         private void RbnSchool_Checked(object sender, RoutedEventArgs e)
341 339
         {
342
-            APP.IsOutsideSchool = false;
340
+            App.IsOutsideSchool = false;
343 341
             FileToolsCommon.SetConfigValue("IsOutsideSchool", "0");
344
-            if (APP.ServiceAddress != null)
342
+            if (App.ServiceAddress != null)
345 343
             {
346
-                APP.SwitchAddress();
344
+                App.SwitchAddress();
347 345
             }
348 346
         }
349 347
 
@@ -351,4 +349,4 @@ namespace XHWK.WKTool
351 349
 
352 350
         #endregion 服务地址
353 351
     }
354
-}
352
+}

+ 322
- 290
XHWK.WKTool/MainWindow.xaml.cs
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 7
- 24
XHWK.WKTool/MinToolbar.xaml.cs Просмотреть файл

@@ -6,7 +6,7 @@ namespace XHWK.WKTool
6 6
     /// <summary>
7 7
     /// 最小化工具栏
8 8
     /// </summary>
9
-    public partial class MinToolbar : Window
9
+    public partial class MinToolbar
10 10
     {
11 11
         /// <summary>
12 12
         /// 屏幕宽
@@ -24,43 +24,26 @@ namespace XHWK.WKTool
24 24
             Topmost = true;
25 25
 
26 26
         }
27
+
27 28
         /// <summary>
28 29
         /// 初始化隐藏工具栏位置颜色
29 30
         /// </summary>
30 31
         /// <param name="top"></param>
31
-        /// <param name="ColorType"></param>
32
-        public void Initialize(double top,double ThisHeight)
32
+        /// <param name="thisHeight"></param>
33
+        public void Initialize(double top, double thisHeight)
33 34
         {
34 35
             var desktopWorkingArea = System.Windows.SystemParameters.WorkArea;
35 36
             Left = desktopWorkingArea.Right - this.Width + 7;
36 37
             Top = top;
38
+            // ReSharper disable once PossibleNullReferenceException
37 39
             BorderBlack.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF638AFF"));
38
-            Height = ThisHeight;
39
-            //if (ColorType == 0)//Blue
40
-            //{
41
-            //    BorderBlack.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3f6fff"));
42
-            //}
43
-            //else if (ColorType == 1)//Black
44
-            //{
45
-            //    BorderBlack.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#364044"));
46
-            //}
47
-            //else
48
-            //{
49
-            //    BorderBlack.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3f6fff"));
50
-            //}
51
-            // + 330;
52
-            //Console.WriteLine(this.Top + "min");
40
+            Height = thisHeight;
53 41
         }
54 42
 
55 43
         private void buttonMin_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
56 44
         {
57 45
             this.Hide();
58
-            APP.W_ScreenRecordingToolbarWindow.MaxToobar();
59
-        }
60
-
61
-        private void buttonMin_MouseEnter_1(object sender, System.Windows.Input.MouseEventArgs e)
62
-        {
63
-
46
+            App.W_ScreenRecordingToolbarWindow.MaxToobar();
64 47
         }
65 48
     }
66 49
 }

+ 10
- 10
XHWK.WKTool/PracticeWindow.xaml.cs Просмотреть файл

@@ -273,13 +273,13 @@ namespace XHWK.WKTool
273 273
 
274 274
         private void blackboard_canvas_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
275 275
         {
276
-            if (APP.W_ScreenRecordingToolbarWindow.flg == 10)
276
+            if (App.W_ScreenRecordingToolbarWindow.flg == 10)
277 277
             {
278
-                APP.W_ScreenRecordingToolbarWindow.flg = 0;
278
+                App.W_ScreenRecordingToolbarWindow.flg = 0;
279 279
             }
280 280
             else
281 281
             {
282
-                APP.W_ScreenRecordingToolbarWindow.flg = 1;
282
+                App.W_ScreenRecordingToolbarWindow.flg = 1;
283 283
             }
284 284
 
285 285
             ReturnPractice();
@@ -296,13 +296,13 @@ namespace XHWK.WKTool
296 296
             blackboard_canvas.Strokes.Clear();
297 297
             new Thread(() =>
298 298
             {
299
-                Dispatcher.Invoke(() => { APP.W_ScreenRecordingToolbarWindow.ModifyState(); });
299
+                Dispatcher.Invoke(() => { App.W_ScreenRecordingToolbarWindow.ModifyState(); });
300 300
                 _flg = 0;
301 301
                 Thread.Sleep(500);
302 302
                 Dispatcher.Invoke(() =>
303 303
                 {
304 304
                     Owner = null;
305
-                    APP.W_PracticeWindow.Hide();
305
+                    App.W_PracticeWindow.Hide();
306 306
                 });
307 307
             }).Start();
308 308
         }
@@ -356,13 +356,13 @@ namespace XHWK.WKTool
356 356
         /// </summary>
357 357
         public void InitTqlpPen()
358 358
         {
359
-            if (APP.TQLPenevents == null)
359
+            if (App.TQLPenevents == null)
360 360
             {
361
-                APP.TQLPenevents = new PenEvents(2);
361
+                App.TQLPenevents = new PenEvents(2);
362 362
             }
363 363
             else
364 364
             {
365
-                APP.TQLPenevents.InToType = 2;
365
+                App.TQLPenevents.InToType = 2;
366 366
             }
367 367
         }
368 368
 
@@ -372,7 +372,7 @@ namespace XHWK.WKTool
372 372
         public void TqlDown()
373 373
         {
374 374
             _isTqlPenDown = true;
375
-            APP.W_ScreenRecordingToolbarWindow.PenPractice();
375
+            App.W_ScreenRecordingToolbarWindow.PenPractice();
376 376
             if (_strokes != null && _strokes.StylusPoints.Count > 1)
377 377
             {
378 378
                 _isFirst = true;
@@ -485,4 +485,4 @@ namespace XHWK.WKTool
485 485
 
486 486
         #endregion 腾千里手写笔
487 487
     }
488
-}
488
+}

+ 12
- 12
XHWK.WKTool/ProductVerification.xaml.cs Просмотреть файл

@@ -28,7 +28,7 @@ namespace XHWK.WKTool
28 28
             InitializeComponent();
29 29
             WindowStartupLocation = WindowStartupLocation.CenterScreen;
30 30
             Topmost = true;
31
-            APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationDecryptServering, InvokeActivationDecryptServerCompate);
31
+            App.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationDecryptServering, InvokeActivationDecryptServerCompate);
32 32
         }
33 33
         /// <summary>
34 34
         /// 激活信息--验证签名是否过期-调用
@@ -36,7 +36,7 @@ namespace XHWK.WKTool
36 36
         /// <returns></returns>
37 37
         private object InvokeActivationDecryptServering()
38 38
         {
39
-            return APP.ServerMsg;
39
+            return App.ServerMsg;
40 40
         }
41 41
 
42 42
         /// <summary>
@@ -48,20 +48,20 @@ namespace XHWK.WKTool
48 48
             //解析
49 49
             try
50 50
             {
51
-                APP.Signature = System.IO.File.ReadAllText(APP.DataPath + "signature.txt", Encoding.Default);
52
-                string decrypt = DataProvider.TripleDESDecrypt(APP.Signature, APP.secretKey);
51
+                App.Signature = System.IO.File.ReadAllText(App.DataPath + "signature.txt", Encoding.Default);
52
+                string decrypt = DataProvider.TripleDESDecrypt(App.Signature, App.secretKey);
53 53
                 decrypt = decrypt.Replace("\u0001", "").Replace("\u0007", "").Trim();
54 54
                 Model_Signatures msgBean = JsonHelper.JsonToObj<Model_Signatures>(decrypt);
55 55
                 long currentTimeTimestamp = DataProvider.TimestampTotalSeconds(); //当前时间 时间戳
56 56
                 if (msgBean.endtime > currentTimeTimestamp)//条件成立  解析成功 code 在有效期内
57 57
                 {
58
-                    if (File.Exists(APP.DataPath + "signatureTime.txt"))
58
+                    if (File.Exists(App.DataPath + "signatureTime.txt"))
59 59
                     {
60
-                        string signatureTime = System.IO.File.ReadAllText(APP.DataPath + "signatureTime.txt", Encoding.Default);
61
-                        string currentTime = DateTime.Now.ToLongDateString().ToString();//当前时间  
60
+                        string signatureTime = System.IO.File.ReadAllText(App.DataPath + "signatureTime.txt", Encoding.Default);
61
+                        string currentTime = DateTime.Now.ToLongDateString().ToString(); //当前时间  
62 62
                         if (signatureTime != currentTime)
63 63
                         {
64
-                            APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationAddHistoryServering, InvokeActivationAddHistoryServerCompate);
64
+                            App.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationAddHistoryServering, InvokeActivationAddHistoryServerCompate);
65 65
                         }
66 66
                     }
67 67
                     Dispatcher.Invoke(new Action(() =>
@@ -109,7 +109,7 @@ namespace XHWK.WKTool
109 109
         private object InvokeActivationAddHistoryServering()
110 110
         {
111 111
             serverReturnCode = registerController.ActivationAddHistory();
112
-            return APP.ServerMsg;
112
+            return App.ServerMsg;
113 113
         }
114 114
 
115 115
         /// <summary>
@@ -118,11 +118,11 @@ namespace XHWK.WKTool
118 118
         /// <returns></returns>
119 119
         public void InvokeActivationAddHistoryServerCompate(object obj)
120 120
         {
121
-            if (!Directory.Exists(APP.DataPath))
121
+            if (!Directory.Exists(App.DataPath))
122 122
             {
123
-                Directory.CreateDirectory(APP.DataPath);
123
+                Directory.CreateDirectory(App.DataPath);
124 124
             }
125
-            string ApplicationData = APP.DataPath + "signatureTime.txt";
125
+            string ApplicationData = App.DataPath + "signatureTime.txt";
126 126
             string currentTime = DateTime.Now.ToLongDateString().ToString();//当前时间
127 127
             System.IO.File.WriteAllText(ApplicationData, currentTime, Encoding.Default);//存放签名验证日期
128 128
         }

+ 351
- 344
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 6
- 8
XHWK.WKTool/Skin/SkinConfig.cs Просмотреть файл

@@ -36,10 +36,10 @@ namespace XHWK.WKTool.Skin
36 36
             int Index = 0;
37 37
             try
38 38
             {
39
-                Index = int.Parse(APP.SkinStyle);
39
+                Index = int.Parse(App.SkinStyle);
40 40
             }
41
-            catch (Exception) {}
42
-            ChangeSkinResource(SkinList[int.Parse(APP.SkinStyle)]);
41
+            catch (Exception) { }
42
+            ChangeSkinResource(SkinList[int.Parse(App.SkinStyle)]);
43 43
         }
44 44
 
45 45
         /// <summary>
@@ -50,11 +50,9 @@ namespace XHWK.WKTool.Skin
50 50
         {
51 51
             if (Index < SkinList.Count)
52 52
             {
53
-                APP.SkinStyle = Index.ToString();
54
-
55
-                FileToolsCommon.SetConfigValue("SkinStyle", APP.SkinStyle);
56
-                ChangeSkinResource(SkinList[int.Parse(APP.SkinStyle)]);
57
-
53
+                App.SkinStyle = Index.ToString();
54
+                FileToolsCommon.SetConfigValue("SkinStyle", App.SkinStyle);
55
+                ChangeSkinResource(SkinList[int.Parse(App.SkinStyle)]);
58 56
             }
59 57
 
60 58
         }

+ 27
- 24
XHWK.WKTool/UControl/Uc_VideoItem.xaml.cs Просмотреть файл

@@ -60,9 +60,9 @@ namespace XHWK.WKTool.UControl
60 60
         public Uc_VideoItem(Model_Video model_Video)
61 61
         {
62 62
             InitializeComponent();
63
-            APP.IsUpLoad = false;
63
+            App.IsUpLoad = false;
64 64
             VideoModel = model_Video;
65
-            DataContext = APP.PageContextData;
65
+            DataContext = App.PageContextData;
66 66
             if (FileToolsCommon.IsExistFile(VideoModel.ThumbnailPath))
67 67
             {
68 68
                 ImgVideo.Source = ImageHelper.ReadBitmapImageFile(VideoModel.ThumbnailPath);// new BitmapImage(new Uri(VideoModel.ThumbnailPath));
@@ -169,12 +169,11 @@ namespace XHWK.WKTool.UControl
169 169
         private bool ModifyPathName(string FileGuid, string NewName, out string Errmessage)
170 170
         {
171 171
             Errmessage = "";
172
-            foreach (Model_WKData WKData in APP.WKDataList)
172
+            foreach (Model_WKData WKData in App.WKDataList)
173 173
             {
174 174
                 if (WKData.VideoList.Exists(x => x.FileGuid == FileGuid))
175 175
                 {
176 176
                     Model_Video model_Video = WKData.VideoList.Find(x => x.FileGuid == FileGuid);
177
-
178 177
                     string filePathName = model_Video.VideoPath;
179 178
                     string filePath = FileToolsCommon.GetDirectoryName(filePathName);
180 179
                     string newFilePathName = filePath + NewName;
@@ -197,7 +196,7 @@ namespace XHWK.WKTool.UControl
197 196
                         FileToolsCommon.DeleteFile(ThumbnailPathName);
198 197
                         FileToolsCommon.Copy(model_Video.ThumbnailPath, ThumbnailPathName);
199 198
                         model_Video.ThumbnailPath = ThumbnailPathName;
200
-                        APP.SaveWkData();
199
+                        App.SaveWkData();
201 200
                         return true;
202 201
                     }
203 202
                 }
@@ -224,7 +223,7 @@ namespace XHWK.WKTool.UControl
224 223
             MessageBoxResult dr = MessageWindow.Show("确定删除该视频?", "提示", MessageBoxButton.OKCancel);
225 224
             if (dr == MessageBoxResult.OK)
226 225
             {
227
-                foreach (Model_WKData wKData in APP.WKDataList)
226
+                foreach (Model_WKData wKData in App.WKDataList)
228 227
                 {
229 228
                     if (wKData.VideoList == null)
230 229
                     {
@@ -311,42 +310,46 @@ namespace XHWK.WKTool.UControl
311 310
         /// <param name="e"></param>
312 311
         private void BtnUpload_Click(object sender, RoutedEventArgs e)
313 312
         {
314
-            if (APP.IsLoginType == false)
313
+            if (App.IsLoginType == false)
315 314
             {
316 315
                 //登录
317 316
                 Click_UploadLogin();
318
-                if (APP.IsLoginType == false)
317
+                if (App.IsLoginType == false)
319 318
                 {
320 319
                     return;
321 320
                 }
322 321
             }
323
-            if (!APP.IsUpLoad)
322
+            if (!App.IsUpLoad)
324 323
             {
325
-                APP.IsUpLoad = true;
324
+                App.IsUpLoad = true;
326 325
                 //BtnUpload.IsEnabled = false;
327 326
                 //BtnUpload.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#9EA0A7"));
328 327
                 //BtnUpload.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#999999"));
329 328
                 DalUpload dAL_Upload = new DalUpload();
330
-
331 329
                 if (dAL_Upload.UploadVideo(VideoModel.FileGuid, out string ErrMessage))
332 330
                 {
333
-                    APP.IsUpLoad = false;
331
+                    App.IsUpLoad = false;
334 332
                     //MessageWindow.Show("视频上传服务器成功!");
335 333
                     if (W_UploadWindow == null)
336 334
                     {
337
-                        W_UploadWindow = new UploadWindow
338
-                        {
339
-                            Owner = APP.W_XHMicroLessonSystemWindow
340
-                        };
341
-                        W_UploadWindow.ChangeTextEvents += frm_ChangeTextEvents; ;
335
+                        W_UploadWindow = new UploadWindow { Owner = App.W_XHMicroLessonSystemWindow };
336
+                        W_UploadWindow.ChangeTextEvents += frm_ChangeTextEvents;
337
+                        ;
342 338
                     }
343 339
 
344 340
                     //long size = Convert.ToInt64(FileToolsCommon.GetFileSizeByMB(pageData.menuList[i].FilePath));
345
-                    W_UploadWindow.Initialize(TbName.Text, VideoModel.VideoSizebyte, VideoModel.VideoType.ToString(), VideoModel.FileGuid, 0);
341
+                    W_UploadWindow.Initialize
342
+                    (
343
+                        TbName.Text,
344
+                        VideoModel.VideoSizebyte,
345
+                        VideoModel.VideoType.ToString(),
346
+                        VideoModel.FileGuid,
347
+                        0
348
+                    );
346 349
                 }
347 350
                 else
348 351
                 {
349
-                    APP.IsUpLoad = false;
352
+                    App.IsUpLoad = false;
350 353
                     MessageWindow.Show(ErrMessage);
351 354
                 }
352 355
             }
@@ -374,14 +377,14 @@ namespace XHWK.WKTool.UControl
374 377
         /// <param name="e"></param>
375 378
         private void Button_Click(object sender, RoutedEventArgs e)
376 379
         {
377
-            if (APP.W_VideoClipWindow == null)
380
+            if (App.W_VideoClipWindow == null)
378 381
             {
379
-                APP.W_VideoClipWindow = new VideoClipWindow();
382
+                App.W_VideoClipWindow = new VideoClipWindow();
380 383
             }
381
-            if (APP.W_VideoClipWindow.InitClipVideo(VideoModel.VideoPath))
384
+            if (App.W_VideoClipWindow.InitClipVideo(VideoModel.VideoPath))
382 385
             {
383
-                APP.W_VideoClipWindow.ShowDialog();
386
+                App.W_VideoClipWindow.ShowDialog();
384 387
             }
385 388
         }
386 389
     }
387
-}
390
+}

+ 55
- 43
XHWK.WKTool/UploadWindow.xaml.cs Просмотреть файл

@@ -88,33 +88,35 @@ namespace XHWK.WKTool
88 88
             int code = xhapi.TsubjectbookList();
89 89
             if (code == 0)
90 90
             {
91
-                for (int i = 0; i < APP.TsubjectbookList.Count; i++)
91
+                for (int i = 0; i < App.TsubjectbookList.Count; i++)
92 92
                 {
93
-                    pageData.bookList.Add(new ComboBoxBean()
94
-                    {
95
-                        Key = APP.TsubjectbookList[i].Lsbid,
96
-                        //Value = $"{APP.TsubjectbookList[i].Subjectname}  {APP.TsubjectbookList[i].Bookname}"
97
-                        Value = $"{APP.TsubjectbookList[i].Subjectname}  {APP.TsubjectbookList[i].Versionname}  {APP.TsubjectbookList[i].Lsbname}"
98
-                    });
93
+                    pageData.bookList.Add
94
+                    (
95
+                        new ComboBoxBean()
96
+                        {
97
+                            Key = App.TsubjectbookList[i].Lsbid,
98
+                            //Value = $"{APP.TsubjectbookList[i].Subjectname}  {APP.TsubjectbookList[i].Bookname}"
99
+                            Value = $"{App.TsubjectbookList[i].Subjectname}  {App.TsubjectbookList[i].Versionname}  {App.TsubjectbookList[i].Lsbname}"
100
+                        }
101
+                    );
99 102
                 }
100 103
                 book_list.SelectedIndex = 0;
101 104
                 DataContext = pageData;
102
-
103
-                if (APP.TsubjectbookList.Count > 0)
105
+                if (App.TsubjectbookList.Count > 0)
104 106
                 {
105 107
                     Director();
106 108
                     ShowDialog();
107 109
                 }
108 110
                 else
109 111
                 {
110
-                    APP.IsUpLoad = false;
112
+                    App.IsUpLoad = false;
111 113
                     Hide();
112 114
                     MessageWindow.Show("暂无章节!");
113 115
                 }
114 116
             }
115 117
             else
116 118
             {
117
-                MessageWindow.Show(APP.ServerMsg);
119
+                MessageWindow.Show(App.ServerMsg);
118 120
             }
119 121
         }
120 122
 
@@ -128,34 +130,45 @@ namespace XHWK.WKTool
128 130
             {
129 131
                 selectIndex = 0;
130 132
             }
131
-            if (APP.TsubjectbookList.Count > selectIndex)
133
+            if (App.TsubjectbookList.Count > selectIndex)
132 134
             {
133
-                int code = xhapi.DirectorList(APP.TsubjectbookList[selectIndex].Lsbid, 4, APP.UserInfo.Userid);
135
+                int code = xhapi.DirectorList
136
+                (
137
+                    App.TsubjectbookList[selectIndex].Lsbid,
138
+                    4,
139
+                    App.UserInfo.Userid
140
+                );
134 141
                 if (code == 0)
135 142
                 {
136 143
                     pageData.zhangjieList.Clear();
137
-                    pageData.zhangjieList.Add(new ComboBoxBean()
138
-                    {
139
-                        Key = "0",
140
-                        Value = "全部",
141
-                        leaf = 1
142
-                    });
143
-                    for (int i = 0; i < APP.DirectorList.Count; i++)
144
-                    {
145
-                        Model_DirectorList item = APP.DirectorList[i];
146
-                        pageData.zhangjieList.Add(new ComboBoxBean()
144
+                    pageData.zhangjieList.Add
145
+                    (
146
+                        new ComboBoxBean()
147 147
                         {
148
-                            Key = item.directorid,
149
-                            Value = item.directorname,
150
-                            leaf = item.leaf
151
-                        });
148
+                            Key = "0",
149
+                            Value = "全部",
150
+                            leaf = 1
151
+                        }
152
+                    );
153
+                    for (int i = 0; i < App.DirectorList.Count; i++)
154
+                    {
155
+                        Model_DirectorList item = App.DirectorList[i];
156
+                        pageData.zhangjieList.Add
157
+                        (
158
+                            new ComboBoxBean()
159
+                            {
160
+                                Key = item.directorid,
161
+                                Value = item.directorname,
162
+                                leaf = item.leaf
163
+                            }
164
+                        );
152 165
                         addChild(item);
153 166
                     }
154 167
                     cmbTeachingMaterial.SelectedIndex = 0;
155 168
                 }
156 169
                 else
157 170
                 {
158
-                    MessageWindow.Show(APP.ServerMsg);
171
+                    MessageWindow.Show(App.ServerMsg);
159 172
                 }
160 173
             }
161 174
         }
@@ -220,21 +233,21 @@ namespace XHWK.WKTool
220 233
         /// </param>
221 234
         private void toolbar_list_SelectionChanged(object sender, SelectionChangedEventArgs e)
222 235
         {
223
-            if (APP.TsubjectbookList.Count > 0)
236
+            if (App.TsubjectbookList.Count > 0)
224 237
             {
225 238
                 Director();
226 239
             }
227 240
             else
228 241
             {
229 242
                 MessageWindow.Show("暂无章节!");
230
-                APP.IsUpLoad = false;
243
+                App.IsUpLoad = false;
231 244
                 Hide();
232 245
             }
233 246
         }
234 247
 
235 248
         private void BtnDown_Click(object sender, RoutedEventArgs e)
236 249
         {
237
-            APP.IsUpLoad = false;
250
+            App.IsUpLoad = false;
238 251
             Hide();
239 252
         }
240 253
 
@@ -307,22 +320,22 @@ namespace XHWK.WKTool
307 320
                         model_ResourceAdd = new Model_ResourceAdd
308 321
                         {
309 322
                             converted = 0,
310
-                            createid = APP.UserInfo.Userid,
323
+                            createid = App.UserInfo.Userid,
311 324
                             directorid = cmbTeachingMaterial.SelectedValue.ToString(),
312
-                            duration = APP.ResourceAddTwo.duration,
313
-                            subjectid = APP.TsubjectbookList[book_list.SelectedIndex].Subjectid,
325
+                            duration = App.ResourceAddTwo.duration,
326
+                            subjectid = App.TsubjectbookList[book_list.SelectedIndex].Subjectid,
314 327
                             imgUrl = "",
315 328
                             level = 2,
316 329
                             lsbid = book_list.SelectedValue.ToString(),
317
-                            mp4code = APP.ResourceAddTwo.mp4code,
330
+                            mp4code = App.ResourceAddTwo.mp4code,
318 331
                             resourcebelong = 3,
319 332
                             resourceclass = 5,
320
-                            resourcecover = APP.ResourceAddTwo.coverpath,
333
+                            resourcecover = App.ResourceAddTwo.coverpath,
321 334
                             resourcename = Resourcename,
322 335
                             resourcesize = Resourcesize,
323 336
                             resourcetype = 10,
324
-                            resourceurl = APP.ResourceAddTwo.videopath,
325
-                            schoolid = APP.UserInfo.Schoolid
337
+                            resourceurl = App.ResourceAddTwo.videopath,
338
+                            schoolid = App.UserInfo.Schoolid
326 339
                         };
327 340
                     });
328 341
 
@@ -346,13 +359,12 @@ namespace XHWK.WKTool
346 359
                     {
347 360
                         Dispatcher.Invoke(() =>
348 361
                         {
349
-                            foreach (Model_WKData Vdata in APP.WKDataList)
362
+                            foreach (Model_WKData Vdata in App.WKDataList)
350 363
                             {
351 364
                                 if (Vdata.VideoList == null)
352 365
                                 {
353 366
                                     continue;
354 367
                                 }
355
-
356 368
                                 foreach (Model_Video videoinfo in Vdata.VideoList)
357 369
                                 {
358 370
                                     if (videoinfo.FileGuid == Guid)
@@ -385,7 +397,7 @@ namespace XHWK.WKTool
385 397
                             cmbTeachingMaterial.IsEnabled = true;
386 398
                             times.Stop();
387 399
                             tip_outer.Visibility = Visibility.Collapsed;
388
-                            MessageWindow.Show(APP.ServerMsg);
400
+                            MessageWindow.Show(App.ServerMsg);
389 401
                         });
390 402
                     }
391 403
                 }
@@ -412,7 +424,7 @@ namespace XHWK.WKTool
412 424
                     times.Stop();
413 425
                     tip_outer.Visibility = Visibility.Collapsed;
414 426
                     MessageWindow.Show("无法上传视频,请检查与服务器链接状态!");
415
-                    APP.IsUpLoad = false;
427
+                    App.IsUpLoad = false;
416 428
                     Hide();
417 429
                     LogHelper.WriteErrLog("【UploadWindow】(BtnStart_Click)" + ex.Message, ex);
418 430
                 });
@@ -459,4 +471,4 @@ namespace XHWK.WKTool
459 471
             zhangjieList = new ObservableCollection<ComboBoxBean>();
460 472
         }
461 473
     }
462
-}
474
+}

+ 7
- 8
XHWK.WKTool/Utils/ImageOperationUtil.cs Просмотреть файл

@@ -105,18 +105,17 @@ namespace XHWK.WKTool.Utils
105 105
             {
106 106
                 System.Windows.Point point = e.GetPosition(imgCanvas);
107 107
                 imgCanvas.Margin = new Thickness(imgCanvas.Margin.Left + (point.X - initialPoint.X), imgCanvas.Margin.Top + (point.Y - initialPoint.Y), 0, 0);
108
-                APP.PageDrawList[APP.PageContextData.currpage - 1].ImageLocation = new TranslateTransform
108
+                App.PageDrawList[App.PageContextData.currpage - 1].ImageLocation = new TranslateTransform
109 109
                 {
110 110
                     X = imgCanvas.Margin.Left,
111 111
                     Y = imgCanvas.Margin.Top
112 112
                 };
113
-                APP.PageDrawList[APP.PageContextData.currpage - 1].ImageSizes = new ScaleTransform
113
+                App.PageDrawList[App.PageContextData.currpage - 1].ImageSizes = new ScaleTransform
114 114
                 {
115 115
                     CenterX = imgCanvas.ActualWidth,
116 116
                     CenterY = imgCanvas.ActualHeight
117 117
                 };
118
-
119
-                APP.PageDrawList[APP.PageContextData.currpage - 1].IsImageLocation = false;
118
+                App.PageDrawList[App.PageContextData.currpage - 1].IsImageLocation = false;
120 119
             }
121 120
         }
122 121
 
@@ -369,17 +368,17 @@ namespace XHWK.WKTool.Utils
369 368
                         default:
370 369
                             break;
371 370
                     }
372
-                    APP.PageDrawList[APP.PageContextData.currpage - 1].ImageLocation = new TranslateTransform
371
+                    App.PageDrawList[App.PageContextData.currpage - 1].ImageLocation = new TranslateTransform
373 372
                     {
374 373
                         X = imgCanvas.Margin.Left,
375 374
                         Y = imgCanvas.Margin.Top
376 375
                     };
377
-                    APP.PageDrawList[APP.PageContextData.currpage - 1].ImageSizes = new ScaleTransform
376
+                    App.PageDrawList[App.PageContextData.currpage - 1].ImageSizes = new ScaleTransform
378 377
                     {
379 378
                         CenterX = imgCanvas.ActualWidth,
380 379
                         CenterY = imgCanvas.ActualHeight
381 380
                     };
382
-                    APP.PageDrawList[APP.PageContextData.currpage - 1].IsImageLocation = false;
381
+                    App.PageDrawList[App.PageContextData.currpage - 1].IsImageLocation = false;
383 382
                 }
384 383
             }
385 384
             catch (Exception)
@@ -422,4 +421,4 @@ namespace XHWK.WKTool.Utils
422 421
 
423 422
         #endregion 图片拉伸移动
424 423
     }
425
-}
424
+}

+ 12
- 12
XHWK.WKTool/Utils/pen/TQLPen/PenEvents.cs Просмотреть файл

@@ -89,18 +89,18 @@ namespace XHWK.WKTool
89 89
             {
90 90
                 if (bConnected)
91 91
                 {
92
-                    APP.TQLPenStatus = true;
92
+                    App.TQLPenStatus = true;
93 93
                     //form.AddLog("智能笔已连接!");
94
-                    if (APP.W_XHMicroLessonSystemWindow != null)
95
-                        APP.W_XHMicroLessonSystemWindow.UpdateDevStatus();
94
+                    if (App.W_XHMicroLessonSystemWindow != null)
95
+                        App.W_XHMicroLessonSystemWindow.UpdateDevStatus();
96 96
                 }
97 97
                 else
98 98
                 {
99
-                    APP.TQLPenStatus = false;
99
+                    App.TQLPenStatus = false;
100 100
                     //form.DisConnect();
101 101
                     //form.AddLog("智能笔已断开连接!");
102
-                    if (APP.W_XHMicroLessonSystemWindow != null)
103
-                        APP.W_XHMicroLessonSystemWindow.UpdateDevStatus();
102
+                    if (App.W_XHMicroLessonSystemWindow != null)
103
+                        App.W_XHMicroLessonSystemWindow.UpdateDevStatus();
104 104
                 }
105 105
             }
106 106
             catch (Exception)
@@ -331,17 +331,17 @@ namespace XHWK.WKTool
331 331
                 }
332 332
                 else if (dot.type == DotType.PEN_DOWN)
333 333
                 {
334
-                    APP.W_XHMicroLessonSystemWindow.TqlDown();
334
+                    App.W_XHMicroLessonSystemWindow.TqlDown();
335 335
                 }
336 336
                 else if (dot.type == DotType.PEN_UP)
337 337
                 {
338
-                    APP.W_XHMicroLessonSystemWindow.TqlUp();
338
+                    App.W_XHMicroLessonSystemWindow.TqlUp();
339 339
                 }
340 340
                 else if (dot.type == DotType.PEN_MOVE)
341 341
                 {
342 342
                     double CX = (double)dot.x + (double)dot.fx / 100.00;
343 343
                     double CY = (double)dot.y + (double)dot.fy / 100.00;
344
-                    APP.W_XHMicroLessonSystemWindow.TqlPenWrite
344
+                    App.W_XHMicroLessonSystemWindow.TqlPenWrite
345 345
                     (
346 346
                         CX,
347 347
                         CY,
@@ -359,17 +359,17 @@ namespace XHWK.WKTool
359 359
                 }
360 360
                 else if (dot.type == DotType.PEN_DOWN)
361 361
                 {
362
-                    APP.W_PracticeWindow.TqlDown();
362
+                    App.W_PracticeWindow.TqlDown();
363 363
                 }
364 364
                 else if (dot.type == DotType.PEN_UP)
365 365
                 {
366
-                    APP.W_PracticeWindow.TqlUp();
366
+                    App.W_PracticeWindow.TqlUp();
367 367
                 }
368 368
                 else if (dot.type == DotType.PEN_MOVE)
369 369
                 {
370 370
                     double CX = (double)dot.x + (double)dot.fx / 100.00;
371 371
                     double CY = (double)dot.y + (double)dot.fy / 100.00;
372
-                    APP.W_PracticeWindow.TqlPenWrite
372
+                    App.W_PracticeWindow.TqlPenWrite
373 373
                     (
374 374
                         CX,
375 375
                         CY,

+ 29
- 15
XHWK.WKTool/Utils/pen/luobo/LuoBoPenUtil.cs Просмотреть файл

@@ -80,7 +80,7 @@ namespace XHWK.WKTool.Utils.luobo
80 80
 
81 81
         private void luobo_searchModeEvt(int modeType)
82 82
         {
83
-            if (APP.IsOutputInfoLog)
83
+            if (App.IsOutputInfoLog)
84 84
             {
85 85
                 if (modeType == 1)
86 86
                 {
@@ -184,7 +184,7 @@ namespace XHWK.WKTool.Utils.luobo
184 184
         {
185 185
             if (modeType == 1)
186 186
             {
187
-                if (APP.IsOutputInfoLog)
187
+                if (App.IsOutputInfoLog)
188 188
                 {
189 189
                     LogHelper.WriteInfoLog("当前为笔模式");
190 190
                 }
@@ -195,7 +195,7 @@ namespace XHWK.WKTool.Utils.luobo
195 195
             }
196 196
             else
197 197
             {
198
-                if (APP.IsOutputInfoLog)
198
+                if (App.IsOutputInfoLog)
199 199
                 {
200 200
                     LogHelper.WriteInfoLog("当前为鼠标模式");
201 201
                 }
@@ -239,12 +239,20 @@ namespace XHWK.WKTool.Utils.luobo
239 239
         private void luobo_deviceChangeEvt(bool bStatus, ushort uPid)
240 240
         {
241 241
             //throw new NotImplementedException();
242
-            Console.WriteLine("luobo_deviceChangeEvt");
242
+            Console.WriteLine(@"luobo_deviceChangeEvt");
243 243
             try
244 244
             {
245
-                if (APP.IsOutputInfoLog)
245
+                if (App.IsOutputInfoLog)
246 246
                 {
247
-                    LogHelper.WriteInfoLog(string.Format("设备状态{0} PID = {1}", bStatus, uPid));
247
+                    LogHelper.WriteInfoLog
248
+                    (
249
+                        string.Format
250
+                        (
251
+                            "设备状态{0} PID = {1}",
252
+                            bStatus,
253
+                            uPid
254
+                        )
255
+                    );
248 256
                 }
249 257
             }
250 258
             catch (Exception)
@@ -287,7 +295,7 @@ namespace XHWK.WKTool.Utils.luobo
287 295
             usbIsConnected = false;
288 296
             Thread.Sleep(200);
289 297
             int nDeviceCount = robotpenController.GetInstance()._GetDeviceCount();
290
-            if (APP.IsOutputInfoLog)
298
+            if (App.IsOutputInfoLog)
291 299
             {
292 300
                 LogHelper.WriteInfoLog(string.Format("当前有 {0} 个设备", nDeviceCount));
293 301
             }
@@ -316,8 +324,7 @@ namespace XHWK.WKTool.Utils.luobo
316 324
                             }
317 325
 
318 326
                             robotpenController.GetInstance()._Send(cmdId.GetConfig);
319
-
320
-                            APP.BoardStatus = true;
327
+                            App.BoardStatus = true;
321 328
                             try
322 329
                             {
323 330
                                 int banWidth = robotpenController.GetInstance().getWidth();
@@ -335,10 +342,17 @@ namespace XHWK.WKTool.Utils.luobo
335 342
                                         m_nDeviceH = banWidth;
336 343
                                     }
337 344
                                 }
338
-
339
-                                if (APP.IsOutputInfoLog)
345
+                                if (App.IsOutputInfoLog)
340 346
                                 {
341
-                                    LogHelper.WriteInfoLog(string.Format("手写板宽度为:{0} 高度为:{1}", m_nDeviceW, m_nDeviceH));
347
+                                    LogHelper.WriteInfoLog
348
+                                    (
349
+                                        string.Format
350
+                                        (
351
+                                            "手写板宽度为:{0} 高度为:{1}",
352
+                                            m_nDeviceW,
353
+                                            m_nDeviceH
354
+                                        )
355
+                                    );
342 356
                                 }
343 357
                             }
344 358
                             catch (Exception ex)
@@ -346,7 +360,7 @@ namespace XHWK.WKTool.Utils.luobo
346 360
                                 LogHelper.WriteErrLog("手写板大小获取失败:" + ex.Message, ex);
347 361
                             }
348 362
                             UpdateDevStatus();
349
-                            if (APP.IsOutputInfoLog)
363
+                            if (App.IsOutputInfoLog)
350 364
                             {
351 365
                                 LogHelper.WriteInfoLog(string.Format("设备类型:{0}", deviceType.ToString()));
352 366
                             }
@@ -363,7 +377,7 @@ namespace XHWK.WKTool.Utils.luobo
363 377
             }
364 378
             else
365 379
             {
366
-                APP.BoardStatus = false;
380
+                App.BoardStatus = false;
367 381
                 UpdateDevStatus();
368 382
             }
369 383
         }
@@ -467,4 +481,4 @@ namespace XHWK.WKTool.Utils.luobo
467 481
 
468 482
         #endregion 罗博智慧笔
469 483
     }
470
-}
484
+}

+ 10
- 4
XHWK.WKTool/VideoClipWindow.xaml.cs Просмотреть файл

@@ -24,8 +24,8 @@ namespace XHWK.WKTool
24 24
         public VideoClipWindow()
25 25
         {
26 26
             InitializeComponent();
27
-            Width = APP.W_XHMicroLessonSystemWindow.ActualWidth;
28
-            Height = APP.W_XHMicroLessonSystemWindow.ActualHeight;
27
+            Width = App.W_XHMicroLessonSystemWindow.ActualWidth;
28
+            Height = App.W_XHMicroLessonSystemWindow.ActualHeight;
29 29
         }
30 30
         public bool InitClipVideo(string _videoPath)
31 31
         {
@@ -46,7 +46,7 @@ namespace XHWK.WKTool
46 46
                     QS_Movie.Height = GridMovie.ActualWidth * Prop;
47 47
                     QS_Movie.Width = GridMovie.ActualWidth;
48 48
                 }
49
-                DataContext = APP.PageContextData;
49
+                DataContext = App.PageContextData;
50 50
             }
51 51
             else
52 52
             {
@@ -241,7 +241,13 @@ namespace XHWK.WKTool
241 241
                 string startTime = startTP.ToString(@"hh\:mm\:ss\.fff");
242 242
                 TimeSpan EndTP = new TimeSpan(0, 0, 0, 0, (int)UcSlider.EndValue);
243 243
                 string EndTime = EndTP.ToString(@"hh\:mm\:ss\.fff");
244
-                APP.FFmpeg.ClipVideo(VideoPath, startTime, EndTime, filePath);
244
+                App.FFmpeg.ClipVideo
245
+                (
246
+                    VideoPath,
247
+                    startTime,
248
+                    EndTime,
249
+                    filePath
250
+                );
245 251
                 MessageBoxResult br = MessageWindow.Show("剪辑完成是否打开文件夹?", "剪辑", MessageBoxButton.OKCancel);
246 252
                 if (br == MessageBoxResult.OK)
247 253
                 {

+ 2
- 3
XHWK.WKTool/Welcome.xaml.cs Просмотреть файл

@@ -14,8 +14,7 @@ namespace XHWK.WKTool
14 14
 
15 15
             //new DeviceWindow().Show();
16 16
             //Close();
17
-
18
-            if (!File.Exists(APP.DataPath + "signature.txt"))//上次登录时间为空 或者签名为空 或者上次登录时间不是今天   都需要输入密匙验证 ,否则只验证本地的签名
17
+            if (!File.Exists(App.DataPath + "signature.txt")) //上次登录时间为空 或者签名为空 或者上次登录时间不是今天   都需要输入密匙验证 ,否则只验证本地的签名
19 18
             {
20 19
                 new KeyVerification().Show();
21 20
                 Close();
@@ -27,4 +26,4 @@ namespace XHWK.WKTool
27 26
             }
28 27
         }
29 28
     }
30
-}
29
+}

+ 1
- 1
XHWK.WKTool/XHWK.WKTool.csproj.user Просмотреть файл

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 3
   <PropertyGroup>
4
-    <ProjectView>ShowAllFiles</ProjectView>
4
+    <ProjectView>ProjectFiles</ProjectView>
5 5
   </PropertyGroup>
6 6
 </Project>

Загрузка…
Отмена
Сохранить