Browse Source

代码优化

master
张剑 10 months ago
parent
commit
06eee2505d
42 changed files with 1864 additions and 2071 deletions
  1. 1
    1
      XHWK.WKTool/App.config
  2. 66
    62
      XHWK.WKTool/App.xaml.cs
  3. 3
    3
      XHWK.WKTool/AppUpdateWin.xaml
  4. 3
    3
      XHWK.WKTool/CountdownWindow.xaml
  5. 13
    15
      XHWK.WKTool/CountdownWindow.xaml.cs
  6. 0
    371
      XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs
  7. 1
    1
      XHWK.WKTool/CreateWin.xaml
  8. 404
    0
      XHWK.WKTool/CreateWin.xaml.cs
  9. 7
    7
      XHWK.WKTool/DeviceWindow.xaml
  10. 4
    5
      XHWK.WKTool/JieTuWindow.xaml
  11. 112
    145
      XHWK.WKTool/JieTuWindow.xaml.cs
  12. 3
    3
      XHWK.WKTool/KeyVerification.xaml
  13. 1
    1
      XHWK.WKTool/KeyVerification.xaml.cs
  14. 43
    46
      XHWK.WKTool/LoadDialog.xaml
  15. 3
    5
      XHWK.WKTool/LoadDialog.xaml.cs
  16. 20
    58
      XHWK.WKTool/LoginWindow.xaml.cs
  17. 8
    8
      XHWK.WKTool/MainWindow.xaml
  18. 230
    334
      XHWK.WKTool/MainWindow.xaml.cs
  19. 3
    3
      XHWK.WKTool/MessageWindow.xaml
  20. 64
    49
      XHWK.WKTool/MessageWindow.xaml.cs
  21. 9
    9
      XHWK.WKTool/MinToolbar.xaml.cs
  22. 2
    3
      XHWK.WKTool/PracticeWindow.xaml
  23. 135
    133
      XHWK.WKTool/PracticeWindow.xaml.cs
  24. 9
    46
      XHWK.WKTool/ProductVerification.xaml
  25. 57
    55
      XHWK.WKTool/ProductVerification.xaml.cs
  26. 3
    3
      XHWK.WKTool/PromptWindow.xaml
  27. 12
    16
      XHWK.WKTool/PromptWindow.xaml.cs
  28. 2
    3
      XHWK.WKTool/ResourceDictionary.xaml
  29. 3
    4
      XHWK.WKTool/ScreenRecordingToolbarWindow.xaml
  30. 69
    91
      XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs
  31. 7
    7
      XHWK.WKTool/Skin/SkinDictionary_TechnologyBlue.xaml
  32. 6
    6
      XHWK.WKTool/Skin/SkinDictionary_White.xaml
  33. 11
    11
      XHWK.WKTool/UploadWindow.xaml
  34. 102
    92
      XHWK.WKTool/UploadWindow.xaml.cs
  35. 0
    0
      XHWK.WKTool/Utils/AESHelper.cs
  36. 205
    306
      XHWK.WKTool/VideoClipWindow.xaml
  37. 176
    112
      XHWK.WKTool/VideoClipWindow.xaml.cs
  38. 58
    43
      XHWK.WKTool/View/UControl/UC_MultiRangeSlider.xaml
  39. 2
    2
      XHWK.WKTool/View/UControl/Uc_VideoItem.xaml
  40. 0
    1
      XHWK.WKTool/Welcome.xaml
  41. 3
    4
      XHWK.WKTool/Welcome.xaml.cs
  42. 4
    4
      XHWK.WKTool/XHWK.WKTool.csproj

+ 1
- 1
XHWK.WKTool/App.config View File

@@ -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
     <!--版本号-->
10 10
     <add key="VersionCode" value="133" />
11 11
     <add key="VersionName" value="3.13.6" />

+ 66
- 62
XHWK.WKTool/App.xaml.cs View File

@@ -1,5 +1,7 @@
1 1
 using ComeCapture;
2
+
2 3
 using Common.system;
4
+
3 5
 using System;
4 6
 using System.Collections.Generic;
5 7
 using System.Diagnostics;
@@ -9,6 +11,7 @@ using System.Reflection;
9 11
 using System.Security.Principal;
10 12
 using System.Threading.Tasks;
11 13
 using System.Windows;
14
+
12 15
 using XHWK.Model;
13 16
 using XHWK.WKTool.Helpers;
14 17
 using XHWK.WKTool.Skin;
@@ -16,7 +19,9 @@ using XHWK.WKTool.Skin;
16 19
 namespace XHWK.WKTool
17 20
 {
18 21
     using System.Runtime.InteropServices;
22
+
19 23
     using system;
24
+
20 25
     using XHWK.WKTool.Utils;
21 26
 
22 27
     public partial class App
@@ -26,7 +31,7 @@ namespace XHWK.WKTool
26 31
         #region 更新需改动
27 32
 
28 33
         /// <summary>
29
-        /// 是否为测试版
34
+        ///     是否为测试版
30 35
         /// </summary>
31 36
         public static bool isDebug = FileToolsCommon.GetConfigValue("IsDebug") != "0";
32 37
 
@@ -35,32 +40,32 @@ namespace XHWK.WKTool
35 40
         #region 接口地址
36 41
 
37 42
         /// <summary>
38
-        /// 是否为校外接口
43
+        ///     是否为校外接口
39 44
         /// </summary>
40 45
         public static bool IsOutsideSchool = FileToolsCommon.GetConfigValue("IsOutsideSchool") == "1";
41 46
 
42 47
         /// <summary>
43
-        /// 服务地址
48
+        ///     服务地址
44 49
         /// </summary>
45 50
         public static ModelServiceAddress ServiceAddress;
46 51
 
47 52
         /// <summary>
48
-        /// 接口地址
53
+        ///     接口地址
49 54
         /// </summary>
50 55
         public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : "http://schoolapi.xhkjedu.com";
51 56
 
52 57
         /// <summary>
53
-        /// 图片地址
58
+        ///     图片地址
54 59
         /// </summary>
55 60
         public static string uploadUrl = isDebug ? "http://schoolfiletest.xhkjedu.com/" : "http://schoolfile.xhkjedu.com/";
56 61
 
57 62
         /// <summary>
58
-        /// 展示文件
63
+        ///     展示文件
59 64
         /// </summary>
60 65
         public static string showImageUrl = isDebug ? "http://schoolstatictest.xhkjedu.com/static/" : "http://schoolstatic.xhkjedu.com/static/";
61 66
 
62 67
         /// <summary>
63
-        /// 认证接口地址
68
+        ///     认证接口地址
64 69
         /// </summary>
65 70
         public static string certapiUrl = isDebug ? "http://scapitest.xhkjedu.com" : "http://scapi.xhkjedu.com";
66 71
 
@@ -69,37 +74,37 @@ namespace XHWK.WKTool
69 74
         #region 配置项
70 75
 
71 76
         /// <summary>
72
-        /// 是否输出测试记录日志
77
+        ///     是否输出测试记录日志
73 78
         /// </summary>
74 79
         public static bool IsOutputInfoLog = FileToolsCommon.GetConfigValue("IsOutputInfoLog") != "0";
75 80
 
76 81
         /// <summary>
77
-        /// 是否隐藏录屏工具栏
82
+        ///     是否隐藏录屏工具栏
78 83
         /// </summary>
79 84
         public static bool IsHideSRTool = FileToolsCommon.GetConfigValue("IsHideSRTool") != "0";
80 85
 
81 86
         /// <summary>
82
-        /// 皮肤样式 0白 1蓝 2黑色
87
+        ///     皮肤样式 0白 1蓝 2黑色
83 88
         /// </summary>
84 89
         public static string SkinStyle = FileToolsCommon.GetConfigValue("SkinStyle");
85 90
 
86 91
         /// <summary>
87
-        /// 数据存放目录
92
+        ///     数据存放目录
88 93
         /// </summary>
89 94
         public static string DataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\XHMicroLesson\\";
90 95
 
91 96
         /// <summary>
92
-        /// 摄像头位置
97
+        ///     摄像头位置
93 98
         /// </summary>
94 99
         public static string CameraPosition = string.Empty;
95 100
 
96 101
         /// <summary>
97
-        /// 摄像头名
102
+        ///     摄像头名
98 103
         /// </summary>
99 104
         public static string CameraName = "";
100 105
 
101 106
         /// <summary>
102
-        /// 麦克风名
107
+        ///     麦克风名
103 108
         /// </summary>
104 109
         public static string MicrophoneName = "";
105 110
 
@@ -108,64 +113,64 @@ namespace XHWK.WKTool
108 113
         #region 记录数据
109 114
 
110 115
         /// <summary>
111
-        /// 全局页面数据变量
116
+        ///     全局页面数据变量
112 117
         /// </summary>
113 118
         public static readonly ModelPage PageContextData = new Model.ModelPage();
114 119
 
115 120
         /// <summary>
116
-        /// 录屏工具
121
+        ///     录屏工具
117 122
         /// </summary>
118 123
         public static FFMpeg FFmpeg = new FFMpeg();
119 124
 
120 125
         /// <summary>
121
-        /// 后台线程帮助类
126
+        ///     后台线程帮助类
122 127
         /// </summary>
123 128
         public static BackgroundWorkerHelper BackgroundWorkerHelper => BackgroundWorkerHelper.GetInstance();
124 129
 
125 130
         /// <summary>
126
-        /// 签名
131
+        ///     签名
127 132
         /// </summary>
128 133
         public static string Signature = "";
129 134
 
130 135
         public static string secretKey = "nanhuakaizhangjianwangni";
131 136
 
132 137
         /// <summary>
133
-        /// 用户信息
138
+        ///     用户信息
134 139
         /// </summary>
135 140
         public static ModelUserInfo UserInfo;
136 141
 
137 142
         /// <summary>
138
-        /// 接口返回消息
143
+        ///     接口返回消息
139 144
         /// </summary>
140 145
         public static string ServerMsg = string.Empty;
141 146
 
142 147
         /// <summary>
143
-        /// 登录状态 false 未登录 true已登录
148
+        ///     登录状态 false 未登录 true已登录
144 149
         /// </summary>
145 150
         public static bool IsLoginType = false;
146 151
 
147 152
         /// <summary>
148
-        /// 截图地址
153
+        ///     截图地址
149 154
         /// </summary>
150 155
         public static string ImgPath = string.Empty;
151 156
 
152 157
         /// <summary>
153
-        /// 教材列表
158
+        ///     教材列表
154 159
         /// </summary>
155 160
         public static List<ModelTsubjectbookList> TsubjectbookList = null;
156 161
 
157 162
         /// <summary>
158
-        /// 章节列表
163
+        ///     章节列表
159 164
         /// </summary>
160 165
         public static List<ModelDirectorList> DirectorList = null;
161 166
 
162 167
         /// <summary>
163
-        /// 上传个人空间 入参
168
+        ///     上传个人空间 入参
164 169
         /// </summary>
165 170
         public static ModelResourceAddTwo ResourceAddTwo = null;
166 171
 
167 172
         /// <summary>
168
-        /// 是否正在上传
173
+        ///     是否正在上传
169 174
         /// </summary>
170 175
         public static bool IsUpLoad = false;
171 176
 
@@ -174,22 +179,22 @@ namespace XHWK.WKTool
174 179
         #region 微课数据记录
175 180
 
176 181
         /// <summary>
177
-        /// 用户微课列表模型
182
+        ///     用户微课列表模型
178 183
         /// </summary>
179 184
         public static List<ModelWkData> WKDataList;
180 185
 
181 186
         /// <summary>
182
-        /// 微课模型
187
+        ///     微课模型
183 188
         /// </summary>
184 189
         public static ModelWkData WKData;
185 190
 
186 191
         /// <summary>
187
-        /// 微课视频列表
192
+        ///     微课视频列表
188 193
         /// </summary>
189 194
         public static List<ModelVideo> VideoList;
190 195
 
191 196
         /// <summary>
192
-        /// 画板模型
197
+        ///     画板模型
193 198
         /// </summary>
194 199
         public static List<ModelDrawData> PageDrawList = new List<ModelDrawData>();
195 200
 
@@ -198,17 +203,17 @@ namespace XHWK.WKTool
198 203
         #region 点阵笔
199 204
 
200 205
         /// <summary>
201
-        /// 笔序号
206
+        ///     笔序号
202 207
         /// </summary>
203 208
         public static string PenSerial;
204 209
 
205 210
         /// <summary>
206
-        /// 笔状态,是否已连接
211
+        ///     笔状态,是否已连接
207 212
         /// </summary>
208 213
         public static bool PenStatus = false;
209 214
 
210 215
         /// <summary>
211
-        /// 手写板状态,是否已连接
216
+        ///     手写板状态,是否已连接
212 217
         /// </summary>
213 218
         public static bool BoardStatus = false;
214 219
 
@@ -221,12 +226,12 @@ namespace XHWK.WKTool
221 226
         ///// </summary>
222 227
         //public static DAL_TmatrixCode dAL_TmatrixCode;
223 228
         /// <summary>
224
-        /// 腾千里手写笔事件
229
+        ///     腾千里手写笔事件
225 230
         /// </summary>
226 231
         public static PenEvents TQLPenevents;
227 232
 
228 233
         /// <summary>
229
-        /// 腾千里手写笔是否已连接
234
+        ///     腾千里手写笔是否已连接
230 235
         /// </summary>
231 236
         public static bool TQLPenStatus = false;
232 237
 
@@ -250,57 +255,57 @@ namespace XHWK.WKTool
250 255
         #region 页面
251 256
 
252 257
         /// <summary>
253
-        /// 主页面
258
+        ///     主页面
254 259
         /// </summary>
255 260
         public static MainWindow W_XHMicroLessonSystemWindow = null;
256 261
 
257 262
         /// <summary>
258
-        /// 倒计时窗口
263
+        ///     倒计时窗口
259 264
         /// </summary>
260 265
         public static CountdownWindow W_CountdownWindow = null;
261 266
 
262 267
         /// <summary>
263
-        /// 录像工具栏
268
+        ///     录像工具栏
264 269
         /// </summary>
265 270
         public static ScreenRecordingToolbarWindow W_ScreenRecordingToolbarWindow = null;
266 271
 
267 272
         /// <summary>
268
-        /// 登录
273
+        ///     登录
269 274
         /// </summary>
270 275
         public static LoginWindow W_LoginWindow = null;
271 276
 
272 277
         /// <summary>
273
-        /// 截图
278
+        ///     截图
274 279
         /// </summary>
275 280
         public static JieTuWindow W_JieTuWindow = null;
276 281
 
277 282
         /// <summary>
278
-        /// 批注
283
+        ///     批注
279 284
         /// </summary>
280 285
         public static PracticeWindow W_PracticeWindow = null;
281 286
 
282 287
         /// <summary>
283
-        /// 提示窗口
288
+        ///     提示窗口
284 289
         /// </summary>
285 290
         public static PromptWindow W_PromptWindow = null;
286 291
 
287 292
         /// <summary>
288
-        /// loding页面
293
+        ///     loding页面
289 294
         /// </summary>
290 295
         public static LoadDialog myloading;
291 296
 
292 297
         /// <summary>
293
-        /// 上传页面
298
+        ///     上传页面
294 299
         /// </summary>
295 300
         public static UploadWindow W_UploadWindow = null;
296 301
 
297 302
         /// <summary>
298
-        /// 最小化工具栏
303
+        ///     最小化工具栏
299 304
         /// </summary>
300 305
         public static MinToolbar W_MinToolbar = null;
301 306
 
302 307
         /// <summary>
303
-        /// 视频剪辑
308
+        ///     视频剪辑
304 309
         /// </summary>
305 310
         public static VideoClipWindow W_VideoClipWindow = null;
306 311
 
@@ -365,7 +370,7 @@ namespace XHWK.WKTool
365 370
                     }
366 371
                     //退出
367 372
                     //Current.Shutdown();
368
-                    Application.Current.Shutdown();
373
+                    Current.Shutdown();
369 374
                 }
370 375
             }
371 376
             catch (Exception ex)
@@ -389,23 +394,23 @@ namespace XHWK.WKTool
389 394
             Process current = Process.GetCurrentProcess();
390 395
             //获取欲启动进程名
391 396
             string strProcessName = Process.GetCurrentProcess().ProcessName;
392
-            var processList = Process.GetProcessesByName(strProcessName);
397
+            Process[] processList = Process.GetProcessesByName(strProcessName);
393 398
             if (processList.Length <= 1)
394 399
             {
395 400
                 return;
396 401
             }
397 402
             MessageWindow.Show("当前程序已在运行,请勿重复运行。");
398
-            foreach (var process in processList)
403
+            foreach (Process process in processList)
399 404
             {
400 405
                 if (process.Id == current.Id) continue;
401 406
                 int hWnd = FindWindow(null, process.MainWindowTitle);
402 407
                 SetForegroundWindow(hWnd);
403 408
             }
404
-            Application.Current.Shutdown(); //退出新打开的程序
409
+            Current.Shutdown(); //退出新打开的程序
405 410
         }
406 411
 
407 412
         /// <summary>
408
-        /// 杀死正在运行的ffmpeg
413
+        ///     杀死正在运行的ffmpeg
409 414
         /// </summary>
410 415
         public static void Killffmpeg()
411 416
         {
@@ -434,8 +439,7 @@ namespace XHWK.WKTool
434 439
         {
435 440
             try
436 441
             {
437
-                var exception = e.Exception as Exception;
438
-                if (exception != null)
442
+                if (e.Exception is Exception exception)
439 443
                 {
440 444
                     HandleException(exception);
441 445
                 }
@@ -493,7 +497,7 @@ namespace XHWK.WKTool
493 497
         #region 数据保存和读取
494 498
 
495 499
         /// <summary>
496
-        /// 保存微课信息
500
+        ///     保存微课信息
497 501
         /// </summary>
498 502
         public static void SaveWkData()
499 503
         {
@@ -524,7 +528,7 @@ namespace XHWK.WKTool
524 528
         }
525 529
 
526 530
         /// <summary>
527
-        /// 读取微课信息
531
+        ///     读取微课信息
528 532
         /// </summary>
529 533
         public static void ReadWkData(string wkPath)
530 534
         {
@@ -559,7 +563,7 @@ namespace XHWK.WKTool
559 563
         }
560 564
 
561 565
         /// <summary>
562
-        /// 保存画板数据
566
+        ///     保存画板数据
563 567
         /// </summary>
564 568
         public static void SaveDraw()
565 569
         {
@@ -586,7 +590,7 @@ namespace XHWK.WKTool
586 590
         }
587 591
 
588 592
         /// <summary>
589
-        /// 读取文件
593
+        ///     读取文件
590 594
         /// </summary>
591 595
         public static void ReadDrawData()
592 596
         {
@@ -615,7 +619,7 @@ namespace XHWK.WKTool
615 619
         #region 服务地址数据
616 620
 
617 621
         /// <summary>
618
-        /// 服务地址存储到本地
622
+        ///     服务地址存储到本地
619 623
         /// </summary>
620 624
         public static void SaveServiceAddressData()
621 625
         {
@@ -640,7 +644,7 @@ namespace XHWK.WKTool
640 644
         }
641 645
 
642 646
         /// <summary>
643
-        /// 从本地读取服务地址
647
+        ///     从本地读取服务地址
644 648
         /// </summary>
645 649
         public static void ReadServiceAddressData()
646 650
         {
@@ -665,7 +669,7 @@ namespace XHWK.WKTool
665 669
         }
666 670
 
667 671
         /// <summary>
668
-        /// 切换校内外网
672
+        ///     切换校内外网
669 673
         /// </summary>
670 674
         public static void SwitchAddress()
671 675
         {
@@ -684,7 +688,7 @@ namespace XHWK.WKTool
684 688
         #endregion 服务地址数据
685 689
 
686 690
         /// <summary>
687
-        /// 内存释放压缩
691
+        ///     内存释放压缩
688 692
         /// </summary>
689 693
         /// <param name="e">
690 694
         /// </param>
@@ -704,4 +708,4 @@ namespace XHWK.WKTool
704 708
             Environment.Exit(0);
705 709
         }
706 710
     }
707
-}
711
+}

+ 3
- 3
XHWK.WKTool/AppUpdateWin.xaml View File

@@ -21,7 +21,7 @@
21 21
         <views:ZClippingBorder
22 22
             Margin="0"
23 23
             Background="#fafafa"
24
-            BorderBrush="#3f6fff"
24
+            BorderBrush="#4597FF"
25 25
             BorderThickness="1"
26 26
             CornerRadius="0">
27 27
 
@@ -102,7 +102,7 @@
102 102
                                     BorderBrush="{TemplateBinding Control.BorderBrush}"
103 103
                                     BorderThickness="0"
104 104
                                     CornerRadius="21">
105
-                                    <Border.Background>#3f6fff</Border.Background>
105
+                                    <Border.Background>#4597FF</Border.Background>
106 106
                                     <ContentPresenter
107 107
                                         HorizontalAlignment="Center"
108 108
                                         VerticalAlignment="Center"
@@ -140,7 +140,7 @@
140 140
                                 x:Name="Mprogress"
141 141
                                 BorderThickness="0"
142 142
                                 Cursor=""
143
-                                Foreground="#3f6fff"
143
+                                Foreground="#4597FF"
144 144
                                 Maximum="100"
145 145
                                 Minimum="0" />
146 146
                         </views:ZClippingBorder>

+ 3
- 3
XHWK.WKTool/CountdownWindow.xaml View File

@@ -19,13 +19,13 @@
19 19
     <Grid>
20 20
 
21 21
         <Image
22
-            x:Name="imgLoding"
22
+            x:Name="ImgLoding"
23 23
             Width="300"
24 24
             HorizontalAlignment="Center"
25 25
             VerticalAlignment="Center"
26 26
             Source=".\Images\countdown3_1.png" />
27 27
         <Border
28
-            x:Name="borShortcut"
28
+            x:Name="BorShortcut"
29 29
             Width="550"
30 30
             Height="60"
31 31
             Margin="0,450,0,0"
@@ -34,7 +34,7 @@
34 34
             Opacity="0.3"
35 35
             Visibility="Hidden" />
36 36
         <Label
37
-            x:Name="lblShortcut"
37
+            x:Name="LblShortcut"
38 38
             Height="60"
39 39
             Margin="0,450,0,0"
40 40
             HorizontalContentAlignment="Center"

+ 13
- 15
XHWK.WKTool/CountdownWindow.xaml.cs View File

@@ -10,7 +10,7 @@ namespace XHWK.WKTool
10 10
     using System.Threading.Tasks;
11 11
 
12 12
     /// <summary>
13
-    /// 录屏等待 CountdownWindow.xaml 的交互逻辑
13
+    ///     录屏等待 CountdownWindow.xaml 的交互逻辑
14 14
     /// </summary>
15 15
     public partial class CountdownWindow
16 16
     {
@@ -19,20 +19,20 @@ namespace XHWK.WKTool
19 19
         public CountdownWindow()
20 20
         {
21 21
             InitializeComponent();
22
-            foreach (var imgName in _imgNames)
22
+            foreach (string imgName in _imgNames)
23 23
             {
24 24
                 _images.Add(new BitmapImage(new Uri("pack://application:,,/Images/" + imgName)));
25 25
             }
26 26
         }
27 27
 
28 28
         /// <summary>
29
-        /// 计时器
29
+        ///     计时器
30 30
         /// </summary>
31 31
         private int _imgNum = 22;
32 32
 
33 33
         public void InitAndShow(bool showlblShortcut = false, int changeTime = 3000)
34 34
         {
35
-            imgLoding.Source = _images.Last();
35
+            ImgLoding.Source = _images.Last();
36 36
             Init(showlblShortcut, changeTime);
37 37
             Show();
38 38
         }
@@ -43,13 +43,13 @@ namespace XHWK.WKTool
43 43
         {
44 44
             if (showlblShortcut)
45 45
             {
46
-                lblShortcut.Visibility = Visibility.Visible;
47
-                borShortcut.Visibility = Visibility.Visible;
46
+                LblShortcut.Visibility = Visibility.Visible;
47
+                BorShortcut.Visibility = Visibility.Visible;
48 48
             }
49 49
             else
50 50
             {
51
-                lblShortcut.Visibility = Visibility.Hidden;
52
-                borShortcut.Visibility = Visibility.Hidden;
51
+                LblShortcut.Visibility = Visibility.Hidden;
52
+                BorShortcut.Visibility = Visibility.Hidden;
53 53
             }
54 54
             _imgNum = 22;
55 55
             _timer = new System.Timers.Timer();
@@ -63,12 +63,11 @@ namespace XHWK.WKTool
63 63
 
64 64
         private void _timer_Disposed(object sender, EventArgs e)
65 65
         {
66
-            Dispatcher.Invoke
67
-            (
66
+            Dispatcher.Invoke(
68 67
                 async () =>
69 68
                 {
70 69
                     // 执行操作
71
-                    imgLoding.Source = null;
70
+                    ImgLoding.Source = null;
72 71
                     await Task.Delay(300);
73 72
                     Hide();
74 73
                 },
@@ -80,12 +79,11 @@ namespace XHWK.WKTool
80 79
         {
81 80
             if (_imgNum >= 0)
82 81
             {
83
-                Dispatcher.Invoke
84
-                (
82
+                Dispatcher.Invoke(
85 83
                     () =>
86 84
                     {
87 85
                         // 执行操作
88
-                        imgLoding.Source = _images[_imgNum];
86
+                        ImgLoding.Source = _images[_imgNum];
89 87
                     },
90 88
                     DispatcherPriority.Send
91 89
                 );
@@ -125,4 +123,4 @@ namespace XHWK.WKTool
125 123
             "countdown3_1.png",
126 124
         };
127 125
     }
128
-}
126
+}

+ 0
- 371
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs View File

@@ -1,371 +0,0 @@
1
-using Common.system;
2
-
3
-using System;
4
-using System.Threading;
5
-using System.Threading.Tasks;
6
-using System.Windows;
7
-using System.Windows.Forms;
8
-using System.Windows.Input;
9
-
10
-using XHWK.Model;
11
-
12
-namespace XHWK.WKTool
13
-{
14
-    using system;
15
-    using Application = System.Windows.Application;
16
-
17
-    /// <summary>
18
-    /// 创建微课
19
-    /// </summary>
20
-    public partial class CreateAMicroLessonWindow
21
-    {
22
-        #region 字段
23
-
24
-        private FolderBrowserDialog _ofd;
25
-        private DialogResult _result;
26
-
27
-        #endregion 字段
28
-
29
-        /// <summary>
30
-        /// 创建微课
31
-        /// </summary>
32
-        public CreateAMicroLessonWindow()
33
-        {
34
-            InitializeComponent();
35
-            ResizeMode = ResizeMode.NoResize;
36
-            TxbStoragePath.Text = FileToolsCommon.GetConfigValue("VideoSavePath");
37
-            var versionCode = FileToolsCommon.GetConfigValue("VersionCode");
38
-            var versionName = FileToolsCommon.GetConfigValue("VersionName");
39
-            var isDebug = FileToolsCommon.GetConfigValue("IsDebug");
40
-            var debugStr = "测试版";
41
-            if (isDebug == "1")
42
-            {
43
-                debugStr = "测试版";
44
-            }
45
-            else if (isDebug == "0")
46
-            {
47
-                debugStr = "正式版";
48
-            }
49
-            VersionLabel.Content = debugStr + " v" + versionName + "(" + versionCode + ")";
50
-            LoadingCarouseImg();
51
-        }
52
-
53
-        #region 轮播图
54
-
55
-        /// <summary>
56
-        /// 图片宽度,每次切换的宽度
57
-        /// </summary>
58
-        private double _imgWidth = 502.00;
59
-
60
-        /// <summary>
61
-        /// 轮播时移动增加的宽度
62
-        /// </summary>
63
-        private double _imgMove = 1;
64
-
65
-        /// <summary>
66
-        /// 当前展示的图片序号Index从0开始
67
-        /// </summary>
68
-        private int _imgNumIndex;
69
-
70
-        /// <summary>
71
-        /// 加载录播图
72
-        /// </summary>
73
-        private void LoadingCarouseImg()
74
-        {
75
-            new Thread(() =>
76
-            {
77
-                Thread.Sleep(3000);
78
-                Dispatcher.Invoke(() =>
79
-                {
80
-                    _imgWidth = ImgCarouse1.ActualWidth;
81
-                    _imgMove = _imgWidth / 250.00;
82
-                    CarouseImg();
83
-                    //timesCarouse = new System.Timers.Timer(2000);
84
-                    //timesCarouse.Elapsed += TimesCarouse_Elapsed; ;
85
-                    //timesCarouse.Start();
86
-                });
87
-            }).Start();
88
-        }
89
-
90
-        /// <summary>
91
-        /// 轮播图
92
-        /// </summary>
93
-        private void CarouseImg()
94
-        {
95
-            new Thread(() =>
96
-            {
97
-                while (true)
98
-                {
99
-                    for (double i = _imgMove; i < _imgWidth; i += _imgMove)
100
-                    {
101
-                        var i1 = i;
102
-                        Dispatcher.Invoke(() =>
103
-                        {
104
-                            if (Math.Abs(
105
-                                    i1 + _imgMove) < _imgWidth)
106
-                            {
107
-                                //图片移动轮播
108
-                                SplCarouse.Margin = new Thickness(SplCarouse.Margin.Left - _imgMove, 0, 0, 0);
109
-                            }
110
-                            else
111
-                            {
112
-                                if (_imgNumIndex >= 2)
113
-                                {
114
-                                    _imgNumIndex = 0;
115
-                                    SplCarouse.Margin = new Thickness(0, 0, 0, 0);
116
-                                }
117
-                                else
118
-                                {
119
-                                    _imgNumIndex++;
120
-                                    SplCarouse.Margin = new Thickness(-(_imgNumIndex * _imgWidth), 0, 0, 0);
121
-                                }
122
-                            }
123
-                        });
124
-                        Thread.Sleep(3);
125
-                    }
126
-
127
-                    bool isBreak = false;
128
-                    Dispatcher.Invoke(() =>
129
-                    {
130
-                        if (this.Visibility != Visibility.Visible)
131
-                        {
132
-                            SplCarouse.Margin = new Thickness(0);
133
-                            isBreak = true;
134
-                        }
135
-                    });
136
-                    Thread.Sleep(5000);
137
-                    if (isBreak)
138
-                    {
139
-                        break;
140
-                    }
141
-                }
142
-            }).Start();
143
-        }
144
-
145
-        #endregion 轮播图
146
-
147
-        #region 事件
148
-
149
-        /// <summary>
150
-        /// 关闭
151
-        /// </summary>
152
-        /// <param name="sender">
153
-        /// </param>
154
-        /// <param name="e">
155
-        /// </param>
156
-        private void BtnDown_Click(object sender, RoutedEventArgs e)
157
-        {
158
-            MessageBoxResult dr = MessageWindow.Show("确定退出系统?", "提示", MessageBoxButton.OKCancel);
159
-            if (dr == MessageBoxResult.OK)
160
-            {
161
-                Application.Current.Shutdown();
162
-            }
163
-        }
164
-
165
-        /// <summary>
166
-        /// 浏览
167
-        /// </summary>
168
-        /// <param name="sender">
169
-        /// </param>
170
-        /// <param name="e">
171
-        /// </param>
172
-        private void BtnBrowse_Click(object sender, RoutedEventArgs e)
173
-        {
174
-            //string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
175
-            _ofd = new FolderBrowserDialog();
176
-
177
-            _result = _ofd.ShowDialog();
178
-            if (_result == System.Windows.Forms.DialogResult.OK)
179
-            {
180
-                if (_ofd.SelectedPath != "")
181
-                {
182
-                    TxbStoragePath.Text = _ofd.SelectedPath;
183
-                }
184
-            }
185
-        }
186
-
187
-        private bool _isPressButton;
188
-
189
-        /// <summary>
190
-        /// 开始
191
-        /// </summary>
192
-        /// <param name="sender">
193
-        /// </param>
194
-        /// <param name="e">
195
-        /// </param>
196
-        private async void BtnStart_Click(object sender, RoutedEventArgs e)
197
-        {
198
-            #region 防止连击
199
-
200
-            if (_isPressButton)
201
-            {
202
-                return;
203
-            }
204
-            else
205
-            {
206
-                _isPressButton = true;
207
-                new Thread(() =>
208
-                {
209
-                    Thread.Sleep(500);
210
-                    _isPressButton = false;
211
-                }).Start();
212
-            }
213
-
214
-            #endregion 防止连击
215
-
216
-            #region 合法性判断
217
-
218
-            if (string.IsNullOrWhiteSpace(TxbExplainName.Text.Trim()))
219
-            {
220
-                MessageWindow.Show("讲解名称不可为空!");
221
-                return;
222
-            }
223
-            if (string.IsNullOrWhiteSpace(TxbStoragePath.Text.Trim()))
224
-            {
225
-                MessageWindow.Show("路径不可为空!");
226
-                return;
227
-            }
228
-            try
229
-            {
230
-                FileToolsCommon.CreateDirectory(TxbStoragePath.Text.Trim());
231
-            }
232
-            catch (Exception)
233
-            {
234
-                MessageWindow.Show("路径无法访问,解决方案:\r\n1,检查路径是否可访问。\r\n2,关闭杀毒软件或信任软件。");
235
-                return;
236
-            }
237
-
238
-            #endregion 合法性判断
239
-
240
-            LblCreate.Visibility = Visibility.Visible;
241
-            string wkpath = FileToolsCommon.GetLegalPath(TxbStoragePath.Text) + TxbExplainName.Text.Trim() + "/";
242
-            string storagePath = TxbStoragePath.Text;
243
-            string wkName = TxbExplainName.Text;
244
-            await Task.Run(() =>
245
-            {
246
-                try
247
-                {
248
-                    //读取微课数据
249
-                    App.ReadWkData(wkpath);
250
-                    if (App.WKData == null)
251
-                    {
252
-                        App.WKData = new ModelWkData { WkPath = wkpath, WkName = wkName, WkCreateDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") };
253
-                    }
254
-
255
-                    try
256
-                    {
257
-                        //创建文件夹
258
-                        FileToolsCommon.CreateDirectory(App.WKData.WkPath);
259
-                        FileToolsCommon.DeleteDirectory(wkpath + "temp");
260
-                        FileToolsCommon.DeleteDirectory(wkpath + "_temppath");
261
-                    }
262
-                    catch (Exception ex)
263
-                    {
264
-                        LogHelper.Logerror.Error("【微课创建课程】文件夹创建删除失败:" + ex.Message, ex);
265
-                    }
266
-
267
-                    //存储文件
268
-                    FileToolsCommon.SetConfigValue("VideoSavePath", storagePath);
269
-                    App.ReadDrawData();
270
-                }
271
-                catch (Exception ex)
272
-                {
273
-                    LogHelper.Logerror.Error("【微课创建课程】读取课堂数据失败:" + ex.Message, ex);
274
-                }
275
-            });
276
-            if (App.W_XHMicroLessonSystemWindow == null)
277
-            {
278
-                App.W_XHMicroLessonSystemWindow = new MainWindow();
279
-            }
280
-            App.W_XHMicroLessonSystemWindow.Show();
281
-            LblCreate.Visibility = Visibility.Hidden;
282
-            Hide();
283
-        }
284
-
285
-        /// <summary>
286
-        /// 窗体移动
287
-        /// </summary>
288
-        /// <param name="sender">
289
-        /// </param>
290
-        /// <param name="e">
291
-        /// </param>
292
-        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
293
-        {
294
-            DragMove();
295
-        }
296
-
297
-        #endregion 事件
298
-
299
-        /// <summary>
300
-        /// 检测APP更新
301
-        /// </summary>
302
-        private void GetNewApp()
303
-        {
304
-            new Thread(o =>
305
-            {
306
-                //读取本地
307
-                App.ReadServiceAddressData();
308
-                int versionThis = int.Parse(FileToolsCommon.GetConfigValue("VersionCode"));
309
-                if (versionThis < 0)
310
-                {
311
-                    //软件是否更新,版本号小于0不更新
312
-                    return;
313
-                }
314
-                string url = App.apiUrl + "/sapi/apprecord/get_new";
315
-                Console.WriteLine(url);
316
-                ResultVo<ModelApp> resultObj = ZHttpUtil.PostSignle<ResultVo<ModelApp>>(url, "{}");
317
-                if (resultObj == null || resultObj.code != 0)
318
-                {
319
-                    return;
320
-                }
321
-                if (resultObj.obj != null)
322
-                {
323
-                    try
324
-                    {
325
-                        int versionCode = resultObj.obj.versioncode;
326
-                        if (versionThis < versionCode)
327
-                        {
328
-                            Dispatcher.Invoke(
329
-                                () =>
330
-                                {
331
-                                    string pathTemp = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
332
-                                    FileToolsCommon.CreateDirectory(pathTemp);
333
-                                    AppUpdateShow(resultObj.obj);
334
-                                }
335
-                            );
336
-                        }
337
-                    }
338
-                    catch (Exception ex)
339
-                    {
340
-                        LogHelper.Logerror.Error("【检查更新】(getNewApp)版本号错误:" + ex.Message, ex);
341
-                    }
342
-                }
343
-            }).Start();
344
-        }
345
-
346
-        /// <summary>
347
-        /// 应用更新
348
-        /// </summary>
349
-        /// <param name="app">
350
-        /// </param>
351
-        private void AppUpdateShow(ModelApp app)
352
-        {
353
-            AppUpdateWin win = new AppUpdateWin(app)
354
-            {
355
-                Topmost = true,
356
-                Owner = this
357
-            };
358
-            win.Show();
359
-        }
360
-
361
-        private void Window_Loaded(object sender, RoutedEventArgs e)
362
-        {
363
-            GetNewApp();
364
-        }
365
-
366
-        private void Window_Closed(object sender, EventArgs e)
367
-        {
368
-            Application.Current.Shutdown();
369
-        }
370
-    }
371
-}

XHWK.WKTool/CreateAMicroLessonWindow.xaml → XHWK.WKTool/CreateWin.xaml View File

@@ -1,5 +1,5 @@
1 1
 <Window
2
-    x:Class="XHWK.WKTool.CreateAMicroLessonWindow"
2
+    x:Class="XHWK.WKTool.CreateWin"
3 3
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4 4
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5 5
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

+ 404
- 0
XHWK.WKTool/CreateWin.xaml.cs View File

@@ -0,0 +1,404 @@
1
+using Common.system;
2
+
3
+using System;
4
+using System.Threading;
5
+using System.Threading.Tasks;
6
+using System.Windows;
7
+using System.Windows.Forms;
8
+using System.Windows.Input;
9
+
10
+using XHWK.Model;
11
+
12
+namespace XHWK.WKTool
13
+{
14
+    using system;
15
+
16
+    using Application = System.Windows.Application;
17
+
18
+    /// <summary>
19
+    ///     创建微课
20
+    /// </summary>
21
+    public partial class CreateWin
22
+    {
23
+        #region 字段
24
+
25
+        private FolderBrowserDialog _ofd;
26
+        private DialogResult _result;
27
+
28
+        #endregion 字段
29
+
30
+        /// <summary>
31
+        ///     创建微课
32
+        /// </summary>
33
+        public CreateWin()
34
+        {
35
+            InitializeComponent();
36
+            ResizeMode = ResizeMode.NoResize;
37
+            TxbStoragePath.Text = FileToolsCommon.GetConfigValue("VideoSavePath");
38
+            string versionCode = FileToolsCommon.GetConfigValue("VersionCode");
39
+            string versionName = FileToolsCommon.GetConfigValue("VersionName");
40
+            string isDebug = FileToolsCommon.GetConfigValue("IsDebug");
41
+            string debugStr = "测试版";
42
+            if (isDebug == "1")
43
+            {
44
+                debugStr = "测试版";
45
+            }
46
+            else if (isDebug == "0")
47
+            {
48
+                debugStr = "正式版";
49
+            }
50
+            VersionLabel.Content = debugStr + " v" + versionName + "(" + versionCode + ")";
51
+            LoadingCarouseImg();
52
+        }
53
+
54
+        #region 轮播图
55
+
56
+        /// <summary>
57
+        ///     图片宽度,每次切换的宽度
58
+        /// </summary>
59
+        private double _imgWidth = 502.00;
60
+
61
+        /// <summary>
62
+        ///     轮播时移动增加的宽度
63
+        /// </summary>
64
+        private double _imgMove = 1;
65
+
66
+        /// <summary>
67
+        ///     当前展示的图片序号Index从0开始
68
+        /// </summary>
69
+        private int _imgNumIndex;
70
+
71
+        /// <summary>
72
+        ///     加载录播图
73
+        /// </summary>
74
+        private void LoadingCarouseImg()
75
+        {
76
+            new Thread(
77
+                () =>
78
+                {
79
+                    Thread.Sleep(3000);
80
+                    Dispatcher.Invoke(
81
+                        () =>
82
+                        {
83
+                            _imgWidth = ImgCarouse1.ActualWidth;
84
+                            _imgMove = _imgWidth / 250.00;
85
+                            CarouseImg();
86
+                            //timesCarouse = new System.Timers.Timer(2000);
87
+                            //timesCarouse.Elapsed += TimesCarouse_Elapsed; ;
88
+                            //timesCarouse.Start();
89
+                        }
90
+                    );
91
+                }
92
+            ).Start();
93
+        }
94
+
95
+        /// <summary>
96
+        ///     轮播图
97
+        /// </summary>
98
+        private void CarouseImg()
99
+        {
100
+            new Thread(
101
+                () =>
102
+                {
103
+                    while (true)
104
+                    {
105
+                        for (double i = _imgMove; i < _imgWidth; i += _imgMove)
106
+                        {
107
+                            double i1 = i;
108
+                            Dispatcher.Invoke(
109
+                                () =>
110
+                                {
111
+                                    if (Math.Abs(i1 + _imgMove) < _imgWidth)
112
+                                    {
113
+                                        //图片移动轮播
114
+                                        SplCarouse.Margin = new Thickness(
115
+                                            SplCarouse.Margin.Left - _imgMove,
116
+                                            0,
117
+                                            0,
118
+                                            0
119
+                                        );
120
+                                    }
121
+                                    else
122
+                                    {
123
+                                        if (_imgNumIndex >= 2)
124
+                                        {
125
+                                            _imgNumIndex = 0;
126
+                                            SplCarouse.Margin = new Thickness(
127
+                                                0,
128
+                                                0,
129
+                                                0,
130
+                                                0
131
+                                            );
132
+                                        }
133
+                                        else
134
+                                        {
135
+                                            _imgNumIndex++;
136
+                                            SplCarouse.Margin = new Thickness(
137
+                                                -(_imgNumIndex * _imgWidth),
138
+                                                0,
139
+                                                0,
140
+                                                0
141
+                                            );
142
+                                        }
143
+                                    }
144
+                                }
145
+                            );
146
+                            Thread.Sleep(3);
147
+                        }
148
+                        bool isBreak = false;
149
+                        Dispatcher.Invoke(
150
+                            () =>
151
+                            {
152
+                                if (Visibility != Visibility.Visible)
153
+                                {
154
+                                    SplCarouse.Margin = new Thickness(0);
155
+                                    isBreak = true;
156
+                                }
157
+                            }
158
+                        );
159
+                        Thread.Sleep(5000);
160
+                        if (isBreak)
161
+                        {
162
+                            break;
163
+                        }
164
+                    }
165
+                }
166
+            ).Start();
167
+        }
168
+
169
+        #endregion 轮播图
170
+
171
+        #region 事件
172
+
173
+        /// <summary>
174
+        ///     关闭
175
+        /// </summary>
176
+        /// <param name="sender">
177
+        /// </param>
178
+        /// <param name="e">
179
+        /// </param>
180
+        private void BtnDown_Click(object sender, RoutedEventArgs e)
181
+        {
182
+            MessageBoxResult dr = MessageWindow.Show(
183
+                "确定退出系统?",
184
+                "提示",
185
+                MessageBoxButton.OKCancel
186
+            );
187
+            if (dr == MessageBoxResult.OK)
188
+            {
189
+                Application.Current.Shutdown();
190
+            }
191
+        }
192
+
193
+        /// <summary>
194
+        ///     浏览
195
+        /// </summary>
196
+        /// <param name="sender">
197
+        /// </param>
198
+        /// <param name="e">
199
+        /// </param>
200
+        private void BtnBrowse_Click(object sender, RoutedEventArgs e)
201
+        {
202
+            //string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
203
+            _ofd = new FolderBrowserDialog();
204
+            _result = _ofd.ShowDialog();
205
+            if (_result == System.Windows.Forms.DialogResult.OK)
206
+            {
207
+                if (_ofd.SelectedPath != "")
208
+                {
209
+                    TxbStoragePath.Text = _ofd.SelectedPath;
210
+                }
211
+            }
212
+        }
213
+
214
+        private bool _isPressButton;
215
+
216
+        /// <summary>
217
+        ///     开始
218
+        /// </summary>
219
+        /// <param name="sender">
220
+        /// </param>
221
+        /// <param name="e">
222
+        /// </param>
223
+        private async void BtnStart_Click(object sender, RoutedEventArgs e)
224
+        {
225
+            #region 防止连击
226
+
227
+            if (_isPressButton)
228
+            {
229
+                return;
230
+            }
231
+            else
232
+            {
233
+                _isPressButton = true;
234
+                new Thread(
235
+                    () =>
236
+                    {
237
+                        Thread.Sleep(500);
238
+                        _isPressButton = false;
239
+                    }
240
+                ).Start();
241
+            }
242
+
243
+            #endregion 防止连击
244
+
245
+            #region 合法性判断
246
+
247
+            if (string.IsNullOrWhiteSpace(TxbExplainName.Text.Trim()))
248
+            {
249
+                MessageWindow.Show("讲解名称不可为空!");
250
+                return;
251
+            }
252
+            if (string.IsNullOrWhiteSpace(TxbStoragePath.Text.Trim()))
253
+            {
254
+                MessageWindow.Show("路径不可为空!");
255
+                return;
256
+            }
257
+            try
258
+            {
259
+                FileToolsCommon.CreateDirectory(TxbStoragePath.Text.Trim());
260
+            }
261
+            catch (Exception)
262
+            {
263
+                MessageWindow.Show("路径无法访问,解决方案:\r\n1,检查路径是否可访问。\r\n2,关闭杀毒软件或信任软件。");
264
+                return;
265
+            }
266
+
267
+            #endregion 合法性判断
268
+
269
+            LblCreate.Visibility = Visibility.Visible;
270
+            string wkpath = FileToolsCommon.GetLegalPath(TxbStoragePath.Text) + TxbExplainName.Text.Trim() + "/";
271
+            string storagePath = TxbStoragePath.Text;
272
+            string wkName = TxbExplainName.Text;
273
+            await Task.Run(
274
+                () =>
275
+                {
276
+                    try
277
+                    {
278
+                        //读取微课数据
279
+                        App.ReadWkData(wkpath);
280
+                        if (App.WKData == null)
281
+                        {
282
+                            App.WKData = new ModelWkData
283
+                            {
284
+                                WkPath = wkpath,
285
+                                WkName = wkName,
286
+                                WkCreateDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
287
+                            };
288
+                        }
289
+                        try
290
+                        {
291
+                            //创建文件夹
292
+                            FileToolsCommon.CreateDirectory(App.WKData.WkPath);
293
+                            FileToolsCommon.DeleteDirectory(wkpath + "temp");
294
+                            FileToolsCommon.DeleteDirectory(wkpath + "_temppath");
295
+                        }
296
+                        catch (Exception ex)
297
+                        {
298
+                            LogHelper.Logerror.Error("【微课创建课程】文件夹创建删除失败:" + ex.Message, ex);
299
+                        }
300
+
301
+                        //存储文件
302
+                        FileToolsCommon.SetConfigValue("VideoSavePath", storagePath);
303
+                        App.ReadDrawData();
304
+                    }
305
+                    catch (Exception ex)
306
+                    {
307
+                        LogHelper.Logerror.Error("【微课创建课程】读取课堂数据失败:" + ex.Message, ex);
308
+                    }
309
+                }
310
+            );
311
+            if (App.W_XHMicroLessonSystemWindow == null)
312
+            {
313
+                App.W_XHMicroLessonSystemWindow = new MainWindow();
314
+            }
315
+            App.W_XHMicroLessonSystemWindow.Show();
316
+            LblCreate.Visibility = Visibility.Hidden;
317
+            Hide();
318
+        }
319
+
320
+        /// <summary>
321
+        ///     窗体移动
322
+        /// </summary>
323
+        /// <param name="sender">
324
+        /// </param>
325
+        /// <param name="e">
326
+        /// </param>
327
+        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
328
+        {
329
+            DragMove();
330
+        }
331
+
332
+        #endregion 事件
333
+
334
+        /// <summary>
335
+        ///     检测APP更新
336
+        /// </summary>
337
+        private void GetNewApp()
338
+        {
339
+            new Thread(
340
+                o =>
341
+                {
342
+                    //读取本地
343
+                    App.ReadServiceAddressData();
344
+                    int versionThis = int.Parse(FileToolsCommon.GetConfigValue("VersionCode"));
345
+                    if (versionThis < 0)
346
+                    {
347
+                        //软件是否更新,版本号小于0不更新
348
+                        return;
349
+                    }
350
+                    string url = App.apiUrl + "/sapi/apprecord/get_new";
351
+                    Console.WriteLine(url);
352
+                    ResultVo<ModelApp> resultObj = ZHttpUtil.PostSignle<ResultVo<ModelApp>>(url, "{}");
353
+                    if (resultObj == null || resultObj.code != 0)
354
+                    {
355
+                        return;
356
+                    }
357
+                    if (resultObj.obj != null)
358
+                    {
359
+                        try
360
+                        {
361
+                            int versionCode = resultObj.obj.versioncode;
362
+                            if (versionThis < versionCode)
363
+                            {
364
+                                Dispatcher.Invoke(
365
+                                    () =>
366
+                                    {
367
+                                        string pathTemp = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
368
+                                        FileToolsCommon.CreateDirectory(pathTemp);
369
+                                        AppUpdateShow(resultObj.obj);
370
+                                    }
371
+                                );
372
+                            }
373
+                        }
374
+                        catch (Exception ex)
375
+                        {
376
+                            LogHelper.Logerror.Error("【检查更新】(getNewApp)版本号错误:" + ex.Message, ex);
377
+                        }
378
+                    }
379
+                }
380
+            ).Start();
381
+        }
382
+
383
+        /// <summary>
384
+        ///     应用更新
385
+        /// </summary>
386
+        /// <param name="app">
387
+        /// </param>
388
+        private void AppUpdateShow(ModelApp app)
389
+        {
390
+            AppUpdateWin win = new AppUpdateWin(app) { Topmost = true, Owner = this };
391
+            win.Show();
392
+        }
393
+
394
+        private void Window_Loaded(object sender, RoutedEventArgs e)
395
+        {
396
+            GetNewApp();
397
+        }
398
+
399
+        private void Window_Closed(object sender, EventArgs e)
400
+        {
401
+            Application.Current.Shutdown();
402
+        }
403
+    }
404
+}

+ 7
- 7
XHWK.WKTool/DeviceWindow.xaml View File

@@ -146,7 +146,7 @@
146 146
             x:Name="GridTitleBlack"
147 147
             Grid.Row="0"
148 148
             Margin="0,0"
149
-            Background="#3f6fff"
149
+            Background="#4597FF"
150 150
             MouseLeftButtonDown="Window_MouseLeftButtonDown">
151 151
             <TextBlock
152 152
                 Grid.RowSpan="2"
@@ -329,7 +329,7 @@
329 329
                         Margin="0,0,10,0"
330 330
                         HorizontalAlignment="Right"
331 331
                         VerticalAlignment="Center"
332
-                        Background="#3f6fff"
332
+                        Background="#4597FF"
333 333
                         Click="btn_camera_good_Click"
334 334
                         Content="可以看见"
335 335
                         Cursor="Hand"
@@ -387,7 +387,7 @@
387 387
                                         BorderThickness="1"
388 388
                                         CornerRadius="7">
389 389
                                         <Border.Background>
390
-                                            <Brush>#3f6fff</Brush>
390
+                                            <Brush>#4597FF</Brush>
391 391
                                         </Border.Background>
392 392
                                         <ContentPresenter
393 393
                                             HorizontalAlignment="Center"
@@ -440,7 +440,7 @@
440 440
                             Margin="0,0,10,0"
441 441
                             HorizontalAlignment="Right"
442 442
                             VerticalAlignment="Center"
443
-                            Background="#3f6fff"
443
+                            Background="#4597FF"
444 444
                             Click="btn_speaker_good_Click"
445 445
                             Content="可以听见"
446 446
                             Cursor="Hand"
@@ -508,7 +508,7 @@
508 508
                         x:Name="MicrophoneSetting"
509 509
                         Width="60"
510 510
                         Margin="20,0,0,0"
511
-                        Background="#3f6fff"
511
+                        Background="#4597FF"
512 512
                         Content="设置"
513 513
                         FontSize="14"
514 514
                         Foreground="White" />
@@ -549,7 +549,7 @@
549 549
                             Margin="0,0,10,0"
550 550
                             HorizontalAlignment="Right"
551 551
                             VerticalAlignment="Center"
552
-                            Background="#3f6fff"
552
+                            Background="#4597FF"
553 553
                             Click="btn_microphone_good_Click"
554 554
                             Content="可以看见"
555 555
                             Cursor="Hand"
@@ -670,7 +670,7 @@
670 670
                         Margin="0"
671 671
                         HorizontalAlignment="Right"
672 672
                         VerticalAlignment="Stretch"
673
-                        Background="#3f6fff"
673
+                        Background="#4597FF"
674 674
                         Click="BtnDetection_Click"
675 675
                         Content="重新检测"
676 676
                         Cursor="Hand"

+ 4
- 5
XHWK.WKTool/JieTuWindow.xaml View File

@@ -3,7 +3,6 @@
3 3
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4 4
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5 5
     xmlns:ctrl="clr-namespace:ComeCapture.Controls"
6
-    xmlns:local="clr-namespace:ComeCapture"
7 6
     Title="MainWindow"
8 7
     Closed="Window_Closed"
9 8
     Cursor="Cross"
@@ -66,14 +65,14 @@
66 65
 
67 66
             <!--  尺寸和RGB  -->
68 67
             <StackPanel
69
-                x:Name="SizeRGB"
68
+                x:Name="SizeRgb"
70 69
                 Canvas.Left="{Binding ShowSizeLeft}"
71 70
                 Canvas.Top="{Binding ShowSizeTop}"
72 71
                 Width="200"
73 72
                 Background="Black"
74 73
                 Opacity="0.7">
75 74
                 <TextBlock
76
-                    x:Name="Show_Size"
75
+                    x:Name="ShowSize"
77 76
                     Height="20"
78 77
                     Padding="10,4,10,0"
79 78
                     FontSize="12"
@@ -82,7 +81,7 @@
82 81
                     TextAlignment="Left"
83 82
                     Visibility="Collapsed" />
84 83
                 <TextBlock
85
-                    x:Name="Show_RGB"
84
+                    x:Name="ShowRgb"
86 85
                     Height="20"
87 86
                     Padding="10,1,10,0"
88 87
                     FontSize="12"
@@ -97,4 +96,4 @@
97 96
             <ctrl:SizeColorBar x:Name="SizeColorBar" />
98 97
         </Canvas>
99 98
     </Grid>
100
-</Window>
99
+</Window>

+ 112
- 145
XHWK.WKTool/JieTuWindow.xaml.cs View File

@@ -1,11 +1,9 @@
1
-
2
-using ComeCapture.Controls;
1
+using ComeCapture.Controls;
3 2
 using ComeCapture.Helpers;
4 3
 using ComeCapture.Models;
5 4
 
6 5
 using Common.system;
7 6
 
8
-
9 7
 using System;
10 8
 using System.Collections.Generic;
11 9
 using System.Drawing;
@@ -24,9 +22,9 @@ using static XHWK.WKTool.MainWindow;
24 22
 namespace ComeCapture
25 23
 {
26 24
     /// <summary>
27
-    /// 截图 MainWindow.xaml 的交互逻辑
25
+    ///     截图 MainWindow.xaml 的交互逻辑
28 26
     /// </summary>
29
-    public partial class JieTuWindow : Window
27
+    public partial class JieTuWindow
30 28
     {
31 29
         public static double ScreenWidth = SystemParameters.PrimaryScreenWidth;
32 30
         public static double ScreenHeight = SystemParameters.PrimaryScreenHeight;
@@ -43,30 +41,32 @@ namespace ComeCapture
43 41
         public int num = 1;
44 42
 
45 43
         //是否截图开始
46
-        private bool _IsMouseDown = false;
44
+        private bool _isMouseDown;
47 45
 
48 46
         //是否截图完毕
49
-        private bool _IsCapture = false;
47
+        private bool _isCapture;
48
+
49
+        private double _x0;
50
+        private double _y0;
50 51
 
51
-        private double _X0 = 0;
52
-        private double _Y0 = 0;
53 52
         /// <summary>
54
-        /// 键盘钩子
53
+        ///     键盘钩子
55 54
         /// </summary>
56
-        private KeyboardHookCommon k_hook;
55
+        private readonly KeyboardHookCommon _kHook;
56
+
57 57
         //private IntPtr BitmapPtr = IntPtr.Zero;
58 58
         //private IntPtr JieTuBitmapPtr = IntPtr.Zero;
59 59
         /// <summary>
60
-        /// 截图
60
+        ///     截图
61 61
         /// </summary>
62 62
         public JieTuWindow()
63 63
         {
64
-            _Current = this;
64
+            _current = this;
65 65
             InitializeComponent();
66
-            k_hook = new KeyboardHookCommon();
67
-            k_hook.KeyDownEvent += K_hook_KeyDownEvent;
66
+            _kHook = new KeyboardHookCommon();
67
+            _kHook.KeyDownEvent += K_hook_KeyDownEvent;
68 68
             DataContext = new AppModel();
69
-            initialization();
69
+            Initialization();
70 70
             Screenshot();
71 71
             MaxWindow();
72 72
             MaskLeft.Height = ScreenHeight;
@@ -79,44 +79,50 @@ namespace ComeCapture
79 79
 
80 80
         public void Screenshot()
81 81
         {
82
-            //IntPtr BitmapPtr = IntPtr.Zero;
83
-            //Background = new ImageBrush(ImageHelper.GetFullBitmapSource(out BitmapPtr));
84
-
85
-            string time = GetTimeStamp();
86 82
             string tempPath = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
87 83
             if (!Directory.Exists(tempPath))
88 84
             {
89 85
                 Directory.CreateDirectory(tempPath);
90 86
             }
91
-            string imagePath = Path.Combine(tempPath, time + ".jpg");
92
-            if (ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), null, true, out BitmapImage bitmap))
87
+            if (ImageHelper.GetScreenshot(
88
+                    new Rectangle(
89
+                        0,
90
+                        0,
91
+                        0,
92
+                        0
93
+                    ),
94
+                    null,
95
+                    true,
96
+                    out BitmapImage bitmap
97
+                ))
93 98
             {
94 99
                 Background = new ImageBrush(bitmap);
95 100
             }
96 101
         }
97 102
 
98
-        public void initialization()
103
+        public void Initialization()
99 104
         {
100 105
             Background = null;
101
-            _IsMouseDown = false;
102
-            _IsCapture = false;
106
+            _isMouseDown = false;
107
+            _isCapture = false;
103 108
             ImageEditBar.Current.Visibility = Visibility.Collapsed;
104 109
             SizeColorBar.Current.Visibility = Visibility.Collapsed;
105
-            SizeRGB.Visibility = Visibility.Collapsed;
110
+            SizeRgb.Visibility = Visibility.Collapsed;
106 111
             MainImage.Visibility = Visibility.Collapsed;
107 112
             DataContext = new AppModel();
108 113
             WpfHelper.MainDispatcher = Dispatcher;
109 114
         }
115
+
110 116
         /// <summary>
111
-        /// 初始化快捷键
117
+        ///     初始化快捷键
112 118
         /// </summary>
113 119
         public void InitializeKeyDownEvent()
114 120
         {
115
-
116
-            k_hook.Start();//安装键盘钩子
121
+            _kHook.Start(); //安装键盘钩子
117 122
         }
123
+
118 124
         /// <summary>
119
-        /// 快捷键
125
+        ///     快捷键
120 126
         /// </summary>
121 127
         /// <param name="sender"></param>
122 128
         /// <param name="e"></param>
@@ -124,7 +130,7 @@ namespace ComeCapture
124 130
         {
125 131
             if (e.KeyValue == (int)System.Windows.Forms.Keys.Escape)
126 132
             {
127
-                k_hook.Stop();
133
+                _kHook.Stop();
128 134
                 Current.OnCancel();
129 135
                 App.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
130 136
                 App.W_XHMicroLessonSystemWindow.WindowType();
@@ -134,9 +140,9 @@ namespace ComeCapture
134 140
 
135 141
         #region 属性 Current
136 142
 
137
-        private static JieTuWindow _Current = null;
143
+        private static JieTuWindow _current;
138 144
 
139
-        public static JieTuWindow Current => _Current;
145
+        public static JieTuWindow Current => _current;
140 146
 
141 147
         #endregion 属性 Current
142 148
 
@@ -157,10 +163,10 @@ namespace ComeCapture
157 163
 
158 164
         public static void Register(object control)
159 165
         {
160
-            string name = "Draw" + _Current.num;
161
-            _Current.MainCanvas.RegisterName(name, control);
162
-            _Current.list.Add(new NameAndLimit(name));
163
-            _Current.num++;
166
+            string name = "Draw" + _current.num;
167
+            _current.MainCanvas.RegisterName(name, control);
168
+            _current.list.Add(new NameAndLimit(name));
169
+            _current.num++;
164 170
         }
165 171
 
166 172
         #endregion 注册画图
@@ -169,7 +175,7 @@ namespace ComeCapture
169 175
 
170 176
         public static void AddControl(UIElement e)
171 177
         {
172
-            _Current.MainCanvas.Children.Add(e);
178
+            _current.MainCanvas.Children.Add(e);
173 179
         }
174 180
 
175 181
         #endregion 截图区域添加画图
@@ -178,7 +184,7 @@ namespace ComeCapture
178 184
 
179 185
         public static void RemoveControl(UIElement e)
180 186
         {
181
-            _Current.MainCanvas.Children.Remove(e);
187
+            _current.MainCanvas.Children.Remove(e);
182 188
         }
183 189
 
184 190
         #endregion 截图区域撤回画图
@@ -251,10 +257,8 @@ namespace ComeCapture
251 257
 
252 258
         #region 获取截图
253 259
 
254
-
255 260
         private void GetCapture()
256 261
         {
257
-
258 262
             string time = GetTimeStamp();
259 263
             string tempPath = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
260 264
             if (!Directory.Exists(tempPath))
@@ -270,54 +274,31 @@ namespace ComeCapture
270 274
 
271 275
             //BitmapSource bitmap = ImageHelper.GetBitmapSource((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2, out JieTuBitmapPtr);
272 276
             /* BitmapImage bitmap = */
273
-            ImageHelper.GetScreenshot(new Rectangle((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2), imagePath, true, out BitmapImage bitmapimg);
274
-            _IsMouseDown = false;
275
-            _IsCapture = false;
277
+            ImageHelper.GetScreenshot(
278
+                new Rectangle(
279
+                    (int)AppModel.Current.MaskLeftWidth + 1,
280
+                    (int)AppModel.Current.MaskTopHeight + 1,
281
+                    (int)MainImage.ActualWidth - 2,
282
+                    (int)MainImage.ActualHeight - 2
283
+                ),
284
+                imagePath,
285
+                true,
286
+                out BitmapImage _
287
+            );
288
+            _isMouseDown = false;
289
+            _isCapture = false;
276 290
             ImageEditBar.Current.Visibility = Visibility.Collapsed;
277 291
             SizeColorBar.Current.Visibility = Visibility.Collapsed;
278
-            SizeRGB.Visibility = Visibility.Collapsed;
292
+            SizeRgb.Visibility = Visibility.Collapsed;
279 293
             MainImage.Visibility = Visibility.Collapsed;
280 294
             DataContext = new AppModel();
281
-            //ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);//zxy
282
-            //Background = new ImageBrush(bitmap);
283 295
             WpfHelper.MainDispatcher = Dispatcher;
284 296
             MaxWindow();
285 297
             MaskLeft.Height = ScreenHeight;
286 298
             MaskRight.Height = ScreenHeight;
287 299
             //计算Windows项目缩放比例
288 300
             ScreenHelper.ResetScreenScale();
289
-            //if (bitmap != null)
290
-            //{
291
-            //    //Shared.TeachingData.REQ_InteractiveLaunch.teacherpic = serverSavePath;
292
-            //    //Shared.TeachingData.FilePath = imagePath;
293
-            //}
294
-
295
-            ///修改为统一截图时存储到服务器 修改人:赵耀 修改时间:2020年8月11日
296
-            //if (bitmap != null)
297
-            //{
298
-            //    TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
299
-            //    string httpurl = Convert.ToInt64(ts.TotalMilliseconds).ToString() + ".png";
300
-            //    string path = ZConfig.classRoomImagePath() + httpurl.Substring(httpurl.LastIndexOf('/') + 1);
301
-            //    Shared.TeachingData.REQ_InteractiveLaunch.teacherpic = ZConfig.dbImagePath() + httpurl;
302
-            //    Shared.TeachingData.FilePath = path;
303
-            // FileInfo fi = new FileInfo(path); var di = fi.Directory; if (!di.Exists) {
304
-            // di.Create();
305
-            //}
306
-
307
-            //    using (var fs = System.IO.File.Create(path))
308
-            //    {
309
-            //        BitmapEncoder encoder = new PngBitmapEncoder();
310
-            //        encoder.Frames.Add(BitmapFrame.Create(bitmap));
311
-            //        encoder.Save(fs);
312
-            //        bitmap = null;
313
-            //        encoder = null;
314
-            //    }
315
-            //}
316
-            //Dispose();
317
-            //GC.Collect();
318
-            //ImageHelper.DeleteObject(BitmapPtr);
319
-            //ImageHelper.DeleteObject(JieTuBitmapPtr);
320
-            initialization();
301
+            Initialization();
321 302
             Owner = null;
322 303
             WindowState = WindowState.Minimized;
323 304
             Visibility = Visibility.Hidden;
@@ -325,21 +306,32 @@ namespace ComeCapture
325 306
             //this.Hide();
326 307
             if (ChangeTextEvent != null)
327 308
             {
328
-                k_hook.Stop();
309
+                _kHook.Stop();
329 310
                 ChangeTextEvent("关闭窗口");
330 311
             }
331 312
         }
332 313
 
333 314
         #endregion 获取截图
315
+
334 316
         /// <summary>
335
-        /// 获取时间戳
317
+        ///     获取时间戳
336 318
         /// </summary>
337 319
         /// <returns></returns>
338 320
         public string GetTimeStamp()
339 321
         {
340
-            TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
322
+            TimeSpan ts = DateTime.Now -
323
+            new DateTime(
324
+                1970,
325
+                1,
326
+                1,
327
+                0,
328
+                0,
329
+                0,
330
+                0
331
+            );
341 332
             return Convert.ToInt64(ts.TotalMilliseconds).ToString();
342 333
         }
334
+
343 335
         #region 退出截图
344 336
 
345 337
         public void OnCancel()
@@ -347,17 +339,16 @@ namespace ComeCapture
347 339
             //Close();
348 340
             //ImageHelper.DeleteObject(BitmapPtr);
349 341
             //ImageHelper.DeleteObject(JieTuBitmapPtr);
350
-            initialization();
342
+            Initialization();
351 343
             Owner = null;
352 344
             WindowState = WindowState.Minimized;
353 345
             Visibility = Visibility.Hidden;
354 346
             ShowInTaskbar = false;
355 347
             //this.Hide();
356 348
             //_Bitmap.Dispose();
357
-
358 349
             if (ChangeTextEvent != null)
359 350
             {
360
-                k_hook.Stop();
351
+                _kHook.Stop();
361 352
                 ChangeTextEvent("取消");
362 353
             }
363 354
         }
@@ -369,36 +360,13 @@ namespace ComeCapture
369 360
         public void OnOK()
370 361
         {
371 362
             Hidden();
372
-
373
-            Thread t = new Thread(new ThreadStart(() =>
374
-            {
375
-                Thread.Sleep(50);
376
-                //Thread.Sleep(200);
377
-                WpfHelper.SafeRun(() =>
363
+            Thread t = new Thread(
364
+                () =>
378 365
                 {
379
-                    /*var source = */
380
-                    GetCapture();
381
-                    //Shared.TeachingData.Source = source;
382
-                    //if (source != null)
383
-                    //{
384
-                    //    TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
385
-                    //    string httpurl = Convert.ToInt64(ts.TotalMilliseconds).ToString() + ".png";
386
-                    //    string path = ZConfig.classRoomImagePath() + httpurl.Substring(httpurl.LastIndexOf('/') + 1);
387
-                    //    Shared.TeachingData.REQ_InteractiveLaunch.teacherpic = ZConfig.dbImagePath() + httpurl;
388
-                    //    ImageHelper.SaveToPng(source, path);
389
-                    //    Shared.TeachingData.FilePath = path;
390
-                    //    //Clipboard.SetImage(source);
391
-                    //}
392
-                    //Close();
393
-                    //if (ChangeTextEvent != null)
394
-                    //{
395
-                    //    ChangeTextEvent("关闭窗口");
396
-                    //}
397
-                });
398
-            }))
399
-            {
400
-                IsBackground = true
401
-            };
366
+                    Thread.Sleep(50);
367
+                    WpfHelper.SafeRun(GetCapture);
368
+                }
369
+            ) { IsBackground = true };
402 370
             t.Start();
403 371
         }
404 372
 
@@ -411,7 +379,7 @@ namespace ComeCapture
411 379
             //隐藏尺寸RGB框
412 380
             if (AppModel.Current.MaskTopHeight < 40)
413 381
             {
414
-                SizeRGB.Visibility = Visibility.Collapsed;
382
+                SizeRgb.Visibility = Visibility.Collapsed;
415 383
             }
416 384
             int need = SizeColorBar.Current.Selected == Tool.Null ? 30 : 67;
417 385
             if (AppModel.Current.MaskBottomHeight < need && AppModel.Current.MaskTopHeight < need)
@@ -428,32 +396,32 @@ namespace ComeCapture
428 396
 
429 397
         private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
430 398
         {
431
-            if (_IsCapture)
399
+            if (_isCapture)
432 400
             {
433 401
                 return;
434 402
             }
435 403
             System.Windows.Point point = e.GetPosition(this);
436
-            _X0 = point.X;
437
-            _Y0 = point.Y;
438
-            _IsMouseDown = true;
439
-            Canvas.SetLeft(MainImage, _X0);
440
-            Canvas.SetTop(MainImage, _Y0);
441
-            AppModel.Current.MaskLeftWidth = _X0;
442
-            AppModel.Current.MaskRightWidth = ScreenWidth - _X0;
443
-            AppModel.Current.MaskTopHeight = _Y0;
444
-            Show_Size.Visibility = Visibility.Visible;
404
+            _x0 = point.X;
405
+            _y0 = point.Y;
406
+            _isMouseDown = true;
407
+            Canvas.SetLeft(MainImage, _x0);
408
+            Canvas.SetTop(MainImage, _y0);
409
+            AppModel.Current.MaskLeftWidth = _x0;
410
+            AppModel.Current.MaskRightWidth = ScreenWidth - _x0;
411
+            AppModel.Current.MaskTopHeight = _y0;
412
+            ShowSize.Visibility = Visibility.Visible;
445 413
         }
446 414
 
447 415
         private void Window_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
448 416
         {
449
-            if (!_IsMouseDown || _IsCapture)
417
+            if (!_isMouseDown || _isCapture)
450 418
             {
451 419
                 return;
452 420
             }
453
-            _IsMouseDown = false;
421
+            _isMouseDown = false;
454 422
             if (MainImage.Width >= MinSize && MainImage.Height >= MinSize)
455 423
             {
456
-                _IsCapture = true;
424
+                _isCapture = true;
457 425
                 ImageEditBar.Current.Visibility = Visibility.Visible;
458 426
                 ImageEditBar.Current.ResetCanvas();
459 427
                 Cursor = Cursors.Arrow;
@@ -472,20 +440,18 @@ namespace ComeCapture
472 440
             {
473 441
                 MessageWindow.Show(ex.Message);
474 442
             }
475
-            if (_IsCapture)
443
+            if (_isCapture)
476 444
             {
477 445
                 return;
478 446
             }
479
-
480
-            if (Show_RGB.Visibility == Visibility.Collapsed)
447
+            if (ShowRgb.Visibility == Visibility.Collapsed)
481 448
             {
482
-                Show_RGB.Visibility = Visibility.Visible;
449
+                ShowRgb.Visibility = Visibility.Visible;
483 450
             }
484
-
485
-            if (_IsMouseDown)
451
+            if (_isMouseDown)
486 452
             {
487
-                double w = point.X - _X0;
488
-                double h = point.Y - _Y0;
453
+                double w = point.X - _x0;
454
+                double h = point.Y - _y0;
489 455
                 if (w < MinSize || h < MinSize)
490 456
                 {
491 457
                     return;
@@ -512,7 +478,7 @@ namespace ComeCapture
512 478
         {
513 479
             if (e.Key == Key.Escape)
514 480
             {
515
-                initialization();
481
+                Initialization();
516 482
                 Owner = null;
517 483
                 WindowState = WindowState.Minimized;
518 484
                 Visibility = Visibility.Hidden;
@@ -523,25 +489,26 @@ namespace ComeCapture
523 489
         #endregion 鼠标及键盘事件
524 490
 
525 491
         /// <summary>
526
-        /// 关闭时清除tool页记录的截图数据
492
+        ///     关闭时清除tool页记录的截图数据
527 493
         /// </summary>
528 494
         /// <param name="sender"></param>
529 495
         /// <param name="e"></param>
530 496
         private void Window_Closed(object sender, EventArgs e)
531 497
         {
532
-            click_closeJietuWindowClick();
498
+            if (ClickCloseJietuWindowClick != null)
499
+            {
500
+                ClickCloseJietuWindowClick();
501
+            }
533 502
         }
534 503
 
535 504
         /// <summary>
536
-        /// 非正常关闭时jietuWindow=null;
505
+        ///     非正常关闭时jietuWindow=null;
537 506
         /// </summary>
538
-        /// <param name="sender"></param>
539
-        /// <param name="e"></param>
540 507
         public delegate void CloseJietuWindowClick();
541 508
 
542 509
         /// <summary>
543
-        /// 非正常关闭时jietuWindow=null;
510
+        ///     非正常关闭时jietuWindow=null;
544 511
         /// </summary>
545
-        public event CloseJietuWindowClick click_closeJietuWindowClick;
512
+        public event CloseJietuWindowClick ClickCloseJietuWindowClick;
546 513
     }
547
-}
514
+}

+ 3
- 3
XHWK.WKTool/KeyVerification.xaml View File

@@ -5,7 +5,7 @@
5 5
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6 6
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7 7
     Title="KeyVerification"
8
-    Width="400"
8
+    Width="446"
9 9
     Height="200"
10 10
     AllowsTransparency="True"
11 11
     Background="Transparent"
@@ -19,14 +19,13 @@
19 19
     <Window.Resources />
20 20
     <Grid Margin="0,0,0,0" Background="White">
21 21
         <Grid.RowDefinitions>
22
-            <RowDefinition Height="50" />
22
+            <RowDefinition Height="40" />
23 23
             <RowDefinition Height="*" />
24 24
             <RowDefinition Height="75" />
25 25
         </Grid.RowDefinitions>
26 26
         <!--  头部  -->
27 27
         <Grid
28 28
             Grid.Row="0"
29
-            Height="50"
30 29
             Background="#4597FF"
31 30
             MouseLeftButtonDown="Window_MouseLeftButtonDown_1">
32 31
             <TextBlock
@@ -44,6 +43,7 @@
44 43
                 Grid.Row="0"
45 44
                 Padding="10,0,10,0"
46 45
                 HorizontalAlignment="Right"
46
+                VerticalAlignment="Center"
47 47
                 Click="CloseClick"
48 48
                 Content="×"
49 49
                 Cursor="Hand"

+ 1
- 1
XHWK.WKTool/KeyVerification.xaml.cs View File

@@ -83,7 +83,7 @@ namespace XHWK.WKTool
83 83
                     () =>
84 84
                     {
85 85
                         Hide();
86
-                        CreateAMicroLessonWindow win = new CreateAMicroLessonWindow();
86
+                        CreateWin win = new CreateWin();
87 87
                         //win.Topmost = true;
88 88
                         win.Show();
89 89
                         Thread.Sleep(200);

+ 43
- 46
XHWK.WKTool/LoadDialog.xaml View File

@@ -1,11 +1,8 @@
1
-<Window x:Class="XHWK.WKTool.LoadDialog"
2
-        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
-        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
-        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
-        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
-        xmlns:local="clr-namespace:XHWK.WKTool"
7
-      
8
-         Width="100"
1
+<Window
2
+    x:Class="XHWK.WKTool.LoadDialog"
3
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5
+    Width="100"
9 6
     Height="100"
10 7
     AllowsTransparency="True"
11 8
     Background="Transparent"
@@ -19,7 +16,7 @@
19 16
             <Grid Width="60" Height="60">
20 17
                 <Grid.Resources>
21 18
                     <DrawingBrush
22
-                        x:Key="brush"
19
+                        x:Key="Brush"
23 20
                         AlignmentX="Center"
24 21
                         AlignmentY="Top"
25 22
                         Stretch="None">
@@ -34,8 +31,8 @@
34 31
                 </Grid.Resources>
35 32
 
36 33
                 <Rectangle
37
-                    x:Name="r01"
38
-                    Fill="{StaticResource brush}"
34
+                    x:Name="R01"
35
+                    Fill="{StaticResource Brush}"
39 36
                     Opacity="0.8"
40 37
                     RenderTransformOrigin="0.5,0.5">
41 38
                     <Rectangle.RenderTransform>
@@ -43,8 +40,8 @@
43 40
                     </Rectangle.RenderTransform>
44 41
                 </Rectangle>
45 42
                 <Rectangle
46
-                    x:Name="r02"
47
-                    Fill="{StaticResource brush}"
43
+                    x:Name="R02"
44
+                    Fill="{StaticResource Brush}"
48 45
                     Opacity="0.8"
49 46
                     RenderTransformOrigin="0.5,0.5">
50 47
                     <Rectangle.RenderTransform>
@@ -52,8 +49,8 @@
52 49
                     </Rectangle.RenderTransform>
53 50
                 </Rectangle>
54 51
                 <Rectangle
55
-                    x:Name="r03"
56
-                    Fill="{StaticResource brush}"
52
+                    x:Name="R03"
53
+                    Fill="{StaticResource Brush}"
57 54
                     Opacity="0.8"
58 55
                     RenderTransformOrigin="0.5,0.5">
59 56
                     <Rectangle.RenderTransform>
@@ -61,8 +58,8 @@
61 58
                     </Rectangle.RenderTransform>
62 59
                 </Rectangle>
63 60
                 <Rectangle
64
-                    x:Name="r04"
65
-                    Fill="{StaticResource brush}"
61
+                    x:Name="R04"
62
+                    Fill="{StaticResource Brush}"
66 63
                     Opacity="0.8"
67 64
                     RenderTransformOrigin="0.5,0.5">
68 65
                     <Rectangle.RenderTransform>
@@ -70,8 +67,8 @@
70 67
                     </Rectangle.RenderTransform>
71 68
                 </Rectangle>
72 69
                 <Rectangle
73
-                    x:Name="r05"
74
-                    Fill="{StaticResource brush}"
70
+                    x:Name="R05"
71
+                    Fill="{StaticResource Brush}"
75 72
                     Opacity="0.8"
76 73
                     RenderTransformOrigin="0.5,0.5">
77 74
                     <Rectangle.RenderTransform>
@@ -79,8 +76,8 @@
79 76
                     </Rectangle.RenderTransform>
80 77
                 </Rectangle>
81 78
                 <Rectangle
82
-                    x:Name="r06"
83
-                    Fill="{StaticResource brush}"
79
+                    x:Name="R06"
80
+                    Fill="{StaticResource Brush}"
84 81
                     Opacity="0.8"
85 82
                     RenderTransformOrigin="0.5,0.5">
86 83
                     <Rectangle.RenderTransform>
@@ -88,8 +85,8 @@
88 85
                     </Rectangle.RenderTransform>
89 86
                 </Rectangle>
90 87
                 <Rectangle
91
-                    x:Name="r07"
92
-                    Fill="{StaticResource brush}"
88
+                    x:Name="R07"
89
+                    Fill="{StaticResource Brush}"
93 90
                     Opacity="0.8"
94 91
                     RenderTransformOrigin="0.5,0.5">
95 92
                     <Rectangle.RenderTransform>
@@ -97,8 +94,8 @@
97 94
                     </Rectangle.RenderTransform>
98 95
                 </Rectangle>
99 96
                 <Rectangle
100
-                    x:Name="r08"
101
-                    Fill="{StaticResource brush}"
97
+                    x:Name="R08"
98
+                    Fill="{StaticResource Brush}"
102 99
                     Opacity="0.8"
103 100
                     RenderTransformOrigin="0.5,0.5">
104 101
                     <Rectangle.RenderTransform>
@@ -106,8 +103,8 @@
106 103
                     </Rectangle.RenderTransform>
107 104
                 </Rectangle>
108 105
                 <Rectangle
109
-                    x:Name="r09"
110
-                    Fill="{StaticResource brush}"
106
+                    x:Name="R09"
107
+                    Fill="{StaticResource Brush}"
111 108
                     Opacity="0.8"
112 109
                     RenderTransformOrigin="0.5,0.5">
113 110
                     <Rectangle.RenderTransform>
@@ -115,8 +112,8 @@
115 112
                     </Rectangle.RenderTransform>
116 113
                 </Rectangle>
117 114
                 <Rectangle
118
-                    x:Name="r10"
119
-                    Fill="{StaticResource brush}"
115
+                    x:Name="R10"
116
+                    Fill="{StaticResource Brush}"
120 117
                     Opacity="0.8"
121 118
                     RenderTransformOrigin="0.5,0.5">
122 119
                     <Rectangle.RenderTransform>
@@ -124,8 +121,8 @@
124 121
                     </Rectangle.RenderTransform>
125 122
                 </Rectangle>
126 123
                 <Rectangle
127
-                    x:Name="r11"
128
-                    Fill="{StaticResource brush}"
124
+                    x:Name="R11"
125
+                    Fill="{StaticResource Brush}"
129 126
                     Opacity="0.8"
130 127
                     RenderTransformOrigin="0.5,0.5">
131 128
                     <Rectangle.RenderTransform>
@@ -133,8 +130,8 @@
133 130
                     </Rectangle.RenderTransform>
134 131
                 </Rectangle>
135 132
                 <Rectangle
136
-                    x:Name="r12"
137
-                    Fill="{StaticResource brush}"
133
+                    x:Name="R12"
134
+                    Fill="{StaticResource Brush}"
138 135
                     Opacity="0.8"
139 136
                     RenderTransformOrigin="0.5,0.5">
140 137
                     <Rectangle.RenderTransform>
@@ -148,84 +145,84 @@
148 145
                                 <DoubleAnimation
149 146
                                     AutoReverse="True"
150 147
                                     BeginTime="0:0:0.00000"
151
-                                    Storyboard.TargetName="r01"
148
+                                    Storyboard.TargetName="R01"
152 149
                                     Storyboard.TargetProperty="Opacity"
153 150
                                     To="0"
154 151
                                     Duration="0:0:0.08333" />
155 152
                                 <DoubleAnimation
156 153
                                     AutoReverse="True"
157 154
                                     BeginTime="0:0:0.08333"
158
-                                    Storyboard.TargetName="r02"
155
+                                    Storyboard.TargetName="R02"
159 156
                                     Storyboard.TargetProperty="Opacity"
160 157
                                     To="0"
161 158
                                     Duration="0:0:0.08333" />
162 159
                                 <DoubleAnimation
163 160
                                     AutoReverse="True"
164 161
                                     BeginTime="0:0:0.16666"
165
-                                    Storyboard.TargetName="r03"
162
+                                    Storyboard.TargetName="R03"
166 163
                                     Storyboard.TargetProperty="Opacity"
167 164
                                     To="0"
168 165
                                     Duration="0:0:0.08333" />
169 166
                                 <DoubleAnimation
170 167
                                     AutoReverse="True"
171 168
                                     BeginTime="0:0:0.24999"
172
-                                    Storyboard.TargetName="r04"
169
+                                    Storyboard.TargetName="R04"
173 170
                                     Storyboard.TargetProperty="Opacity"
174 171
                                     To="0"
175 172
                                     Duration="0:0:0.08333" />
176 173
                                 <DoubleAnimation
177 174
                                     AutoReverse="True"
178 175
                                     BeginTime="0:0:0.33332"
179
-                                    Storyboard.TargetName="r05"
176
+                                    Storyboard.TargetName="R05"
180 177
                                     Storyboard.TargetProperty="Opacity"
181 178
                                     To="0"
182 179
                                     Duration="0:0:0.08333" />
183 180
                                 <DoubleAnimation
184 181
                                     AutoReverse="True"
185 182
                                     BeginTime="0:0:0.41665"
186
-                                    Storyboard.TargetName="r06"
183
+                                    Storyboard.TargetName="R06"
187 184
                                     Storyboard.TargetProperty="Opacity"
188 185
                                     To="0"
189 186
                                     Duration="0:0:0.08333" />
190 187
                                 <DoubleAnimation
191 188
                                     AutoReverse="True"
192 189
                                     BeginTime="0:0:0.49998"
193
-                                    Storyboard.TargetName="r07"
190
+                                    Storyboard.TargetName="R07"
194 191
                                     Storyboard.TargetProperty="Opacity"
195 192
                                     To="0"
196 193
                                     Duration="0:0:0.08333" />
197 194
                                 <DoubleAnimation
198 195
                                     AutoReverse="True"
199 196
                                     BeginTime="0:0:0.58331"
200
-                                    Storyboard.TargetName="r08"
197
+                                    Storyboard.TargetName="R08"
201 198
                                     Storyboard.TargetProperty="Opacity"
202 199
                                     To="0"
203 200
                                     Duration="0:0:0.08333" />
204 201
                                 <DoubleAnimation
205 202
                                     AutoReverse="True"
206 203
                                     BeginTime="0:0:0.66664"
207
-                                    Storyboard.TargetName="r09"
204
+                                    Storyboard.TargetName="R09"
208 205
                                     Storyboard.TargetProperty="Opacity"
209 206
                                     To="0"
210 207
                                     Duration="0:0:0.08333" />
211 208
                                 <DoubleAnimation
212 209
                                     AutoReverse="True"
213 210
                                     BeginTime="0:0:0.74997"
214
-                                    Storyboard.TargetName="r10"
211
+                                    Storyboard.TargetName="R10"
215 212
                                     Storyboard.TargetProperty="Opacity"
216 213
                                     To="0"
217 214
                                     Duration="0:0:0.08333" />
218 215
                                 <DoubleAnimation
219 216
                                     AutoReverse="True"
220 217
                                     BeginTime="0:0:0.83330"
221
-                                    Storyboard.TargetName="r11"
218
+                                    Storyboard.TargetName="R11"
222 219
                                     Storyboard.TargetProperty="Opacity"
223 220
                                     To="0"
224 221
                                     Duration="0:0:0.08333" />
225 222
                                 <DoubleAnimation
226 223
                                     AutoReverse="True"
227 224
                                     BeginTime="0:0:0.91663"
228
-                                    Storyboard.TargetName="r12"
225
+                                    Storyboard.TargetName="R12"
229 226
                                     Storyboard.TargetProperty="Opacity"
230 227
                                     To="0"
231 228
                                     Duration="0:0:0.08333" />
@@ -236,4 +233,4 @@
236 233
             </Grid>
237 234
         </Border>
238 235
     </Grid>
239
-</Window>
236
+</Window>

+ 3
- 5
XHWK.WKTool/LoadDialog.xaml.cs View File

@@ -1,11 +1,9 @@
1
-using System.Windows;
2
-
3
-namespace XHWK.WKTool
1
+namespace XHWK.WKTool
4 2
 {
5 3
     /// <summary>
6
-    /// LoadDialog.xaml 的交互逻辑
4
+    ///     LoadDialog.xaml 的交互逻辑
7 5
     /// </summary>
8
-    public partial class LoadDialog : Window
6
+    public partial class LoadDialog
9 7
     {
10 8
         public LoadDialog()
11 9
         {

+ 20
- 58
XHWK.WKTool/LoginWindow.xaml.cs View File

@@ -1,11 +1,11 @@
1 1
 using System;
2 2
 using System.Configuration;
3 3
 using System.Text;
4
-using System.Text.RegularExpressions;
5 4
 
6 5
 //using System.Text.RegularExpressions;
7 6
 using System.Windows;
8 7
 using System.Windows.Input;
8
+
9 9
 using XHWK.WKTool.DAL;
10 10
 
11 11
 namespace XHWK.WKTool
@@ -13,19 +13,18 @@ namespace XHWK.WKTool
13 13
     using system;
14 14
 
15 15
     /// <summary>
16
-    /// LoginWindow.xaml 的交互逻辑
16
+    ///     LoginWindow.xaml 的交互逻辑
17 17
     /// </summary>
18 18
     public partial class LoginWindow
19 19
     {
20 20
         /// <summary>
21
-        /// 调用接口
21
+        ///     调用接口
22 22
         /// </summary>
23 23
         private readonly XhApi _xhapi = new XhApi();
24 24
 
25 25
         public LoginWindow()
26 26
         {
27 27
             InitializeComponent();
28
-
29 28
             Initialize();
30 29
         }
31 30
 
@@ -44,7 +43,7 @@ namespace XHWK.WKTool
44 43
         }
45 44
 
46 45
         /// <summary>
47
-        /// 关闭事件
46
+        ///     关闭事件
48 47
         /// </summary>
49 48
         /// <param name="sender">
50 49
         /// </param>
@@ -58,7 +57,7 @@ namespace XHWK.WKTool
58 57
         }
59 58
 
60 59
         /// <summary>
61
-        /// 登录事件
60
+        ///     登录事件
62 61
         /// </summary>
63 62
         /// <param name="sender">
64 63
         /// </param>
@@ -97,12 +96,12 @@ namespace XHWK.WKTool
97 96
         }
98 97
 
99 98
         /// <summary>
100
-        /// 登录
99
+        ///     登录
101 100
         /// </summary>
102 101
         private void Login()
103 102
         {
104
-            var accountNumber = TxbAccountNumber.Text.Replace(" ", "").Trim();
105
-            var password = PobPassword.Password.Replace(" ", "").Trim();
103
+            string accountNumber = TxbAccountNumber.Text.Replace(" ", "").Trim();
104
+            string password = PobPassword.Password.Replace(" ", "").Trim();
106 105
             int code = _xhapi.Login(accountNumber, password);
107 106
             if (code == 0)
108 107
             {
@@ -111,8 +110,7 @@ namespace XHWK.WKTool
111 110
                 if (CkSaveName.IsChecked == true)
112 111
                 {
113 112
                     string accountNumbers = TxbAccountNumber.Text;
114
-                    System.IO.File.WriteAllText
115
-                    (
113
+                    System.IO.File.WriteAllText(
116 114
                         applicationData,
117 115
                         accountNumbers,
118 116
                         Encoding.Default
@@ -121,8 +119,7 @@ namespace XHWK.WKTool
121 119
                 else
122 120
                 {
123 121
                     string accountNumbers = "";
124
-                    System.IO.File.WriteAllText
125
-                    (
122
+                    System.IO.File.WriteAllText(
126 123
                         applicationData,
127 124
                         accountNumbers,
128 125
                         Encoding.Default
@@ -156,18 +153,16 @@ namespace XHWK.WKTool
156 153
         }
157 154
 
158 155
         /// <summary>
159
-        /// 记住账号
156
+        ///     记住账号
160 157
         /// </summary>
161 158
         /// <param name="sender">
162 159
         /// </param>
163 160
         /// <param name="e">
164 161
         /// </param>
165
-        private void CkSaveName_Click(object sender, RoutedEventArgs e)
166
-        {
167
-        }
162
+        private void CkSaveName_Click(object sender, RoutedEventArgs e) { }
168 163
 
169 164
         /// <summary>
170
-        /// 读取客户设置
165
+        ///     读取客户设置
171 166
         /// </summary>
172 167
         /// <param name="settingName">
173 168
         /// </param>
@@ -187,7 +182,7 @@ namespace XHWK.WKTool
187 182
         }
188 183
 
189 184
         /// <summary>
190
-        /// 更新设置
185
+        ///     更新设置
191 186
         /// </summary>
192 187
         /// <param name="settingName">
193 188
         /// </param>
@@ -196,7 +191,6 @@ namespace XHWK.WKTool
196 191
         public static void UpdateSettingString(string settingName, string valueName)
197 192
         {
198 193
             Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
199
-
200 194
             if (ConfigurationManager.AppSettings[settingName] != null)
201 195
             {
202 196
                 config.AppSettings.Settings.Remove(settingName);
@@ -206,38 +200,6 @@ namespace XHWK.WKTool
206 200
             ConfigurationManager.RefreshSection("appSettings");
207 201
         }
208 202
 
209
-        /// <summary>
210
-        /// 限制输入特殊字符
211
-        /// </summary>
212
-        /// <param name="sender">
213
-        /// </param>
214
-        /// <param name="e">
215
-        /// </param>
216
-        private void TxbAccountNumberPreviewTextInput(object sender, TextCompositionEventArgs e)
217
-        {
218
-            try
219
-            {
220
-                Regex re = new Regex("[^0-9\\-]+");
221
-                Regex re1 = new Regex("[^A-Za-z\\-]+");
222
-                if (!re.IsMatch(e.Text))
223
-                {
224
-                    e.Handled = re.IsMatch(e.Text);
225
-                }
226
-                else if (!re1.IsMatch(e.Text))
227
-                {
228
-                    e.Handled = re1.IsMatch(e.Text);
229
-                }
230
-                else
231
-                {
232
-                    e.Handled = true;
233
-                }
234
-            }
235
-            catch (Exception)
236
-            {
237
-                // ignored
238
-            }
239
-        }
240
-
241 203
         private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
242 204
         {
243 205
             DragMove();
@@ -246,7 +208,7 @@ namespace XHWK.WKTool
246 208
         #region 服务地址
247 209
 
248 210
         /// <summary>
249
-        /// 打开服务地址
211
+        ///     打开服务地址
250 212
         /// </summary>
251 213
         /// <param name="sender">
252 214
         /// </param>
@@ -259,7 +221,7 @@ namespace XHWK.WKTool
259 221
         }
260 222
 
261 223
         /// <summary>
262
-        /// 取消
224
+        ///     取消
263 225
         /// </summary>
264 226
         /// <param name="sender">
265 227
         /// </param>
@@ -272,7 +234,7 @@ namespace XHWK.WKTool
272 234
         }
273 235
 
274 236
         /// <summary>
275
-        /// 服务地址设置
237
+        ///     服务地址设置
276 238
         /// </summary>
277 239
         /// <param name="sender">
278 240
         /// </param>
@@ -303,7 +265,7 @@ namespace XHWK.WKTool
303 265
         #region 切换校内外
304 266
 
305 267
         /// <summary>
306
-        /// 校外
268
+        ///     校外
307 269
         /// </summary>
308 270
         /// <param name="sender">
309 271
         /// </param>
@@ -320,7 +282,7 @@ namespace XHWK.WKTool
320 282
         }
321 283
 
322 284
         /// <summary>
323
-        /// 校内
285
+        ///     校内
324 286
         /// </summary>
325 287
         /// <param name="sender">
326 288
         /// </param>
@@ -340,4 +302,4 @@ namespace XHWK.WKTool
340 302
 
341 303
         #endregion 服务地址
342 304
     }
343
-}
305
+}

+ 8
- 8
XHWK.WKTool/MainWindow.xaml View File

@@ -563,7 +563,7 @@
563 563
                                                             Cursor="SizeAll"
564 564
                                                             Fill="#00000000"
565 565
                                                             SnapsToDevicePixels="True"
566
-                                                            Stroke="#3f6fff"
566
+                                                            Stroke="#4597FF"
567 567
                                                             StrokeDashArray="4 4"
568 568
                                                             StrokeThickness="4"
569 569
                                                             Visibility="Hidden" />
@@ -590,7 +590,7 @@
590 590
                                                                 HorizontalAlignment="Left"
591 591
                                                                 VerticalAlignment="Top"
592 592
                                                                 Background="White"
593
-                                                                BorderBrush="#3f6fff"
593
+                                                                BorderBrush="#4597FF"
594 594
                                                                 BorderThickness="2"
595 595
                                                                 Cursor="SizeNWSE"
596 596
                                                                 DragCompleted="RectRightUp_DragCompleted"
@@ -606,7 +606,7 @@
606 606
                                                                 HorizontalAlignment="Left"
607 607
                                                                 VerticalAlignment="Top"
608 608
                                                                 Background="White"
609
-                                                                BorderBrush="#3f6fff"
609
+                                                                BorderBrush="#4597FF"
610 610
                                                                 BorderThickness="2"
611 611
                                                                 Cursor="SizeNESW"
612 612
                                                                 DragCompleted="RectRightUp_DragCompleted"
@@ -622,7 +622,7 @@
622 622
                                                                 HorizontalAlignment="Left"
623 623
                                                                 VerticalAlignment="Top"
624 624
                                                                 Background="White"
625
-                                                                BorderBrush="#3f6fff"
625
+                                                                BorderBrush="#4597FF"
626 626
                                                                 BorderThickness="2"
627 627
                                                                 Cursor="SizeNESW"
628 628
                                                                 DragCompleted="RectRightUp_DragCompleted"
@@ -638,7 +638,7 @@
638 638
                                                                 HorizontalAlignment="Left"
639 639
                                                                 VerticalAlignment="Top"
640 640
                                                                 Background="White"
641
-                                                                BorderBrush="#3f6fff"
641
+                                                                BorderBrush="#4597FF"
642 642
                                                                 BorderThickness="2"
643 643
                                                                 Cursor="SizeNWSE"
644 644
                                                                 DragCompleted="RectRightUp_DragCompleted"
@@ -1337,7 +1337,7 @@
1337 1337
                                                 Height="30"
1338 1338
                                                 HorizontalAlignment="Stretch"
1339 1339
                                                 VerticalAlignment="Stretch"
1340
-                                                Background="#3f6fff"
1340
+                                                Background="#4597FF"
1341 1341
                                                 Click="BtnBrowse_Click"
1342 1342
                                                 Content="浏览"
1343 1343
                                                 Cursor="Hand"
@@ -1351,7 +1351,7 @@
1351 1351
                                                 Height="30"
1352 1352
                                                 HorizontalAlignment="Stretch"
1353 1353
                                                 VerticalAlignment="Stretch"
1354
-                                                Background="#3f6fff"
1354
+                                                Background="#4597FF"
1355 1355
                                                 Click="btnOpen_Click"
1356 1356
                                                 Content="打开"
1357 1357
                                                 Cursor="Hand"
@@ -1455,7 +1455,7 @@
1455 1455
                                             Height="30"
1456 1456
                                             HorizontalAlignment="Stretch"
1457 1457
                                             VerticalAlignment="Center"
1458
-                                            Background="#3f6fff"
1458
+                                            Background="#4597FF"
1459 1459
                                             Click="BtnSave_Click"
1460 1460
                                             Content="保存"
1461 1461
                                             Cursor="Hand"

+ 230
- 334
XHWK.WKTool/MainWindow.xaml.cs
File diff suppressed because it is too large
View File


+ 3
- 3
XHWK.WKTool/MessageWindow.xaml View File

@@ -20,7 +20,7 @@
20 20
 
21 21
     <Border
22 22
         Background="White"
23
-        BorderBrush="#3f6fff"
23
+        BorderBrush="#4597FF"
24 24
         BorderThickness="0">
25 25
         <Grid>
26 26
             <Grid.RowDefinitions>
@@ -28,7 +28,7 @@
28 28
                 <RowDefinition Height="*" />
29 29
                 <RowDefinition Height="60" />
30 30
             </Grid.RowDefinitions>
31
-            <Grid Grid.Row="0" Background="#3f6fff">
31
+            <Grid Grid.Row="0" Background="#4597FF">
32 32
                 <Label
33 33
                     x:Name="LblTitle"
34 34
                     Margin="14,0,0,0"
@@ -69,7 +69,7 @@
69 69
                     Margin="0,0,10,0"
70 70
                     HorizontalAlignment="Right"
71 71
                     VerticalAlignment="Center"
72
-                    Background="#3f6fff"
72
+                    Background="#4597FF"
73 73
                     CornerRadius="6">
74 74
                     <Button
75 75
                         x:Name="BtnOk"

+ 64
- 49
XHWK.WKTool/MessageWindow.xaml.cs View File

@@ -4,20 +4,25 @@ using System.Windows.Input;
4 4
 namespace XHWK.WKTool
5 5
 {
6 6
     /// <summary>
7
-    /// 消息提示框 .show()
7
+    ///     消息提示框 .show()
8 8
     /// </summary>
9
-    public partial class MessageWindow : Window
9
+    public partial class MessageWindow
10 10
     {
11 11
         /// <summary>
12
-        /// 提示框
12
+        ///     提示框
13 13
         /// </summary>
14
-        /// <param name="MessageType">取消按钮  1不显示2显示</param>
15
-        /// <param name="Title">标题</param>
16
-        /// <param name="content">消息内容</param>
17
-        public MessageWindow(int MessageType, string Title, string Content)
14
+        /// <param name="messageType">取消按钮  1不显示2显示</param>
15
+        /// <param name="title">标题</param>
16
+        /// <param name="content"></param>
17
+        public MessageWindow
18
+        (
19
+            int messageType,
20
+            string title,
21
+            string content
22
+        )
18 23
         {
19 24
             InitializeComponent();
20
-            switch (MessageType)
25
+            switch (messageType)
21 26
             {
22 27
                 case 1:
23 28
                     BorCancel.Visibility = Visibility.Hidden;
@@ -25,25 +30,24 @@ namespace XHWK.WKTool
25 30
                 case 2:
26 31
                     BorCancel.Visibility = Visibility.Visible;
27 32
                     break;
28
-                default:
29
-                    break;
30 33
             }
31
-            LblTitle.Content = Title;
32
-            if (!string.IsNullOrWhiteSpace(Content))
34
+            LblTitle.Content = title;
35
+            if (!string.IsNullOrWhiteSpace(content))
33 36
             {
34
-                if (Content.Length > 143)
37
+                if (content.Length > 143)
35 38
                 {
36
-                    Content = Content.Substring(0, 140) + "...";
39
+                    content = content.Substring(0, 140) + "...";
37 40
                 }
38
-                TbkContent.Text = Content;
41
+                TbkContent.Text = content;
39 42
             }
40 43
             else
41 44
             {
42
-                TbkContent.Text = "错误!";
45
+                TbkContent.Text = "请求失败请重试!";
43 46
             }
44 47
         }
48
+
45 49
         /// <summary>
46
-        /// 取消
50
+        ///     取消
47 51
         /// </summary>
48 52
         /// <param name="sender"></param>
49 53
         /// <param name="e"></param>
@@ -51,8 +55,9 @@ namespace XHWK.WKTool
51 55
         {
52 56
             DialogResult = false;
53 57
         }
58
+
54 59
         /// <summary>
55
-        /// 确定
60
+        ///     确定
56 61
         /// </summary>
57 62
         /// <param name="sender"></param>
58 63
         /// <param name="e"></param>
@@ -60,64 +65,74 @@ namespace XHWK.WKTool
60 65
         {
61 66
             DialogResult = true;
62 67
         }
68
+
63 69
         /// <summary>
64
-        /// 消息提示框
70
+        ///     消息提示框
65 71
         /// </summary>
66
-        /// <param name="Message">消息</param>
72
+        /// <param name="message">消息</param>
67 73
         /// <returns></returns>
68
-        public static MessageBoxResult Show(string Message)
74
+        public static MessageBoxResult Show(string message)
69 75
         {
70
-            string Title = "消息提示";
71
-            return Show(Message, Title);
76
+            string title = "消息提示";
77
+            return Show(message, title);
72 78
         }
79
+
73 80
         /// <summary>
74
-        /// 消息提示框
81
+        ///     消息提示框
75 82
         /// </summary>
76
-        /// <param name="Message">消息</param>
83
+        /// <param name="content">消息</param>
84
+        /// <param name="title"></param>
77 85
         /// <returns></returns>
78
-        public static MessageBoxResult Show(string Message, string Title)
86
+        public static MessageBoxResult Show(string content, string title)
79 87
         {
80
-            MessageWindow message = new MessageWindow(1, Title, Message);
88
+            MessageWindow message = new MessageWindow(
89
+                1,
90
+                title,
91
+                content
92
+            );
81 93
             message.ShowDialog();
82 94
             return MessageBoxResult.Cancel;
83 95
         }
96
+
84 97
         /// <summary>
85
-        /// 消息提示框
98
+        ///     消息提示框
86 99
         /// </summary>
87
-        /// <param name="Title">标题</param>
88
-        /// <param name="Message">消息</param>
100
+        /// <param name="title">标题</param>
101
+        /// <param name="content">消息</param>
102
+        /// <param name="messageBox"></param>
89 103
         /// <returns></returns>
90
-        public static MessageBoxResult Show(string Message, string Title, MessageBoxButton messageBox)
104
+        public static MessageBoxResult Show
105
+        (
106
+            string content,
107
+            string title,
108
+            MessageBoxButton messageBox
109
+        )
91 110
         {
92
-            if (string.IsNullOrWhiteSpace(Title))
111
+            if (string.IsNullOrWhiteSpace(title))
93 112
             {
94
-                Title = "消息提示";
113
+                title = "消息提示";
95 114
             }
96
-            MessageWindow message = new MessageWindow(2, Title, Message);
115
+            MessageWindow message = new MessageWindow(
116
+                2,
117
+                title,
118
+                content
119
+            );
97 120
             bool? res = message.ShowDialog();
98
-            if ((bool)res)
121
+            if (res != null && (bool)res)
99 122
             {
100 123
                 if (messageBox == MessageBoxButton.OKCancel)
101 124
                 {
102 125
                     return MessageBoxResult.OK;
103 126
                 }
104
-                else
105
-                {
106
-                    return MessageBoxResult.Yes;
107
-                }
127
+                return MessageBoxResult.Yes;
108 128
             }
109
-            else
129
+            if (messageBox == MessageBoxButton.OKCancel)
110 130
             {
111
-                if (messageBox == MessageBoxButton.OKCancel)
112
-                {
113
-                    return MessageBoxResult.Cancel;
114
-                }
115
-                else
116
-                {
117
-                    return MessageBoxResult.No;
118
-                }
131
+                return MessageBoxResult.Cancel;
119 132
             }
133
+            return MessageBoxResult.No;
120 134
         }
135
+
121 136
         private static MessageBoxResult Win32ToMessageBoxResult(int value)
122 137
         {
123 138
             switch (value)
@@ -144,4 +159,4 @@ namespace XHWK.WKTool
144 159
             }
145 160
         }
146 161
     }
147
-}
162
+}

+ 9
- 9
XHWK.WKTool/MinToolbar.xaml.cs View File

@@ -4,36 +4,36 @@ using System.Windows.Media;
4 4
 namespace XHWK.WKTool
5 5
 {
6 6
     /// <summary>
7
-    /// 最小化工具栏
7
+    ///     最小化工具栏
8 8
     /// </summary>
9 9
     public partial class MinToolbar
10 10
     {
11 11
         /// <summary>
12
-        /// 屏幕宽
12
+        ///     屏幕宽
13 13
         /// </summary>
14 14
         internal double pwidth = SystemParameters.PrimaryScreenWidth;
15 15
 
16 16
         /// <summary>
17
-        /// 屏幕高
17
+        ///     屏幕高
18 18
         /// </summary>
19 19
         internal double pHeight = SystemParameters.PrimaryScreenHeight;
20
+
20 21
         public MinToolbar()
21 22
         {
22 23
             InitializeComponent();
23 24
             ResizeMode = ResizeMode.NoResize;
24 25
             Topmost = true;
25
-
26 26
         }
27 27
 
28 28
         /// <summary>
29
-        /// 初始化隐藏工具栏位置颜色
29
+        ///     初始化隐藏工具栏位置颜色
30 30
         /// </summary>
31 31
         /// <param name="top"></param>
32 32
         /// <param name="thisHeight"></param>
33 33
         public void Initialize(double top, double thisHeight)
34 34
         {
35
-            var desktopWorkingArea = System.Windows.SystemParameters.WorkArea;
36
-            Left = desktopWorkingArea.Right - this.Width + 7;
35
+            Rect desktopWorkingArea = System.Windows.SystemParameters.WorkArea;
36
+            Left = desktopWorkingArea.Right - Width + 7;
37 37
             Top = top;
38 38
             // ReSharper disable once PossibleNullReferenceException
39 39
             BorderBlack.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF638AFF"));
@@ -42,8 +42,8 @@ namespace XHWK.WKTool
42 42
 
43 43
         private void buttonMin_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
44 44
         {
45
-            this.Hide();
45
+            Hide();
46 46
             App.W_ScreenRecordingToolbarWindow.MaxToobar();
47 47
         }
48 48
     }
49
-}
49
+}

+ 2
- 3
XHWK.WKTool/PracticeWindow.xaml View File

@@ -3,7 +3,6 @@
3 3
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 4
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5 5
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
-        xmlns:local="clr-namespace:XHWK.WKTool"
7 6
         mc:Ignorable="d"
8 7
         Title="PracticeWindow"  Width="1280"
9 8
     Height="800"
@@ -14,7 +13,7 @@
14 13
     ShowInTaskbar="False"
15 14
     WindowStyle="None">
16 15
     <Grid>
17
-        <Image x:Name="imgCanvas"/>
18
-        <InkCanvas Grid.Row="0" x:Name="blackboard_canvas" PreviewMouseRightButtonDown="blackboard_canvas_PreviewMouseRightButtonDown" Background="#021B1919" Visibility="Visible" Grid.ColumnSpan="2"/>
16
+        <Image x:Name="ImgCanvas"/>
17
+        <InkCanvas Grid.Row="0" x:Name="BlackboardCanvas" PreviewMouseRightButtonDown="blackboard_canvas_PreviewMouseRightButtonDown" Background="#021B1919" Visibility="Visible" Grid.ColumnSpan="2"/>
19 18
     </Grid>
20 19
 </Window>

+ 135
- 133
XHWK.WKTool/PracticeWindow.xaml.cs View File

@@ -1,4 +1,5 @@
1 1
 using Common.system;
2
+
2 3
 using System;
3 4
 using System.Threading;
4 5
 using System.Windows;
@@ -6,12 +7,13 @@ using System.Windows.Controls;
6 7
 using System.Windows.Ink;
7 8
 using System.Windows.Input;
8 9
 using System.Windows.Media;
10
+
9 11
 using XHWK.Model;
10 12
 
11 13
 namespace XHWK.WKTool
12 14
 {
13 15
     /// <summary>
14
-    /// 录屏画板
16
+    ///     录屏画板
15 17
     /// </summary>
16 18
     public partial class PracticeWindow
17 19
     {
@@ -22,39 +24,38 @@ namespace XHWK.WKTool
22 24
         private ViewModel _viewModel;
23 25
 
24 26
         /// <summary>
25
-        /// 0 画笔 1 矩形 2 圆形
27
+        ///     0 画笔 1 矩形 2 圆形
26 28
         /// </summary>
27 29
 #pragma warning disable CS0414
28 30
         private int _flg;
29 31
 #pragma warning restore CS0414
30 32
 
31 33
         /// <summary>
32
-        /// 当前画笔颜色
34
+        ///     当前画笔颜色
33 35
         /// </summary>
34 36
         private Color _colour = Colors.Red;
35 37
 
36 38
         /// <summary>
37
-        /// 当前画笔宽
39
+        ///     当前画笔宽
38 40
         /// </summary>
39 41
         private int _wit = 2;
40 42
 
41 43
         /// <summary>
42
-        /// 当前画笔高
44
+        ///     当前画笔高
43 45
         /// </summary>
44 46
         private int _hei = 2;
45 47
 
46 48
         public PracticeWindow()
47 49
         {
48 50
             InitializeComponent();
49
-
50 51
             InitTqlpPen();
51 52
         }
52 53
 
53 54
         public void Initialize(string imgPath = null)
54 55
         {
55 56
             _flg = 0;
56
-            blackboard_canvas.Strokes.Clear();
57
-            blackboard_canvas.UseCustomCursor = true;
57
+            BlackboardCanvas.Strokes.Clear();
58
+            BlackboardCanvas.UseCustomCursor = true;
58 59
             //blackboard_canvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
59 60
             //加背景 废弃更利于讲解ppt
60 61
             //if (File.Exists(_imgPath))
@@ -71,26 +72,21 @@ namespace XHWK.WKTool
71 72
 
72 73
             ////将 InkCanvas 的 DefaultDrawingAttributes 属性的值赋成创建的 DrawingAttributes 类的对象的引用
73 74
             ////InkCanvas 通过 DefaultDrawingAttributes 属性来获取墨迹的各种设置,该属性的类型为 DrawingAttributes 型
74
-            blackboard_canvas.DefaultDrawingAttributes = _drawingAttributes;
75
+            BlackboardCanvas.DefaultDrawingAttributes = _drawingAttributes;
75 76
             Pen();
76 77
             //blackboard_canvas.Cursor = Cursors.Pen;
77 78
 
78 79
             //Cursor cus = new Cursor(@"G:\06.cur");
79 80
 
80 81
             //blackboard_canvas.Cursor = cus;
81
-
82
-            _viewModel = new ViewModel
83
-            {
84
-                InkStrokes = new StrokeCollection(),
85
-            };
86
-
82
+            _viewModel = new ViewModel { InkStrokes = new StrokeCollection(), };
87 83
             DataContext = _viewModel;
88 84
             //APP.W_ScreenRecordingToolbarWindow.Owner = this;
89 85
             //APP.W_ScreenRecordingToolbarWindow.Topmost = true;
90 86
         }
91 87
 
92 88
         /// <summary>
93
-        /// 画笔颜色事件 白色
89
+        ///     画笔颜色事件 白色
94 90
         /// </summary>
95 91
         public void White()
96 92
         {
@@ -100,7 +96,7 @@ namespace XHWK.WKTool
100 96
         }
101 97
 
102 98
         /// <summary>
103
-        /// 画笔颜色事件 红色
99
+        ///     画笔颜色事件 红色
104 100
         /// </summary>
105 101
         public void Red()
106 102
         {
@@ -109,7 +105,7 @@ namespace XHWK.WKTool
109 105
         }
110 106
 
111 107
         /// <summary>
112
-        /// 画笔颜色事件 黑色
108
+        ///     画笔颜色事件 黑色
113 109
         /// </summary>
114 110
         public void Gray()
115 111
         {
@@ -119,7 +115,7 @@ namespace XHWK.WKTool
119 115
         }
120 116
 
121 117
         /// <summary>
122
-        /// 画笔颜色事件 青色
118
+        ///     画笔颜色事件 青色
123 119
         /// </summary>
124 120
         public void CyanBlue()
125 121
         {
@@ -129,7 +125,7 @@ namespace XHWK.WKTool
129 125
         }
130 126
 
131 127
         /// <summary>
132
-        /// 画笔颜色事件 黄色
128
+        ///     画笔颜色事件 黄色
133 129
         /// </summary>
134 130
         public void Yellow()
135 131
         {
@@ -139,7 +135,7 @@ namespace XHWK.WKTool
139 135
         }
140 136
 
141 137
         /// <summary>
142
-        /// 画笔颜色事件 蓝色
138
+        ///     画笔颜色事件 蓝色
143 139
         /// </summary>
144 140
         public void Blue()
145 141
         {
@@ -149,7 +145,7 @@ namespace XHWK.WKTool
149 145
         }
150 146
 
151 147
         /// <summary>
152
-        /// 画笔粗细事件 细
148
+        ///     画笔粗细事件 细
153 149
         /// </summary>
154 150
         public void Fine()
155 151
         {
@@ -161,7 +157,7 @@ namespace XHWK.WKTool
161 157
         }
162 158
 
163 159
         /// <summary>
164
-        /// 画笔粗细事件 中
160
+        ///     画笔粗细事件 中
165 161
         /// </summary>
166 162
         public void In()
167 163
         {
@@ -173,7 +169,7 @@ namespace XHWK.WKTool
173 169
         }
174 170
 
175 171
         /// <summary>
176
-        /// 画笔粗细事件 粗
172
+        ///     画笔粗细事件 粗
177 173
         /// </summary>
178 174
         public void Crude()
179 175
         {
@@ -185,33 +181,36 @@ namespace XHWK.WKTool
185 181
         }
186 182
 
187 183
         /// <summary>
188
-        /// 橡皮
184
+        ///     橡皮
189 185
         /// </summary>
190 186
         public void Eraser()
191 187
         {
192 188
             _flg = 0;
193 189
             //this.type = ZPenType.Erase;
194
-            blackboard_canvas.UseCustomCursor = false;
195
-            blackboard_canvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
196
-            blackboard_canvas.EraserShape = new EllipseStylusShape(64, 64, 0);
190
+            BlackboardCanvas.UseCustomCursor = false;
191
+            BlackboardCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
192
+            BlackboardCanvas.EraserShape = new EllipseStylusShape(
193
+                64,
194
+                64,
195
+                0
196
+            );
197 197
         }
198 198
 
199 199
         /// <summary>
200
-        /// 画笔
200
+        ///     画笔
201 201
         /// </summary>
202 202
         public void Pen()
203 203
         {
204 204
             _flg = 0;
205
-            blackboard_canvas.EditingMode = InkCanvasEditingMode.Ink;
206
-            blackboard_canvas.UseCustomCursor = true;
205
+            BlackboardCanvas.EditingMode = InkCanvasEditingMode.Ink;
206
+            BlackboardCanvas.UseCustomCursor = true;
207 207
             _drawingAttributes.FitToCurve = true;
208 208
             _drawingAttributes.IgnorePressure = false;
209
-
210
-            blackboard_canvas.Cursor = Cursors.Pen;
209
+            BlackboardCanvas.Cursor = Cursors.Pen;
211 210
         }
212 211
 
213 212
         /// <summary>
214
-        /// 圆
213
+        ///     
215 214
         /// </summary>
216 215
         public void Round()
217 216
         {
@@ -226,13 +225,13 @@ namespace XHWK.WKTool
226 225
                 IsHighlighter = false,
227 226
                 IgnorePressure = true,
228 227
             };
229
-            blackboard_canvas.DefaultDrawingAttributes = _drawingAttributes;
230
-            blackboard_canvas.EditingMode = InkCanvasEditingMode.None;
231
-            blackboard_canvas.Cursor = Cursors.Cross;
228
+            BlackboardCanvas.DefaultDrawingAttributes = _drawingAttributes;
229
+            BlackboardCanvas.EditingMode = InkCanvasEditingMode.None;
230
+            BlackboardCanvas.Cursor = Cursors.Cross;
232 231
         }
233 232
 
234 233
         /// <summary>
235
-        /// 矩形
234
+        ///     矩形
236 235
         /// </summary>
237 236
         public void Rectangle()
238 237
         {
@@ -247,23 +246,25 @@ namespace XHWK.WKTool
247 246
                 IsHighlighter = false,
248 247
                 IgnorePressure = true,
249 248
             };
250
-            blackboard_canvas.DefaultDrawingAttributes = _drawingAttributes;
251
-            blackboard_canvas.EditingMode = InkCanvasEditingMode.None;
252
-            blackboard_canvas.Cursor = Cursors.Cross;
249
+            BlackboardCanvas.DefaultDrawingAttributes = _drawingAttributes;
250
+            BlackboardCanvas.EditingMode = InkCanvasEditingMode.None;
251
+            BlackboardCanvas.Cursor = Cursors.Cross;
253 252
         }
254 253
 
255 254
         /// <summary>
256
-        /// 鼠标中键点击
255
+        ///     鼠标中键点击
257 256
         /// </summary>
258 257
         private void SwitchPages()
259 258
         {
260 259
             try
261 260
             {
262
-                new Thread(() =>
263
-                {
264
-                    Thread.Sleep(500);
265
-                    MouseEventCommon.MouseMiddleClickEvent(0);
266
-                }).Start();
261
+                new Thread(
262
+                    () =>
263
+                    {
264
+                        Thread.Sleep(500);
265
+                        MouseEventCommon.MouseMiddleClickEvent(0);
266
+                    }
267
+                ).Start();
267 268
             }
268 269
             catch (Exception ex)
269 270
             {
@@ -281,7 +282,6 @@ namespace XHWK.WKTool
281 282
             {
282 283
                 App.W_ScreenRecordingToolbarWindow.flg = 1;
283 284
             }
284
-
285 285
             ReturnPractice();
286 286
             //模拟切到ppt
287 287
             SwitchPages();
@@ -289,22 +289,26 @@ namespace XHWK.WKTool
289 289
         }
290 290
 
291 291
         /// <summary>
292
-        /// 退出批注并清空画板
292
+        ///     退出批注并清空画板
293 293
         /// </summary>
294 294
         public void ReturnPractice()
295 295
         {
296
-            blackboard_canvas.Strokes.Clear();
297
-            new Thread(() =>
298
-            {
299
-                Dispatcher.Invoke(() => { App.W_ScreenRecordingToolbarWindow.ModifyState(); });
300
-                _flg = 0;
301
-                Thread.Sleep(500);
302
-                Dispatcher.Invoke(() =>
296
+            BlackboardCanvas.Strokes.Clear();
297
+            new Thread(
298
+                () =>
303 299
                 {
304
-                    Owner = null;
305
-                    App.W_PracticeWindow.Hide();
306
-                });
307
-            }).Start();
300
+                    Dispatcher.Invoke(() => { App.W_ScreenRecordingToolbarWindow.ModifyState(); });
301
+                    _flg = 0;
302
+                    Thread.Sleep(500);
303
+                    Dispatcher.Invoke(
304
+                        () =>
305
+                        {
306
+                            Owner = null;
307
+                            App.W_PracticeWindow.Hide();
308
+                        }
309
+                    );
310
+                }
311
+            ).Start();
308 312
         }
309 313
 
310 314
         #region 点阵笔相关
@@ -326,9 +330,9 @@ namespace XHWK.WKTool
326 330
         private Stroke _strokes;
327 331
 
328 332
         /// <summary>
329
-        /// 引用user32.dll动态链接库(windows api),
330
-        /// 使用库中定义 API:SetCursorPos
331
-        /// 设置光标位置
333
+        ///     引用user32.dll动态链接库(windows api),
334
+        ///     使用库中定义 API:SetCursorPos
335
+        ///     设置光标位置
332 336
         /// </summary>
333 337
         [System.Runtime.InteropServices.DllImport("user32.dll")]
334 338
         private static extern int SetCursorPos(int x, int y);
@@ -338,21 +342,21 @@ namespace XHWK.WKTool
338 342
         #region 腾千里手写笔
339 343
 
340 344
         /// <summary>
341
-        /// 是否在书写
345
+        ///     是否在书写
342 346
         /// </summary>
343 347
         private bool _isTqlPenDown;
344 348
 
345 349
         /// <summary>
346
-        /// TQL点阵笔宽高
350
+        ///     TQL点阵笔宽高
347 351
         /// </summary>
348
-//static float TQLA4_WIDTH = (float)1075 / (float)150 * (float)25.4 / (float)1.524; //OID4
352
+        //static float TQLA4_WIDTH = (float)1075 / (float)150 * (float)25.4 / (float)1.524; //OID4
349 353
 //static float TQLA4_HEIGHT = (float)1512 / (float)150 * (float)25.4 / (float)1.524;
350
-        private const float Tqla4Width = 2480 / (float)300 * (float)25.4 / (float)1.524;
354
+        private const float TQLA4_WIDTH = 2480 / (float)300 * (float)25.4 / (float)1.524;
351 355
 
352
-        private const float Tqla4Height = 3509 / (float)300 * (float)25.4 / (float)1.524;
356
+        private const float TQLA4_HEIGHT = 3509 / (float)300 * (float)25.4 / (float)1.524;
353 357
 
354 358
         /// <summary>
355
-        /// 初始化
359
+        ///     初始化
356 360
         /// </summary>
357 361
         public void InitTqlpPen()
358 362
         {
@@ -367,7 +371,7 @@ namespace XHWK.WKTool
367 371
         }
368 372
 
369 373
         /// <summary>
370
-        /// 笔落下
374
+        ///     笔落下
371 375
         /// </summary>
372 376
         public void TqlDown()
373 377
         {
@@ -377,112 +381,110 @@ namespace XHWK.WKTool
377 381
             {
378 382
                 _isFirst = true;
379 383
             }
380
-
381 384
             _stylusPoints = new StylusPointCollection();
382 385
             _stylusPoint = new StylusPoint();
383 386
             _strokes = null;
384 387
         }
385 388
 
386 389
         /// <summary>
387
-        /// 笔抬起
390
+        ///     笔抬起
388 391
         /// </summary>
389 392
         public void TqlUp()
390 393
         {
391 394
             _isTqlPenDown = false;
392
-
393 395
             if (_strokes != null && _strokes.StylusPoints.Count > 1)
394 396
             {
395 397
                 _isFirst = true;
396 398
             }
397
-
398 399
             _stylusPoints = new StylusPointCollection();
399 400
             _stylusPoint = new StylusPoint();
400 401
             _strokes = null;
401 402
         }
402 403
 
403 404
         /// <summary>
404
-        /// 笔书写
405
+        ///     笔书写
405 406
         /// </summary>
406 407
         /// <param name="cx"></param>
407 408
         /// <param name="cy"></param>
408 409
         /// <param name="force"></param>
409
-        public void TqlPenWrite(double cx, double cy, int force)
410
+        public void TqlPenWrite
411
+        (
412
+            double cx,
413
+            double cy,
414
+            int force
415
+        )
410 416
         {
411
-            if (this.Visibility == Visibility.Visible)
417
+            if (Visibility == Visibility.Visible)
412 418
             {
413 419
                 //判断是否是落笔后输出的坐标,在设置悬浮模式下,落笔前的悬浮坐标不绘制
414 420
                 if (!_isTqlPenDown)
415 421
                 {
416 422
                     return;
417 423
                 }
418
-
419
-                double propW = blackboard_canvas.ActualWidth / Tqla4Height;
420
-                double propH = blackboard_canvas.ActualHeight / Tqla4Width;
421
-
424
+                double propW = BlackboardCanvas.ActualWidth / TQLA4_HEIGHT;
425
+                double propH = BlackboardCanvas.ActualHeight / TQLA4_WIDTH;
422 426
                 double tempX = cy * propW;
423
-                double tempY = (Tqla4Width - cx) * propH;
424
-                Dispatcher.Invoke(() =>
425
-                {
426
-                    //0~1023,亦即有 1024 阶供应用软件后续应用之用,如笔锋笔触,暂无用
427
-                    //添加笔画
428
-                    if (_isFirst)
427
+                double tempY = (TQLA4_WIDTH - cx) * propH;
428
+                Dispatcher.Invoke(
429
+                    () =>
429 430
                     {
430
-                        _stylusPoint.X = tempX;
431
-                        _stylusPoint.Y = tempY;
432
-                        _stylusPoints.Add(_stylusPoint);
433
-                        if (_stylusPoints.Count > 1)
434
-                        {
435
-                            _drawing = new DrawingAttributes
436
-                            {
437
-                                Color = _colour,
438
-                                Width = _wit * 4.5,
439
-                                Height = _wit * 4.5,
440
-                                FitToCurve = true,
441
-                                IgnorePressure = false
442
-                            };
443
-
444
-                            _strokes = new Stroke(_stylusPoints);
445
-
446
-                            _strokes.DrawingAttributes = _drawing;
447
-
448
-                            blackboard_canvas.Strokes.Add(_strokes);
449
-                            _isFirst = false;
450
-                        }
451
-                    }
452
-                    else
453
-                    {
454
-                        if (blackboard_canvas.Strokes.Count > 0)
431
+                        //0~1023,亦即有 1024 阶供应用软件后续应用之用,如笔锋笔触,暂无用
432
+                        //添加笔画
433
+                        if (_isFirst)
455 434
                         {
456 435
                             _stylusPoint.X = tempX;
457 436
                             _stylusPoint.Y = tempY;
458 437
                             _stylusPoints.Add(_stylusPoint);
459
-                            _strokes = new Stroke(_stylusPoints);
460
-                            _drawing = new DrawingAttributes
438
+                            if (_stylusPoints.Count > 1)
461 439
                             {
462
-                                Color = _colour,
463
-                                Width = _wit * 4.5,
464
-                                Height = _wit * 4.5,
465
-                                FitToCurve = true,
466
-                                IgnorePressure = false
467
-                            };
468
-                            _strokes.DrawingAttributes = _drawing;
469
-
470
-                            //viewModel.InkStrokes.Add(strokes);
471
-                            blackboard_canvas.Strokes[blackboard_canvas.Strokes.Count - 1] = _strokes;
440
+                                _drawing = new DrawingAttributes
441
+                                {
442
+                                    Color = _colour,
443
+                                    Width = _wit * 4.5,
444
+                                    Height = _wit * 4.5,
445
+                                    FitToCurve = true,
446
+                                    IgnorePressure = false
447
+                                };
448
+                                _strokes = new Stroke(_stylusPoints);
449
+                                _strokes.DrawingAttributes = _drawing;
450
+                                BlackboardCanvas.Strokes.Add(_strokes);
451
+                                _isFirst = false;
452
+                            }
453
+                        }
454
+                        else
455
+                        {
456
+                            if (BlackboardCanvas.Strokes.Count > 0)
457
+                            {
458
+                                _stylusPoint.X = tempX;
459
+                                _stylusPoint.Y = tempY;
460
+                                _stylusPoints.Add(_stylusPoint);
461
+                                _strokes = new Stroke(_stylusPoints);
462
+                                _drawing = new DrawingAttributes
463
+                                {
464
+                                    Color = _colour,
465
+                                    Width = _wit * 4.5,
466
+                                    Height = _wit * 4.5,
467
+                                    FitToCurve = true,
468
+                                    IgnorePressure = false
469
+                                };
470
+                                _strokes.DrawingAttributes = _drawing;
471
+
472
+                                //viewModel.InkStrokes.Add(strokes);
473
+                                BlackboardCanvas.Strokes[BlackboardCanvas.Strokes.Count - 1] = _strokes;
474
+                            }
472 475
                         }
473
-                    }
474 476
 
475
-                    //设置鼠标位置
476
-                    if (tempX > 0 && tempY > 0)
477
-                    {
478
-                        //System.Windows.Point getP = scroMain.PointToScreen(new System.Windows.Point(testX, testY - scroMain.VerticalOffset));
479
-                        SetCursorPos((int)((float)tempX * (PrimaryScreen.DpiX / 96f)),
480
-                            (int)((float)tempY * (PrimaryScreen.DpiY / 96f)));
477
+                        //设置鼠标位置
478
+                        if (tempX > 0 && tempY > 0)
479
+                        {
480
+                            //System.Windows.Point getP = scroMain.PointToScreen(new System.Windows.Point(testX, testY - scroMain.VerticalOffset));
481
+                            SetCursorPos((int)((float)tempX * (PrimaryScreen.DpiX / 96f)), (int)((float)tempY * (PrimaryScreen.DpiY / 96f)));
482
+                        }
481 483
                     }
482
-                });
484
+                );
483 485
             }
484 486
         }
485 487
 
486 488
         #endregion 腾千里手写笔
487 489
     }
488
-}
490
+}

+ 9
- 46
XHWK.WKTool/ProductVerification.xaml View File

@@ -2,10 +2,9 @@
2 2
     x:Class="XHWK.WKTool.ProductVerification"
3 3
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4 4
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5
-    xmlns:Views="clr-namespace:XHWK.WKTool.Helpers"
6 5
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7
-    xmlns:local="clr-namespace:XHWK.WKTool"
8 6
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7
+    xmlns:views="clr-namespace:XHWK.WKTool.Helpers"
9 8
     Title="ProductVerification"
10 9
     Width="300"
11 10
     Height="230"
@@ -23,53 +22,18 @@
23 22
             ShadowDepth="0"
24 23
             Color="#bababa" />
25 24
     </Window.Effect>
26
-    <Window.Resources>
27
-        <Style x:Key="oiliu" TargetType="ListBoxItem">
28
-            <!--  设置控件模板  -->
29
-            <Setter Property="Template">
30
-                <Setter.Value>
31
-                    <ControlTemplate TargetType="ListBoxItem">
32
-                        <Border
33
-                            Margin="4,0,0,0"
34
-                            Padding="0"
35
-                            Background="{TemplateBinding Background}">
36
-                            <ContentPresenter
37
-                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
38
-                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
39
-                                TextBlock.Foreground="{TemplateBinding Foreground}" />
40
-                        </Border>
41
-                    </ControlTemplate>
42
-                </Setter.Value>
43
-            </Setter>
44
-        </Style>
45
-        <DataTemplate x:Key="UserTpl">
46
-            <StackPanel
47
-                Width="70.5"
48
-                Height="auto"
49
-                Background="Transparent">
50
-                <TextBlock
51
-                    Padding="0,12,0,0"
52
-                    HorizontalAlignment="Left"
53
-                    FontSize="20"
54
-                    Foreground="#3C525B"
55
-                    Text="{Binding username}" />
56
-            </StackPanel>
57
-        </DataTemplate>
58
-    </Window.Resources>
59
-    <Views:ZJClippingBorder Background="White" CornerRadius="10,10,10,10">
25
+    <Window.Resources />
26
+    <views:ZJClippingBorder Background="White" CornerRadius="10,10,10,10">
60 27
         <Grid Margin="0,0,0,0">
61 28
             <Grid.RowDefinitions>
62
-                <RowDefinition Height="50" />
29
+                <RowDefinition Height="40" />
63 30
                 <RowDefinition Height="*" />
64 31
                 <RowDefinition Height="75" />
65 32
             </Grid.RowDefinitions>
66 33
             <!--  头部  -->
67
-            <Grid
68
-                Grid.Row="0"
69
-                Height="50"
70
-                Background="#4597FF">
34
+            <Grid Grid.Row="0" Background="#4597FF">
71 35
                 <TextBlock
72
-                    x:Name="title_tb"
36
+                    x:Name="TitleTb"
73 37
                     Grid.Row="0"
74 38
                     Margin="15,0,0,0"
75 39
                     HorizontalAlignment="Left"
@@ -86,8 +50,7 @@
86 50
                     VerticalAlignment="Center"
87 51
                     Background="White"
88 52
                     Click="CloseClick"
89
-                    Cursor="Hand"
90
-                    >
53
+                    Cursor="Hand">
91 54
                     <Button.Template>
92 55
                         <ControlTemplate TargetType="{x:Type Button}">
93 56
                             <Border
@@ -116,5 +79,5 @@
116 79
                 </StackPanel>
117 80
             </Grid>
118 81
         </Grid>
119
-    </Views:ZJClippingBorder>
120
-</Window>
82
+    </views:ZJClippingBorder>
83
+</Window>

+ 57
- 55
XHWK.WKTool/ProductVerification.xaml.cs View File

@@ -7,21 +7,18 @@ using System.Windows;
7 7
 
8 8
 using XHWK.Model;
9 9
 using XHWK.WKTool.DAL;
10
-using XHWK.WKTool.Skin;
11 10
 
12 11
 namespace XHWK.WKTool
13 12
 {
14 13
     /// <summary>
15
-    /// ProductVerification.xaml 的交互逻辑
14
+    ///     ProductVerification.xaml 的交互逻辑
15
+    ///     本地解密  解密成功 日期在有效期内 ,判断当天是否调用添加历史接口,没有则调用
16
+    ///     解密失败 或解密获取的时间 过期 , 跳到输入code 激活界面
16 17
     /// </summary>
17
-    /*
18
-     本地解密  解密成功 日期在有效期内 ,判断当天是否调用添加历史接口,没有则调用
19
-     解密失败 或解密获取的时间 过期 , 跳到输入code 激活界面
20
-         */
21
-    public partial class ProductVerification : Window
18
+    public partial class ProductVerification
22 19
     {
23
-        private readonly XhApi registerController = new XhApi();
24
-        private int serverReturnCode = 0;
20
+        private readonly XhApi _registerController = new XhApi();
21
+        private int _serverReturnCode;
25 22
 
26 23
         public ProductVerification()
27 24
         {
@@ -30,8 +27,9 @@ namespace XHWK.WKTool
30 27
             Topmost = true;
31 28
             App.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationDecryptServering, InvokeActivationDecryptServerCompate);
32 29
         }
30
+
33 31
         /// <summary>
34
-        /// 激活信息--验证签名是否过期-调用
32
+        ///     激活信息--验证签名是否过期-调用
35 33
         /// </summary>
36 34
         /// <returns></returns>
37 35
         private object InvokeActivationDecryptServering()
@@ -40,7 +38,7 @@ namespace XHWK.WKTool
40 38
         }
41 39
 
42 40
         /// <summary>
43
-        /// 激活信息--验证签名是否过期-返回结果
41
+        ///     激活信息--验证签名是否过期-返回结果
44 42
         /// </summary>
45 43
         /// <returns></returns>
46 44
         public void InvokeActivationDecryptServerCompate(object obj)
@@ -53,67 +51,67 @@ namespace XHWK.WKTool
53 51
                 decrypt = decrypt.Replace("\u0001", "").Replace("\u0007", "").Trim();
54 52
                 ModelSignatures msgBean = JsonHelper.JsonToObj<ModelSignatures>(decrypt);
55 53
                 long currentTimeTimestamp = DataProvider.TimestampTotalSeconds(); //当前时间 时间戳
56
-                if (msgBean.endtime > currentTimeTimestamp)//条件成立  解析成功 code 在有效期内
54
+                if (msgBean.endtime > currentTimeTimestamp) //条件成立  解析成功 code 在有效期内
57 55
                 {
58 56
                     if (File.Exists(App.DataPath + "signatureTime.txt"))
59 57
                     {
60 58
                         string signatureTime = System.IO.File.ReadAllText(App.DataPath + "signatureTime.txt", Encoding.Default);
61
-                        string currentTime = DateTime.Now.ToLongDateString().ToString(); //当前时间  
59
+                        string currentTime = DateTime.Now.ToLongDateString(); //当前时间  
62 60
                         if (signatureTime != currentTime)
63 61
                         {
64 62
                             App.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationAddHistoryServering, InvokeActivationAddHistoryServerCompate);
65 63
                         }
66 64
                     }
67
-                    Dispatcher.Invoke(new Action(() =>
68
-                    {
69
-                        Hide();
70
-                        CreateAMicroLessonWindow win = new CreateAMicroLessonWindow();
71
-                        win.Show();
72
-                        Close();
73
-                    }));
65
+                    Dispatcher.Invoke(
66
+                        () =>
67
+                        {
68
+                            Hide();
69
+                            CreateWin win = new CreateWin();
70
+                            win.Show();
71
+                            Close();
72
+                        }
73
+                    );
74 74
                 }
75
-                else//时间失效
75
+                else //时间失效
76 76
                 {
77
-                    Dispatcher.Invoke(new Action(() =>
78
-                    {
79
-                        Hide();
80
-                        KeyVerification wins = new KeyVerification
77
+                    Dispatcher.Invoke(
78
+                        () =>
81 79
                         {
82
-                            Topmost = true
83
-                        };
84
-                        wins.ShowDialog();
85
-                        Close();
86
-                    }));
80
+                            Hide();
81
+                            KeyVerification wins = new KeyVerification { Topmost = true };
82
+                            wins.ShowDialog();
83
+                            Close();
84
+                        }
85
+                    );
87 86
                 }
88 87
             }
89 88
             catch (Exception ex) //解析失败 输code  
90 89
             {
91 90
                 LogHelper.Logerror.Error("ProductVerification(解析失败)" + ex.Message, ex);
92
-                Dispatcher.Invoke(new Action(() =>
93
-                {
94
-                    Hide();
95
-                    KeyVerification wins = new KeyVerification
91
+                Dispatcher.Invoke(
92
+                    () =>
96 93
                     {
97
-                        Topmost = true
98
-                    };
99
-                    wins.ShowDialog();
100
-                    Close();
101
-                }));
94
+                        Hide();
95
+                        KeyVerification wins = new KeyVerification { Topmost = true };
96
+                        wins.ShowDialog();
97
+                        Close();
98
+                    }
99
+                );
102 100
             }
103
-
104 101
         }
102
+
105 103
         /// <summary>
106
-        /// 激活信息--添加激活历史-调用
104
+        ///     激活信息--添加激活历史-调用
107 105
         /// </summary>
108 106
         /// <returns></returns>
109 107
         private object InvokeActivationAddHistoryServering()
110 108
         {
111
-            serverReturnCode = registerController.ActivationAddHistory();
109
+            _serverReturnCode = _registerController.ActivationAddHistory();
112 110
             return App.ServerMsg;
113 111
         }
114 112
 
115 113
         /// <summary>
116
-        /// 激活信息--添加激活历史-返回结果
114
+        ///     激活信息--添加激活历史-返回结果
117 115
         /// </summary>
118 116
         /// <returns></returns>
119 117
         public void InvokeActivationAddHistoryServerCompate(object obj)
@@ -122,13 +120,17 @@ namespace XHWK.WKTool
122 120
             {
123 121
                 Directory.CreateDirectory(App.DataPath);
124 122
             }
125
-            string ApplicationData = App.DataPath + "signatureTime.txt";
126
-            string currentTime = DateTime.Now.ToLongDateString().ToString();//当前时间
127
-            System.IO.File.WriteAllText(ApplicationData, currentTime, Encoding.Default);//存放签名验证日期
123
+            string applicationData = App.DataPath + "signatureTime.txt";
124
+            string currentTime = DateTime.Now.ToLongDateString(); //当前时间
125
+            System.IO.File.WriteAllText(
126
+                applicationData,
127
+                currentTime,
128
+                Encoding.Default
129
+            ); //存放签名验证日期
128 130
         }
129 131
 
130 132
         /// <summary>
131
-        /// 关闭弹窗
133
+        ///     关闭弹窗
132 134
         /// </summary>
133 135
         /// <param name="sender"></param>
134 136
         /// <param name="e"></param>
@@ -138,12 +140,11 @@ namespace XHWK.WKTool
138 140
         }
139 141
 
140 142
         /// <summary>
141
-        /// 退出程序
143
+        ///     退出程序
142 144
         /// </summary>
143 145
         private void CloseAction()
144 146
         {
145
-            Dispatcher.Invoke
146
-            (
147
+            Dispatcher.Invoke(
147 148
                 () =>
148 149
                 {
149 150
                     Application.Current.Shutdown();
@@ -156,6 +157,7 @@ namespace XHWK.WKTool
156 157
             //Console.WriteLine("{0}被销毁", this);
157 158
             Dispose(false);
158 159
         }
160
+
159 161
         public void Dispose()
160 162
         {
161 163
             //Console.WriteLine("{0}被手动销毁", this);
@@ -163,21 +165,21 @@ namespace XHWK.WKTool
163 165
             GC.SuppressFinalize(this);
164 166
         }
165 167
 
166
-        private bool disposed;
168
+        private bool _disposed;
169
+
167 170
         protected void Dispose(bool disposing)
168 171
         {
169 172
             //Console.WriteLine("{0}被自动销毁", this);
170
-            if (!disposed)
173
+            if (!_disposed)
171 174
             {
172 175
                 if (disposing)
173 176
                 {
174 177
                     //托管资源释放
175
-
176 178
                 }
177 179
                 //非托管资源释放
178 180
                 // ...
179 181
             }
180
-            disposed = true;
182
+            _disposed = true;
181 183
         }
182 184
     }
183
-}
185
+}

+ 3
- 3
XHWK.WKTool/PromptWindow.xaml View File

@@ -42,7 +42,7 @@
42 42
                 Foreground="#919191"
43 43
                 Text="删除" />
44 44
             <TextBlock
45
-                x:Name="txbName"
45
+                x:Name="TxbName"
46 46
                 FontSize="18"
47 47
                 Foreground="#919191"
48 48
                 Text="微课01" />
@@ -54,11 +54,11 @@
54 54
             HorizontalAlignment="Right"
55 55
             Orientation="Horizontal">
56 56
             <Border
57
-                x:Name="borCancel"
57
+                x:Name="BorCancel"
58 58
                 Background="#E5E5E5"
59 59
                 CornerRadius="6">
60 60
                 <Button
61
-                    x:Name="btnCancel"
61
+                    x:Name="BtnCancel"
62 62
                     Width="104"
63 63
                     Height="42"
64 64
                     Background="Transparent"

+ 12
- 16
XHWK.WKTool/PromptWindow.xaml.cs View File

@@ -4,33 +4,29 @@ using System.Windows.Media;
4 4
 namespace XHWK.WKTool
5 5
 {
6 6
     /// <summary>
7
-    /// PromptWindow.xaml 的交互逻辑
7
+    ///     PromptWindow.xaml 的交互逻辑
8 8
     /// </summary>
9
-    public partial class PromptWindow : Window
9
+    public partial class PromptWindow
10 10
     {
11 11
         public PromptWindow()
12 12
         {
13 13
             InitializeComponent();
14 14
         }
15
-        public void Initialize(string _name)
15
+
16
+        public void Initialize(string name)
16 17
         {
17
-            txbName.Text = _name;
18
+            TxbName.Text = name;
18 19
         }
20
+
19 21
         private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
20 22
         {
21 23
             System.Windows.Rect r = new System.Windows.Rect(e.NewSize);
22
-            RectangleGeometry gm = new RectangleGeometry(r, 1, 1);
24
+            RectangleGeometry gm = new RectangleGeometry(
25
+                r,
26
+                1,
27
+                1
28
+            );
23 29
             ((UIElement)sender).Clip = gm;
24 30
         }
25
-
26
-        private void Window_SizeChanged_1(object sender, SizeChangedEventArgs e)
27
-        {
28
-
29
-        }
30
-
31
-        private void Window_SizeChanged1(object sender, SizeChangedEventArgs e)
32
-        {
33
-
34
-        }
35 31
     }
36
-}
32
+}

+ 2
- 3
XHWK.WKTool/ResourceDictionary.xaml View File

@@ -1,6 +1,5 @@
1
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2
-                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
1
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3 2
     <FontFamily x:Key="QuartzRegular">../Resources/#QuartzRegular</FontFamily>
4 3
 
5 4
 
6
-</ResourceDictionary>
5
+</ResourceDictionary>

+ 3
- 4
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml View File

@@ -146,7 +146,6 @@
146 146
                     Grid.Column="3">
147 147
                     <Label
148 148
                         x:Name="TxbTime"
149
-                        Grid.Column="1"
150 149
                         Padding="0"
151 150
                         HorizontalContentAlignment="Center"
152 151
                         VerticalContentAlignment="Center"
@@ -192,7 +191,7 @@
192 191
                     </Button>
193 192
                     <!--  选中  -->
194 193
                     <Button
195
-                        x:Name="BtnPenBlue_CL"
194
+                        x:Name="BtnPenBlueCl"
196 195
                         Click="BtnBrush_Click"
197 196
                         Cursor="Hand"
198 197
                         ToolTip="蓝笔"
@@ -227,7 +226,7 @@
227 226
                     </Button>
228 227
                     <!--  选中  -->
229 228
                     <Button
230
-                        x:Name="BtnPenRed_CL"
229
+                        x:Name="BtnPenRedCl"
231 230
                         Click="BtnBlackPenTwo_Click"
232 231
                         Cursor="Hand"
233 232
                         ToolTip="批注"
@@ -277,4 +276,4 @@
277 276
             </Grid>
278 277
         </Grid>
279 278
     </Grid>
280
-</Window>
279
+</Window>

+ 69
- 91
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs View File

@@ -1,5 +1,7 @@
1 1
 using Common.system;
2
+
2 3
 using NReco.VideoConverter;
4
+
3 5
 using System;
4 6
 using System.Drawing;
5 7
 using System.IO;
@@ -9,6 +11,7 @@ using System.Windows;
9 11
 using System.Windows.Forms;
10 12
 using System.Windows.Interop;
11 13
 using System.Windows.Threading;
14
+
12 15
 using XHWK.Model;
13 16
 using XHWK.WKTool.Utils;
14 17
 
@@ -17,36 +20,36 @@ namespace XHWK.WKTool
17 20
     using system;
18 21
 
19 22
     /// <summary>
20
-    /// 录屏工具栏
23
+    ///     录屏工具栏
21 24
     /// </summary>
22 25
     public partial class ScreenRecordingToolbarWindow
23 26
     {
24 27
         #region 初始变量
25 28
 
26 29
         /// <summary>
27
-        /// 视频保存名称
30
+        ///     视频保存名称
28 31
         /// </summary>
29 32
         private string _videoSavePathName;
30 33
 
31 34
         /// <summary>
32
-        /// 临时视频路径
35
+        ///     临时视频路径
33 36
         /// </summary>
34 37
         private string _tempVideoPathName;
35 38
 
36 39
         /// <summary>
37
-        /// 临时麦克风路径
40
+        ///     临时麦克风路径
38 41
         /// </summary>
39 42
         private string _tempAudioPathName1;
40 43
 
41 44
         /// <summary>
42
-        /// 临时扬声器路径
45
+        ///     临时扬声器路径
43 46
         /// </summary>
44 47
         private string _tempAudioPathName2;
45 48
 
46 49
         private readonly string _temppath = App.WKData.WkPath + "_temppath/";
47 50
 
48 51
         /// <summary>
49
-        /// 视频信息
52
+        ///     视频信息
50 53
         /// </summary>
51 54
         private ModelVideo _videoInfo;
52 55
 
@@ -55,7 +58,7 @@ namespace XHWK.WKTool
55 58
         private DispatcherTimer _t;
56 59
 
57 60
         /// <summary>
58
-        /// 计时器状态
61
+        ///     计时器状态
59 62
         /// </summary>
60 63
         private enum State
61 64
         {
@@ -66,14 +69,14 @@ namespace XHWK.WKTool
66 69
         }
67 70
 
68 71
         /// <summary>
69
-        /// 状态
72
+        ///     状态
70 73
         /// </summary>
71 74
         private State _state = State.End;
72 75
 
73 76
         private KeyboardHookCommon _kHook;
74 77
 
75 78
         /// <summary>
76
-        /// 🖊状态 0红色 1蓝色 10红色批注内 11蓝色批注内
79
+        ///     🖊状态 0红色 1蓝色 10红色批注内 11蓝色批注内
77 80
         /// </summary>
78 81
         public int flg;
79 82
 
@@ -82,7 +85,7 @@ namespace XHWK.WKTool
82 85
         #region 初始化
83 86
 
84 87
         /// <summary>
85
-        /// 录屏工具栏
88
+        ///     录屏工具栏
86 89
         /// </summary>
87 90
         public ScreenRecordingToolbarWindow()
88 91
         {
@@ -91,7 +94,7 @@ namespace XHWK.WKTool
91 94
         }
92 95
 
93 96
         /// <summary>
94
-        /// 初始化
97
+        ///     初始化
95 98
         /// </summary>
96 99
         public void Initialize()
97 100
         {
@@ -110,8 +113,7 @@ namespace XHWK.WKTool
110 113
             }
111 114
             App.W_PracticeWindow.InitTqlpPen();
112 115
             App.W_PracticeWindow.Show();
113
-            new Thread
114
-            (
116
+            new Thread(
115 117
                 () =>
116 118
                 {
117 119
                     Thread.Sleep(100);
@@ -133,8 +135,8 @@ namespace XHWK.WKTool
133 135
             BtnPenRed.IsEnabled = false; //红笔不可点击
134 136
             BtnPenBlue.Visibility = Visibility.Visible;
135 137
             BtnPenRed.Visibility = Visibility.Visible;
136
-            BtnPenBlue_CL.Visibility = Visibility.Collapsed;
137
-            BtnPenRed_CL.Visibility = Visibility.Collapsed;
138
+            BtnPenBlueCl.Visibility = Visibility.Collapsed;
139
+            BtnPenRedCl.Visibility = Visibility.Collapsed;
138 140
             TxbTime.Content = "00:00:00";
139 141
         }
140 142
 
@@ -159,7 +161,7 @@ namespace XHWK.WKTool
159 161
         private DateTime _srTime = Convert.ToDateTime("2020-01-01 00:00:00");
160 162
 
161 163
         /// <summary>
162
-        /// 时钟回调
164
+        ///     时钟回调
163 165
         /// </summary>
164 166
         /// <param name="sender"></param>
165 167
         /// <param name="e"></param>
@@ -173,7 +175,7 @@ namespace XHWK.WKTool
173 175
         }
174 176
 
175 177
         /// <summary>
176
-        /// 结束
178
+        ///     结束
177 179
         /// </summary>
178 180
         private void End()
179 181
         {
@@ -183,7 +185,7 @@ namespace XHWK.WKTool
183 185
         #region 录屏
184 186
 
185 187
         /// <summary>
186
-        /// 设置录屏文件地址
188
+        ///     设置录屏文件地址
187 189
         /// </summary>
188 190
         private void SetSavePath()
189 191
         {
@@ -204,7 +206,7 @@ namespace XHWK.WKTool
204 206
         }
205 207
 
206 208
         /// <summary>
207
-        /// 是否已经按下按钮
209
+        ///     是否已经按下按钮
208 210
         /// </summary>
209 211
         private bool _isPressButton;
210 212
 
@@ -220,7 +222,7 @@ namespace XHWK.WKTool
220 222
         public IntPtr winHandle; // 当前窗体指针
221 223
 
222 224
         /// <summary>
223
-        /// 开始或暂停录制
225
+        ///     开始或暂停录制
224 226
         /// </summary>
225 227
         /// <param name="sender"></param>
226 228
         /// <param name="e"></param>
@@ -233,8 +235,7 @@ namespace XHWK.WKTool
233 235
                 return;
234 236
             }
235 237
             _isPressButton = true;
236
-            new Thread
237
-            (
238
+            new Thread(
238 239
                 () =>
239 240
                 {
240 241
                     Thread.Sleep(500);
@@ -252,8 +253,7 @@ namespace XHWK.WKTool
252 253
                 {
253 254
                     _t = new DispatcherTimer();
254 255
                     _t.Tick += OnTimer;
255
-                    _t.Interval = new TimeSpan
256
-                    (
256
+                    _t.Interval = new TimeSpan(
257 257
                         0,
258 258
                         0,
259 259
                         0,
@@ -265,8 +265,7 @@ namespace XHWK.WKTool
265 265
                 }
266 266
                 else
267 267
                 {
268
-                    _t.Interval = new TimeSpan
269
-                    (
268
+                    _t.Interval = new TimeSpan(
270 269
                         0,
271 270
                         0,
272 271
                         0,
@@ -289,8 +288,8 @@ namespace XHWK.WKTool
289 288
                 BtnPenRed.IsEnabled = true; //红笔可点击
290 289
                 BtnPenBlue.Visibility = Visibility.Visible;
291 290
                 BtnPenRed.Visibility = Visibility.Visible;
292
-                BtnPenBlue_CL.Visibility = Visibility.Collapsed;
293
-                BtnPenRed_CL.Visibility = Visibility.Collapsed;
291
+                BtnPenBlueCl.Visibility = Visibility.Collapsed;
292
+                BtnPenRedCl.Visibility = Visibility.Collapsed;
294 293
                 TxbTime.Visibility = Visibility.Visible; //时间显示
295 294
 
296 295
                 #region 隐藏工具栏
@@ -314,11 +313,10 @@ namespace XHWK.WKTool
314 313
                 {
315 314
                     // 视频
316 315
                     winHandle = new WindowInteropHelper(this).Handle;
317
-                    var curScreen = Screen.FromHandle(winHandle);
316
+                    Screen curScreen = Screen.FromHandle(winHandle);
318 317
                     int recordWidth = curScreen.Bounds.Width;
319 318
                     int recordHeight = curScreen.Bounds.Height;
320
-                    _helper0 = new ZVideoRecordHelper
321
-                    (
319
+                    _helper0 = new ZVideoRecordHelper(
322 320
                         _tempVideoPathName,
323 321
                         recordWidth,
324 322
                         recordHeight
@@ -403,7 +401,7 @@ namespace XHWK.WKTool
403 401
         }
404 402
 
405 403
         /// <summary>
406
-        /// 停止录像
404
+        ///     停止录像
407 405
         /// </summary>
408 406
         /// <param name="sender"></param>
409 407
         /// <param name="e"></param>
@@ -418,8 +416,7 @@ namespace XHWK.WKTool
418 416
             else
419 417
             {
420 418
                 _isPressButton = true;
421
-                new Thread
422
-                (
419
+                new Thread(
423 420
                     () =>
424 421
                     {
425 422
                         Thread.Sleep(500);
@@ -457,8 +454,7 @@ namespace XHWK.WKTool
457 454
                 _helper0.StopRecordVideo();
458 455
                 _helper1.StopRecordAudio();
459 456
                 _helper2.StopRecordAudio();
460
-                new Thread
461
-                (
457
+                new Thread(
462 458
                     () =>
463 459
                     {
464 460
                         FFMpegConverter ffMpeg = new FFMpegConverter();
@@ -471,8 +467,7 @@ namespace XHWK.WKTool
471 467
                         try
472 468
                         {
473 469
                             // 多路音频混音
474
-                            ffMpeg.ConvertMedia
475
-                            (
470
+                            ffMpeg.ConvertMedia(
476 471
                                 input,
477 472
                                 _videoSavePathName,
478 473
                                 "mp4",
@@ -529,7 +524,7 @@ namespace XHWK.WKTool
529 524
         #region 画笔相关
530 525
 
531 526
         /// <summary>
532
-        /// 笔调用批注
527
+        ///     笔调用批注
533 528
         /// </summary>
534 529
         public void PenPractice()
535 530
         {
@@ -544,8 +539,7 @@ namespace XHWK.WKTool
544 539
                 else
545 540
                 {
546 541
                     _isPressButton = true;
547
-                    new Thread
548
-                    (
542
+                    new Thread(
549 543
                         () =>
550 544
                         {
551 545
                             Thread.Sleep(500);
@@ -559,8 +553,7 @@ namespace XHWK.WKTool
559 553
                 GetTimeStamp();
560 554
                 try
561 555
                 {
562
-                    Dispatcher.Invoke
563
-                    (
556
+                    Dispatcher.Invoke(
564 557
                         () =>
565 558
                         {
566 559
                             if (App.W_PracticeWindow == null)
@@ -581,8 +574,7 @@ namespace XHWK.WKTool
581 574
                             App.W_PracticeWindow.Focus();
582 575
                         }
583 576
                     );
584
-                    new Thread
585
-                    (
577
+                    new Thread(
586 578
                         () =>
587 579
                         {
588 580
                             Dispatcher.Invoke(() => { App.W_PracticeWindow.Topmost = false; });
@@ -599,7 +591,7 @@ namespace XHWK.WKTool
599 591
         }
600 592
 
601 593
         /// <summary>
602
-        /// 画笔点击事件
594
+        ///     画笔点击事件
603 595
         /// </summary>
604 596
         /// <param name="sender"></param>
605 597
         /// <param name="e"></param>
@@ -619,8 +611,7 @@ namespace XHWK.WKTool
619 611
             else
620 612
             {
621 613
                 _isPressButton = true;
622
-                new Thread
623
-                (
614
+                new Thread(
624 615
                     () =>
625 616
                     {
626 617
                         Thread.Sleep(500);
@@ -633,8 +624,8 @@ namespace XHWK.WKTool
633 624
 
634 625
             BtnPenBlue.Visibility = Visibility.Collapsed;
635 626
             BtnPenRed.Visibility = Visibility.Visible;
636
-            BtnPenBlue_CL.Visibility = Visibility.Visible;
637
-            BtnPenRed_CL.Visibility = Visibility.Collapsed;
627
+            BtnPenBlueCl.Visibility = Visibility.Visible;
628
+            BtnPenRedCl.Visibility = Visibility.Collapsed;
638 629
             GetTimeStamp();
639 630
             try
640 631
             {
@@ -687,13 +678,11 @@ namespace XHWK.WKTool
687 678
                     flg = 11;
688 679
                     App.W_PracticeWindow.Blue();
689 680
                     App.W_PracticeWindow.Show();
690
-                    new Thread
691
-                    (
681
+                    new Thread(
692 682
                         () =>
693 683
                         {
694 684
                             Thread.Sleep(100);
695
-                            Dispatcher.Invoke
696
-                            (
685
+                            Dispatcher.Invoke(
697 686
                                 () =>
698 687
                                 {
699 688
                                     //Owner = APP.W_PracticeWindow;
@@ -713,24 +702,23 @@ namespace XHWK.WKTool
713 702
         }
714 703
 
715 704
         /// <summary>
716
-        /// 屏幕宽
705
+        ///     屏幕宽
717 706
         /// </summary>
718 707
         internal double pwidth = SystemParameters.PrimaryScreenWidth;
719 708
 
720 709
         /// <summary>
721
-        /// 屏幕高
710
+        ///     屏幕高
722 711
         /// </summary>
723 712
         internal double pHeight = SystemParameters.PrimaryScreenHeight;
724 713
 
725 714
         /// <summary>
726
-        /// 获取时间戳
715
+        ///     获取时间戳
727 716
         /// </summary>
728 717
         /// <returns></returns>
729 718
         public string GetTimeStamp()
730 719
         {
731
-            TimeSpan ts = DateTime.Now
732
-            - new DateTime
733
-            (
720
+            TimeSpan ts = DateTime.Now -
721
+            new DateTime(
734 722
                 1970,
735 723
                 1,
736 724
                 1,
@@ -747,17 +735,17 @@ namespace XHWK.WKTool
747 735
         #endregion 事件
748 736
 
749 737
         /// <summary>
750
-        /// 停止录屏
738
+        ///     停止录屏
751 739
         /// </summary>
752 740
         public delegate void StopRecordingScreen();
753 741
 
754 742
         /// <summary>
755
-        /// 停止录屏
743
+        ///     停止录屏
756 744
         /// </summary>
757 745
         public event StopRecordingScreen ClickStopRecordingScreen;
758 746
 
759 747
         /// <summary>
760
-        /// 红笔
748
+        ///     红笔
761 749
         /// </summary>
762 750
         /// <param name="sender"></param>
763 751
         /// <param name="e"></param>
@@ -777,8 +765,7 @@ namespace XHWK.WKTool
777 765
             else
778 766
             {
779 767
                 _isPressButton = true;
780
-                new Thread
781
-                (
768
+                new Thread(
782 769
                     () =>
783 770
                     {
784 771
                         Thread.Sleep(500);
@@ -791,17 +778,15 @@ namespace XHWK.WKTool
791 778
 
792 779
             BtnPenBlue.Visibility = Visibility.Visible;
793 780
             BtnPenRed.Visibility = Visibility.Collapsed;
794
-            BtnPenBlue_CL.Visibility = Visibility.Collapsed;
795
-            BtnPenRed_CL.Visibility = Visibility.Visible;
781
+            BtnPenBlueCl.Visibility = Visibility.Collapsed;
782
+            BtnPenRedCl.Visibility = Visibility.Visible;
796 783
             string time = GetTimeStamp();
797 784
 
798 785
             #region 录屏批注取消画笔
799 786
 
800 787
             string imagePath = Path.Combine(_temppath, time + ".jpg");
801
-            ImageHelper.GetScreenshot
802
-            (
803
-                new Rectangle
804
-                (
788
+            ImageHelper.GetScreenshot(
789
+                new Rectangle(
805 790
                     0,
806 791
                     0,
807 792
                     0,
@@ -841,13 +826,11 @@ namespace XHWK.WKTool
841 826
                     flg = 10;
842 827
                     App.W_PracticeWindow.Red();
843 828
                     App.W_PracticeWindow.Show();
844
-                    new Thread
845
-                    (
829
+                    new Thread(
846 830
                         () =>
847 831
                         {
848 832
                             Thread.Sleep(100);
849
-                            Dispatcher.Invoke
850
-                            (
833
+                            Dispatcher.Invoke(
851 834
                                 () =>
852 835
                                 {
853 836
                                     //Owner = APP.W_PracticeWindow;
@@ -865,7 +848,7 @@ namespace XHWK.WKTool
865 848
         }
866 849
 
867 850
         /// <summary>
868
-        /// 返回主界面
851
+        ///     返回主界面
869 852
         /// </summary>
870 853
         /// <param name="sender"></param>
871 854
         /// <param name="e"></param>
@@ -873,8 +856,7 @@ namespace XHWK.WKTool
873 856
         {
874 857
             if (_state == State.Pause || _state == State.Start)
875 858
             {
876
-                MessageBoxResult br = MessageWindow.Show
877
-                (
859
+                MessageBoxResult br = MessageWindow.Show(
878 860
                     "退出将结束并保存录制,是否继续?",
879 861
                     "提示",
880 862
                     MessageBoxButton.OKCancel
@@ -889,13 +871,11 @@ namespace XHWK.WKTool
889 871
             //APP.W_XHMicroLessonSystemWindow.InitPen();
890 872
             App.W_XHMicroLessonSystemWindow.InitTqlpPen();
891 873
             App.W_XHMicroLessonSystemWindow.Show();
892
-            new Thread
893
-            (
874
+            new Thread(
894 875
                 () =>
895 876
                 {
896 877
                     Thread.Sleep(700);
897
-                    Dispatcher.Invoke
898
-                    (
878
+                    Dispatcher.Invoke(
899 879
                         () =>
900 880
                         {
901 881
                             if (App.W_MinToolbar != null)
@@ -910,14 +890,14 @@ namespace XHWK.WKTool
910 890
         }
911 891
 
912 892
         /// <summary>
913
-        /// 修改笔状态
893
+        ///     修改笔状态
914 894
         /// </summary>
915 895
         public void ModifyState()
916 896
         {
917 897
             BtnPenBlue.Visibility = Visibility.Visible;
918 898
             BtnPenRed.Visibility = Visibility.Visible;
919
-            BtnPenBlue_CL.Visibility = Visibility.Collapsed;
920
-            BtnPenRed_CL.Visibility = Visibility.Collapsed;
899
+            BtnPenBlueCl.Visibility = Visibility.Collapsed;
900
+            BtnPenRedCl.Visibility = Visibility.Collapsed;
921 901
         }
922 902
 
923 903
         private void gridToobarTwo_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
@@ -933,17 +913,15 @@ namespace XHWK.WKTool
933 913
                     }
934 914
                     App.W_MinToolbar.Topmost = true;
935 915
                     double minToolTop = Top;
936
-                    new Thread
937
-                    (
916
+                    new Thread(
938 917
                         () =>
939 918
                         {
940 919
                             Thread.Sleep(500);
941
-                            Dispatcher.Invoke
942
-                            (
920
+                            Dispatcher.Invoke(
943 921
                                 () =>
944 922
                                 {
945 923
                                     MouseEventCommon.GetCursorPos(out MouseEventCommon.Point pointRecord);
946
-                                    if (pointRecord.X >= this.Left && pointRecord.X < this.Left + this.ActualWidth && pointRecord.Y >= this.Top && pointRecord.Y < this.Top + this.ActualHeight)
924
+                                    if (pointRecord.X >= Left && pointRecord.X < Left + ActualWidth && pointRecord.Y >= Top && pointRecord.Y < Top + ActualHeight)
947 925
                                     {
948 926
                                         //LblMessage.Content = "在区域内:("+ pointRecord.X+","+pointRecord.Y+") ("+ Left + ","+Top+")";
949 927
                                     }
@@ -962,4 +940,4 @@ namespace XHWK.WKTool
962 940
             }
963 941
         }
964 942
     }
965
-}
943
+}

+ 7
- 7
XHWK.WKTool/Skin/SkinDictionary_TechnologyBlue.xaml View File

@@ -52,7 +52,7 @@
52 52
         <ControlTemplate.Triggers>
53 53
             <Trigger Property="IsMouseOver" Value="True">
54 54
                 <Setter TargetName="ImgSetUp" Property="Source" Value="/SkinImages/TechnologyBlue/HM_Close_MI.png" />
55
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
55
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
56 56
             </Trigger>
57 57
         </ControlTemplate.Triggers>
58 58
     </ControlTemplate>
@@ -80,11 +80,11 @@
80 80
         <ControlTemplate.Triggers>
81 81
             <Trigger Property="IsMouseOver" Value="True">
82 82
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_MI.png" />
83
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
83
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
84 84
             </Trigger>
85 85
             <Trigger Property="IsPressed" Value="True">
86 86
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_MI.png" />
87
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
87
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
88 88
             </Trigger>
89 89
             <Trigger Property="IsEnabled" Value="False">
90 90
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_N.png" />
@@ -115,11 +115,11 @@
115 115
         <ControlTemplate.Triggers>
116 116
             <Trigger Property="IsMouseOver" Value="True">
117 117
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_MI.png" />
118
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
118
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
119 119
             </Trigger>
120 120
             <Trigger Property="IsPressed" Value="True">
121 121
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_MI.png" />
122
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
122
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
123 123
             </Trigger>
124 124
             <Trigger Property="IsEnabled" Value="False">
125 125
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_N.png" />
@@ -150,11 +150,11 @@
150 150
         <ControlTemplate.Triggers>
151 151
             <Trigger Property="IsMouseOver" Value="True">
152 152
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_MI.png" />
153
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
153
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
154 154
             </Trigger>
155 155
             <Trigger Property="IsPressed" Value="True">
156 156
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_MI.png" />
157
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
157
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
158 158
             </Trigger>
159 159
             <Trigger Property="IsEnabled" Value="False">
160 160
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_N.png" />

+ 6
- 6
XHWK.WKTool/Skin/SkinDictionary_White.xaml View File

@@ -78,11 +78,11 @@
78 78
         <ControlTemplate.Triggers>
79 79
             <Trigger Property="IsMouseOver" Value="True">
80 80
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/White/Toolbar_LZ_MI.png" />
81
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
81
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
82 82
             </Trigger>
83 83
             <Trigger Property="IsPressed" Value="True">
84 84
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/White/Toolbar_LZ_MI.png" />
85
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
85
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
86 86
             </Trigger>
87 87
             <Trigger Property="IsEnabled" Value="False">
88 88
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/White/Toolbar_LZ_N.png" />
@@ -113,11 +113,11 @@
113 113
         <ControlTemplate.Triggers>
114 114
             <Trigger Property="IsMouseOver" Value="True">
115 115
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/White/Toolbar_LZZT_MI.png" />
116
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
116
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
117 117
             </Trigger>
118 118
             <Trigger Property="IsPressed" Value="True">
119 119
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/White/Toolbar_LZZT_MI.png" />
120
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
120
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
121 121
             </Trigger>
122 122
             <Trigger Property="IsEnabled" Value="False">
123 123
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/White/Toolbar_LZZT_N.png" />
@@ -148,11 +148,11 @@
148 148
         <ControlTemplate.Triggers>
149 149
             <Trigger Property="IsMouseOver" Value="True">
150 150
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/White/Toolbar_Save_MI.png" />
151
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
151
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
152 152
             </Trigger>
153 153
             <Trigger Property="IsPressed" Value="True">
154 154
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/White/Toolbar_Save_MI.png" />
155
-                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
155
+                <Setter TargetName="Word" Property="Foreground" Value="#4597FF" />
156 156
             </Trigger>
157 157
             <Trigger Property="IsEnabled" Value="False">
158 158
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/White/Toolbar_Save_N.png" />

+ 11
- 11
XHWK.WKTool/UploadWindow.xaml View File

@@ -28,7 +28,7 @@
28 28
         <Grid
29 29
             x:Name="GridTitle"
30 30
             Grid.Row="0"
31
-            Background="#3f6fff"
31
+            Background="#4597FF"
32 32
             MouseLeftButtonDown="Window_MouseLeftButtonDown"
33 33
             Visibility="Visible">
34 34
             <TextBlock
@@ -37,7 +37,7 @@
37 37
                 Foreground="#FFFFFF"
38 38
                 Text="上传" />
39 39
             <Button
40
-                x:Name="btnDown"
40
+                x:Name="BtnDown"
41 41
                 Grid.Row="0"
42 42
                 Width="45"
43 43
                 Height="45"
@@ -49,7 +49,7 @@
49 49
                 Foreground="#FFFFFF" />
50 50
         </Grid>
51 51
         <Grid
52
-            x:Name="GridTitle_Black"
52
+            x:Name="GridTitleBlack"
53 53
             Grid.Row="0"
54 54
             Margin="0,0"
55 55
             Background="#FFE9E9E9"
@@ -61,7 +61,7 @@
61 61
                 Foreground="#FF333333"
62 62
                 Text="上传" />
63 63
             <Button
64
-                x:Name="btnDown_Black"
64
+                x:Name="BtnDownBlack"
65 65
                 Grid.Row="0"
66 66
                 Padding="10,0,10,0"
67 67
                 HorizontalAlignment="Right"
@@ -73,7 +73,7 @@
73 73
         </Grid>
74 74
         <!--  第三行 教材  -->
75 75
         <ComboBox
76
-            x:Name="book_list"
76
+            x:Name="BookList"
77 77
             Grid.Row="2"
78 78
             Width="400"
79 79
             Height="50"
@@ -97,7 +97,7 @@
97 97
         </ComboBox>
98 98
         <!--  章节  -->
99 99
         <ComboBox
100
-            x:Name="cmbTeachingMaterial"
100
+            x:Name="CmbTeachingMaterial"
101 101
             Grid.Row="3"
102 102
             Width="400"
103 103
             Height="50"
@@ -118,7 +118,7 @@
118 118
         </ComboBox>
119 119
         <!--  第四行 开始按钮  -->
120 120
         <Button
121
-            x:Name="btnStart"
121
+            x:Name="BtnStart"
122 122
             Grid.Row="4"
123 123
             Width="400"
124 124
             Height="42"
@@ -135,7 +135,7 @@
135 135
                         BorderBrush="{TemplateBinding Control.BorderBrush}"
136 136
                         BorderThickness="1"
137 137
                         CornerRadius="21">
138
-                        <Border.Background>#3f6fff</Border.Background>
138
+                        <Border.Background>#4597FF</Border.Background>
139 139
                         <ContentPresenter
140 140
                             HorizontalAlignment="Center"
141 141
                             VerticalAlignment="Center"
@@ -145,7 +145,7 @@
145 145
             </Button.Template>
146 146
         </Button>
147 147
         <views:ZJClippingBorder
148
-            x:Name="tip_outer"
148
+            x:Name="TipOuter"
149 149
             Grid.Row="0"
150 150
             Grid.RowSpan="2"
151 151
             Margin="0"
@@ -160,7 +160,7 @@
160 160
                     Content="上传中..."
161 161
                     FontSize="16" />
162 162
                 <ProgressBar
163
-                    x:Name="pgbProcess"
163
+                    x:Name="PgbProcess"
164 164
                     Grid.Row="0"
165 165
                     Height="20"
166 166
                     Margin="50,20,50,0"
@@ -168,7 +168,7 @@
168 168
                     Foreground="#4597FF"
169 169
                     Visibility="Visible" />
170 170
                 <Label
171
-                    x:Name="lbProcess"
171
+                    x:Name="LbProcess"
172 172
                     Grid.Row="0"
173 173
                     Width="60"
174 174
                     Height="30"

+ 102
- 92
XHWK.WKTool/UploadWindow.xaml.cs View File

@@ -15,37 +15,37 @@ using static XHWK.WKTool.MainWindow;
15 15
 namespace XHWK.WKTool
16 16
 {
17 17
     /// <summary>
18
-    /// UploadWindow.xaml 的交互逻辑
18
+    ///     UploadWindow.xaml 的交互逻辑
19 19
     /// </summary>
20 20
     public partial class UploadWindow
21 21
     {
22 22
         /// <summary>
23
-        /// 调用接口
23
+        ///     调用接口
24 24
         /// </summary>
25 25
         private readonly XhApi _xhapi = new XhApi();
26 26
 
27 27
         /// <summary>
28
-        /// 前台数据
28
+        ///     前台数据
29 29
         /// </summary>
30 30
         internal LoginPageData pageData = new LoginPageData();
31 31
 
32 32
         /// <summary>
33
-        /// 文件名
33
+        ///     文件名
34 34
         /// </summary>
35 35
         private string _resourcename = string.Empty;
36 36
 
37 37
         /// <summary>
38
-        /// 文件大小
38
+        ///     文件大小
39 39
         /// </summary>
40 40
         private long _resourcesize;
41 41
 
42 42
         /// <summary>
43
-        /// 文件类型
43
+        ///     文件类型
44 44
         /// </summary>
45 45
         private string _suffix = string.Empty;
46 46
 
47 47
         /// <summary>
48
-        /// 唯一编号
48
+        ///     唯一编号
49 49
         /// </summary>
50 50
         private string _guid = string.Empty;
51 51
 
@@ -53,7 +53,7 @@ namespace XHWK.WKTool
53 53
         public event ChangeTextHandlers ResultEvents;
54 54
 
55 55
         /// <summary>
56
-        /// 当前视频的下标
56
+        ///     当前视频的下标
57 57
         /// </summary>
58 58
         private int _i;
59 59
 
@@ -65,7 +65,7 @@ namespace XHWK.WKTool
65 65
         }
66 66
 
67 67
         /// <summary>
68
-        /// 初始化
68
+        ///     初始化
69 69
         /// </summary>
70 70
         public void Initialize
71 71
         (
@@ -76,17 +76,17 @@ namespace XHWK.WKTool
76 76
             int m
77 77
         )
78 78
         {
79
-            this._i = m;
80
-            this._resourcename = mResourcename;
81
-            this._resourcesize = mResourcesize;
82
-            this._suffix = mSuffix;
83
-            this._guid = mGuid;
84
-            tip_outer.Visibility = Visibility.Collapsed;
79
+            _i = m;
80
+            _resourcename = mResourcename;
81
+            _resourcesize = mResourcesize;
82
+            _suffix = mSuffix;
83
+            _guid = mGuid;
84
+            TipOuter.Visibility = Visibility.Collapsed;
85 85
             Tsubjectbook();
86 86
         }
87 87
 
88 88
         /// <summary>
89
-        /// 教材接口调用
89
+        ///     教材接口调用
90 90
         /// </summary>
91 91
         /// <returns>
92 92
         /// </returns>
@@ -97,8 +97,7 @@ namespace XHWK.WKTool
97 97
             {
98 98
                 for (int i = 0; i < App.TsubjectbookList.Count; i++)
99 99
                 {
100
-                    pageData.bookList.Add
101
-                    (
100
+                    pageData.bookList.Add(
102 101
                         new ComboBoxBean()
103 102
                         {
104 103
                             Key = App.TsubjectbookList[i].Lsbid,
@@ -107,7 +106,7 @@ namespace XHWK.WKTool
107 106
                         }
108 107
                     );
109 108
                 }
110
-                book_list.SelectedIndex = 0;
109
+                BookList.SelectedIndex = 0;
111 110
                 DataContext = pageData;
112 111
                 if (App.TsubjectbookList.Count > 0)
113 112
                 {
@@ -128,19 +127,18 @@ namespace XHWK.WKTool
128 127
         }
129 128
 
130 129
         /// <summary>
131
-        /// 章节接口调用
130
+        ///     章节接口调用
132 131
         /// </summary>
133 132
         private void Director()
134 133
         {
135
-            int selectIndex = book_list.SelectedIndex;
134
+            int selectIndex = BookList.SelectedIndex;
136 135
             if (selectIndex < 0)
137 136
             {
138 137
                 selectIndex = 0;
139 138
             }
140 139
             if (App.TsubjectbookList.Count > selectIndex)
141 140
             {
142
-                int code = _xhapi.DirectorList
143
-                (
141
+                int code = _xhapi.DirectorList(
144 142
                     App.TsubjectbookList[selectIndex].Lsbid,
145 143
                     4,
146 144
                     App.UserInfo.Userid
@@ -148,12 +146,19 @@ namespace XHWK.WKTool
148 146
                 if (code == 0)
149 147
                 {
150 148
                     pageData.zhangjieList.Clear();
151
-                    foreach (var item in App.DirectorList)
149
+                    foreach (ModelDirectorList item in App.DirectorList)
152 150
                     {
153
-                        pageData.zhangjieList.Add(new ComboBoxBean() { Key = item.directorid, Value = item.directorname, leaf = item.leaf });
151
+                        pageData.zhangjieList.Add(
152
+                            new ComboBoxBean()
153
+                            {
154
+                                Key = item.directorid,
155
+                                Value = item.directorname,
156
+                                leaf = item.leaf
157
+                            }
158
+                        );
154 159
                         AddChild(item);
155 160
                     }
156
-                    cmbTeachingMaterial.SelectedIndex = 0;
161
+                    CmbTeachingMaterial.SelectedIndex = 0;
157 162
                 }
158 163
                 else
159 164
                 {
@@ -163,7 +168,7 @@ namespace XHWK.WKTool
163 168
         }
164 169
 
165 170
         /// <summary>
166
-        /// 子章节递归
171
+        ///     子章节递归
167 172
         /// </summary>
168 173
         /// <param name="directorList">
169 174
         /// </param>
@@ -173,7 +178,14 @@ namespace XHWK.WKTool
173 178
             {
174 179
                 foreach (ModelDirectorList child in directorList.children)
175 180
                 {
176
-                    pageData.zhangjieList.Add(new ComboBoxBean() { Key = child.directorid, Value = GetSpace(child.directorlevel) + child.directorname, leaf = child.leaf });
181
+                    pageData.zhangjieList.Add(
182
+                        new ComboBoxBean()
183
+                        {
184
+                            Key = child.directorid,
185
+                            Value = GetSpace(child.directorlevel) + child.directorname,
186
+                            leaf = child.leaf
187
+                        }
188
+                    );
177 189
                     if (child.children != null && child.children.Count > 0)
178 190
                     {
179 191
                         AddChild(child);
@@ -183,7 +195,7 @@ namespace XHWK.WKTool
183 195
         }
184 196
 
185 197
         /// <summary>
186
-        /// 章节是否加空格符
198
+        ///     章节是否加空格符
187 199
         /// </summary>
188 200
         /// <param name="num">
189 201
         /// </param>
@@ -213,7 +225,7 @@ namespace XHWK.WKTool
213 225
         }
214 226
 
215 227
         /// <summary>
216
-        /// 教材下拉框改变事件
228
+        ///     教材下拉框改变事件
217 229
         /// </summary>
218 230
         /// <param name="sender">
219 231
         /// </param>
@@ -240,7 +252,7 @@ namespace XHWK.WKTool
240 252
         }
241 253
 
242 254
         /// <summary>
243
-        /// 上传到个人空间
255
+        ///     上传到个人空间
244 256
         /// </summary>
245 257
         /// <param name="sender">
246 258
         /// </param>
@@ -248,28 +260,26 @@ namespace XHWK.WKTool
248 260
         /// </param>
249 261
         private void BtnStart_Click(object sender, RoutedEventArgs e)
250 262
         {
251
-            if (string.IsNullOrWhiteSpace(book_list.Text))
263
+            if (string.IsNullOrWhiteSpace(BookList.Text))
252 264
             {
253 265
                 MessageWindow.Show("请选择教材!");
254 266
                 return;
255 267
             }
256
-
257
-            if (cmbTeachingMaterial.SelectedIndex < pageData.zhangjieList.Count)
268
+            if (CmbTeachingMaterial.SelectedIndex < pageData.zhangjieList.Count)
258 269
             {
259
-                int leaf = pageData.zhangjieList[cmbTeachingMaterial.SelectedIndex].leaf;
270
+                int leaf = pageData.zhangjieList[CmbTeachingMaterial.SelectedIndex].leaf;
260 271
                 if (leaf != 1)
261 272
                 {
262 273
                     MessageWindow.Show("只能选择小节或全部进行上传!");
263 274
                     return;
264 275
                 }
265 276
             }
266
-
267
-            btnStart.IsEnabled = false;
268
-            book_list.IsEnabled = false;
269
-            cmbTeachingMaterial.IsEnabled = false;
277
+            BtnStart.IsEnabled = false;
278
+            BookList.IsEnabled = false;
279
+            CmbTeachingMaterial.IsEnabled = false;
270 280
             Thread myThread = new Thread(StartUpload);
271 281
             _num = 0;
272
-            tip_outer.Visibility = Visibility.Visible;
282
+            TipOuter.Visibility = Visibility.Visible;
273 283
             myThread.Start();
274 284
             _times = new System.Timers.Timer(100);
275 285
             _times.Elapsed += Times_ElapsedClick;
@@ -302,20 +312,19 @@ namespace XHWK.WKTool
302 312
                     //suffix: "mp4"
303 313
                     //uid: 80
304 314
                     ModelResourceAdd modelResourceAdd = new ModelResourceAdd();
305
-                    Dispatcher.Invoke
306
-                    (
315
+                    Dispatcher.Invoke(
307 316
                         () =>
308 317
                         {
309 318
                             modelResourceAdd = new ModelResourceAdd
310 319
                             {
311 320
                                 converted = 0,
312 321
                                 createid = App.UserInfo.Userid,
313
-                                directorid = cmbTeachingMaterial.SelectedValue.ToString(),
322
+                                directorid = CmbTeachingMaterial.SelectedValue.ToString(),
314 323
                                 duration = App.ResourceAddTwo.duration,
315
-                                subjectid = App.TsubjectbookList[book_list.SelectedIndex].Subjectid,
324
+                                subjectid = App.TsubjectbookList[BookList.SelectedIndex].Subjectid,
316 325
                                 imgUrl = "",
317 326
                                 level = 2,
318
-                                lsbid = book_list.SelectedValue.ToString(),
327
+                                lsbid = BookList.SelectedValue.ToString(),
319 328
                                 mp4code = App.ResourceAddTwo.mp4code,
320 329
                                 resourcebelong = 3,
321 330
                                 resourceclass = 5,
@@ -345,8 +354,7 @@ namespace XHWK.WKTool
345 354
                     int code = _xhapi.ResourceAdd(modelResourceAdd);
346 355
                     if (code == 0)
347 356
                     {
348
-                        Dispatcher.Invoke
349
-                        (
357
+                        Dispatcher.Invoke(
350 358
                             () =>
351 359
                             {
352 360
                                 foreach (ModelWkData vdata in App.WKDataList)
@@ -364,15 +372,15 @@ namespace XHWK.WKTool
364 372
                                         }
365 373
                                     }
366 374
                                 }
367
-                                btnStart.IsEnabled = true;
368
-                                book_list.IsEnabled = true;
369
-                                cmbTeachingMaterial.IsEnabled = true;
375
+                                BtnStart.IsEnabled = true;
376
+                                BookList.IsEnabled = true;
377
+                                CmbTeachingMaterial.IsEnabled = true;
370 378
                                 _num = 99;
371 379
                                 _times.Stop();
372
-                                pgbProcess.Value = 100;
373
-                                lbProcess.Content = "100%";
380
+                                PgbProcess.Value = 100;
381
+                                LbProcess.Content = "100%";
374 382
                                 Hide();
375
-                                tip_outer.Visibility = Visibility.Collapsed;
383
+                                TipOuter.Visibility = Visibility.Collapsed;
376 384
                                 MessageWindow.Show("视频上传成功!");
377 385
                                 if (ResultEvents != null)
378 386
                                 {
@@ -383,15 +391,14 @@ namespace XHWK.WKTool
383 391
                     }
384 392
                     else
385 393
                     {
386
-                        Dispatcher.Invoke
387
-                        (
394
+                        Dispatcher.Invoke(
388 395
                             () =>
389 396
                             {
390
-                                btnStart.IsEnabled = true;
391
-                                book_list.IsEnabled = true;
392
-                                cmbTeachingMaterial.IsEnabled = true;
397
+                                BtnStart.IsEnabled = true;
398
+                                BookList.IsEnabled = true;
399
+                                CmbTeachingMaterial.IsEnabled = true;
393 400
                                 _times.Stop();
394
-                                tip_outer.Visibility = Visibility.Collapsed;
401
+                                TipOuter.Visibility = Visibility.Collapsed;
395 402
                                 MessageWindow.Show(App.ServerMsg);
396 403
                             }
397 404
                         );
@@ -399,15 +406,14 @@ namespace XHWK.WKTool
399 406
                 }
400 407
                 else
401 408
                 {
402
-                    Dispatcher.Invoke
403
-                    (
409
+                    Dispatcher.Invoke(
404 410
                         () =>
405 411
                         {
406
-                            btnStart.IsEnabled = true;
407
-                            book_list.IsEnabled = true;
408
-                            cmbTeachingMaterial.IsEnabled = true;
412
+                            BtnStart.IsEnabled = true;
413
+                            BookList.IsEnabled = true;
414
+                            CmbTeachingMaterial.IsEnabled = true;
409 415
                             _times.Stop();
410
-                            tip_outer.Visibility = Visibility.Collapsed;
416
+                            TipOuter.Visibility = Visibility.Collapsed;
411 417
                             MessageWindow.Show(errMessage);
412 418
                         }
413 419
                     );
@@ -415,25 +421,27 @@ namespace XHWK.WKTool
415 421
             }
416 422
             catch (Exception ex)
417 423
             {
418
-                Dispatcher.Invoke(() =>
419
-                {
420
-                    btnStart.IsEnabled = true;
421
-                    book_list.IsEnabled = true;
422
-                    cmbTeachingMaterial.IsEnabled = true;
423
-                    _times.Stop();
424
-                    tip_outer.Visibility = Visibility.Collapsed;
425
-                    MessageWindow.Show("无法上传视频,请检查与服务器链接状态!");
426
-                    App.IsUpLoad = false;
427
-                    Hide();
428
-                    LogHelper.Logerror.Error("【UploadWindow】(BtnStart_Click)" + ex.Message, ex);
429
-                });
424
+                Dispatcher.Invoke(
425
+                    () =>
426
+                    {
427
+                        BtnStart.IsEnabled = true;
428
+                        BookList.IsEnabled = true;
429
+                        CmbTeachingMaterial.IsEnabled = true;
430
+                        _times.Stop();
431
+                        TipOuter.Visibility = Visibility.Collapsed;
432
+                        MessageWindow.Show("无法上传视频,请检查与服务器链接状态!");
433
+                        App.IsUpLoad = false;
434
+                        Hide();
435
+                        LogHelper.Logerror.Error("【UploadWindow】(BtnStart_Click)" + ex.Message, ex);
436
+                    }
437
+                );
430 438
             }
431 439
         }
432 440
 
433 441
         private int _num;
434 442
 
435 443
         /// <summary>
436
-        /// 计时器
444
+        ///     计时器
437 445
         /// </summary>
438 446
         /// <param name="sender">
439 447
         /// </param>
@@ -441,21 +449,23 @@ namespace XHWK.WKTool
441 449
         /// </param>
442 450
         private void Times_ElapsedClick(object sender, System.Timers.ElapsedEventArgs e)
443 451
         {
444
-            Dispatcher.Invoke(() =>
445
-            {
446
-                pgbProcess.Value = _num;
447
-                lbProcess.Content = _num + "%";
448
-                if (_num < 99)
449
-                {
450
-                    _num++;
451
-                    // ReSharper disable once PossibleLossOfFraction
452
-                    _times.Interval += _num / 2;
453
-                }
454
-                else
452
+            Dispatcher.Invoke(
453
+                () =>
455 454
                 {
456
-                    _times.Stop();
455
+                    PgbProcess.Value = _num;
456
+                    LbProcess.Content = _num + "%";
457
+                    if (_num < 99)
458
+                    {
459
+                        _num++;
460
+                        // ReSharper disable once PossibleLossOfFraction
461
+                        _times.Interval += _num / 2;
462
+                    }
463
+                    else
464
+                    {
465
+                        _times.Stop();
466
+                    }
457 467
                 }
458
-            });
468
+            );
459 469
         }
460 470
     }
461 471
 
@@ -471,4 +481,4 @@ namespace XHWK.WKTool
471 481
             zhangjieList = new ObservableCollection<ComboBoxBean>();
472 482
         }
473 483
     }
474
-}
484
+}

XHWK.WKTool/AESHelper.cs → XHWK.WKTool/Utils/AESHelper.cs View File


+ 205
- 306
XHWK.WKTool/VideoClipWindow.xaml View File

@@ -1,295 +1,99 @@
1
-<Window x:Class="XHWK.WKTool.VideoClipWindow" 
2
-        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
-        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
-        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
-        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
-        xmlns:local="clr-namespace:XHWK.WKTool"
7
-        mc:Ignorable="d"
8
-        Title="VideoClipWindow"  AllowsTransparency="True"
1
+<Window
2
+    x:Class="XHWK.WKTool.VideoClipWindow"
3
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6
+    xmlns:local="clr-namespace:XHWK.WKTool"
7
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8
+    Title="VideoClipWindow"
9
+    Width="1290"
10
+    Height="1036"
11
+    AllowsTransparency="True"
12
+    BorderThickness="7"
13
+    ResizeMode="CanMinimize"
9 14
     ShowInTaskbar="True"
10 15
     WindowStartupLocation="CenterScreen"
11
-    WindowStyle="None"  BorderThickness="7"  ResizeMode="CanMinimize" Height="1036" Width="1290" >
16
+    WindowStyle="None"
17
+    mc:Ignorable="d">
12 18
     <Window.Effect>
13
-        <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
19
+        <DropShadowEffect
20
+            BlurRadius="10"
21
+            Direction="80"
22
+            ShadowDepth="0"
23
+            Color="#bababa" />
14 24
     </Window.Effect>
15
-    <Window.Resources>
16
-        <SolidColorBrush x:Key="SliderThumb.Static.Foreground" Color="#FFE5E5E5"/>
17
-        <SolidColorBrush x:Key="SliderThumb.MouseOver.Background" Color="#FFDCECFC"/>
18
-        <SolidColorBrush x:Key="SliderThumb.MouseOver.Border" Color="#FF7Eb4EA"/>
19
-        <SolidColorBrush x:Key="SliderThumb.Pressed.Background" Color="#FFDAECFC"/>
20
-        <SolidColorBrush x:Key="SliderThumb.Pressed.Border" Color="#FF569DE5"/>
21
-        <SolidColorBrush x:Key="SliderThumb.Disabled.Background" Color="#FFF0F0F0"/>
22
-        <SolidColorBrush x:Key="SliderThumb.Disabled.Border" Color="#FFD9D9D9"/>
23
-        <SolidColorBrush x:Key="SliderThumb.Static.Background" Color="#FFF0F0F0"/>
24
-        <SolidColorBrush x:Key="SliderThumb.Static.Border" Color="#FFACACAC"/>
25
-        <ControlTemplate x:Key="SliderThumbHorizontalTop" TargetType="{x:Type Thumb}">
26
-            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
27
-                <Path x:Name="grip" Data="M 0,6 C0,6 5.5,0 5.5,0 5.5,0 11,6 11,6 11,6 11,18 11,18 11,18 0,18 0,18 0,18 0,6 0,6 z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" SnapsToDevicePixels="True" Stroke="{StaticResource SliderThumb.Static.Border}" StrokeThickness="1" UseLayoutRounding="True" VerticalAlignment="Center"/>
28
-            </Grid>
29
-            <ControlTemplate.Triggers>
30
-                <Trigger Property="IsMouseOver" Value="true">
31
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
32
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
33
-                </Trigger>
34
-                <Trigger Property="IsDragging" Value="true">
35
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
36
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
37
-                </Trigger>
38
-                <Trigger Property="IsEnabled" Value="false">
39
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
40
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
41
-                </Trigger>
42
-            </ControlTemplate.Triggers>
43
-        </ControlTemplate>
44
-        <ControlTemplate x:Key="SliderThumbHorizontalBottom" TargetType="{x:Type Thumb}">
45
-            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
46
-                <Path x:Name="grip" Data="M 0,12 C0,12 5.5,18 5.5,18 5.5,18 11,12 11,12 11,12 11,0 11,0 11,0 0,0 0,0 0,0 0,12 0,12 z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" SnapsToDevicePixels="True" Stroke="{StaticResource SliderThumb.Static.Border}" StrokeThickness="1" UseLayoutRounding="True" VerticalAlignment="Center"/>
47
-            </Grid>
48
-            <ControlTemplate.Triggers>
49
-                <Trigger Property="IsMouseOver" Value="true">
50
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
51
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
52
-                </Trigger>
53
-                <Trigger Property="IsDragging" Value="true">
54
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
55
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
56
-                </Trigger>
57
-                <Trigger Property="IsEnabled" Value="false">
58
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
59
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
60
-                </Trigger>
61
-            </ControlTemplate.Triggers>
62
-        </ControlTemplate>
63
-        <SolidColorBrush x:Key="SliderThumb.Track.Border" Color="#FFD6D6D6"/>
64
-        <SolidColorBrush x:Key="SliderThumb.Track.Background" Color="#FFE7EAEA"/>
65
-        <Style x:Key="RepeatButtonTransparent" TargetType="{x:Type RepeatButton}">
66
-            <Setter Property="OverridesDefaultStyle" Value="true"/>
67
-            <Setter Property="Background" Value="Transparent"/>
68
-            <Setter Property="Focusable" Value="false"/>
69
-            <Setter Property="IsTabStop" Value="false"/>
70
-            <Setter Property="Template">
71
-                <Setter.Value>
72
-                    <ControlTemplate TargetType="{x:Type RepeatButton}">
73
-                        <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
74
-                    </ControlTemplate>
75
-                </Setter.Value>
76
-            </Setter>
77
-        </Style>
78
-        <ControlTemplate x:Key="SliderThumbHorizontalDefault" TargetType="{x:Type Thumb}">
79
-            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
80
-                <Path x:Name="grip" Data="M 0,0 C0,0 11,0 11,0 11,0 11,18 11,18 11,18 0,18 0,18 0,18 0,0 0,0 z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" SnapsToDevicePixels="True" Stroke="{StaticResource SliderThumb.Static.Border}" StrokeThickness="1" UseLayoutRounding="True" VerticalAlignment="Center"/>
81
-            </Grid>
82
-            <ControlTemplate.Triggers>
83
-                <Trigger Property="IsMouseOver" Value="true">
84
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
85
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
86
-                </Trigger>
87
-                <Trigger Property="IsDragging" Value="true">
88
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
89
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
90
-                </Trigger>
91
-                <Trigger Property="IsEnabled" Value="false">
92
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
93
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
94
-                </Trigger>
95
-            </ControlTemplate.Triggers>
96
-        </ControlTemplate>
97
-        <ControlTemplate x:Key="SliderHorizontal" TargetType="{x:Type Slider}">
98
-            <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
99
-                <Grid>
100
-                    <Grid.RowDefinitions>
101
-                        <RowDefinition Height="Auto"/>
102
-                        <RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
103
-                        <RowDefinition Height="Auto"/>
104
-                    </Grid.RowDefinitions>
105
-                    <TickBar x:Name="TopTick" Fill="{TemplateBinding Foreground}" Height="4" Margin="0,0,0,2" Placement="Top" Grid.Row="0" Visibility="Collapsed"/>
106
-                    <TickBar x:Name="BottomTick" Fill="{TemplateBinding Foreground}" Height="4" Margin="0,2,0,0" Placement="Bottom" Grid.Row="2" Visibility="Collapsed"/>
107
-                    <Border x:Name="TrackBackground" BorderBrush="{StaticResource SliderThumb.Track.Border}" BorderThickness="1" Background="{StaticResource SliderThumb.Track.Background}" Height="4.0" Margin="5,0" Grid.Row="1" VerticalAlignment="center">
108
-                        <Canvas Margin="-6,-1">
109
-                            <Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Height="4.0" Visibility="Hidden"/>
110
-                        </Canvas>
111
-                    </Border>
112
-                    <Track x:Name="PART_Track" Grid.Row="1">
113
-                        <Track.DecreaseRepeatButton>
114
-                            <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"/>
115
-                        </Track.DecreaseRepeatButton>
116
-                        <Track.Thumb>
117
-                            <Thumb x:Name="Thumb" Focusable="False" Height="18" OverridesDefaultStyle="True" Template="{StaticResource SliderThumbHorizontalDefault}" VerticalAlignment="Center" Width="11"/>
118
-                        </Track.Thumb>
119
-                    </Track>
120
-                    <Track x:Name="PART_TrackLeft" Grid.Row="1">
121
-                        <Track.DecreaseRepeatButton>
122
-                            <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"/>
123
-                        </Track.DecreaseRepeatButton>
124
-                        <Track.Thumb>
125
-                            <Thumb x:Name="ThumbLeft" Focusable="False" Height="10" OverridesDefaultStyle="True" Template="{StaticResource SliderThumbHorizontalDefault}" VerticalAlignment="Center" Width="8" BorderBrush="#FFF12525" Foreground="#FFF33333" Background="#FFE81A1A" AutomationProperties.IsOffscreenBehavior="Offscreen"/>
126
-                        </Track.Thumb>
127
-                    </Track>
128
-                </Grid>
129
-            </Border>
130
-            <ControlTemplate.Triggers>
131
-                <Trigger Property="TickPlacement" Value="TopLeft">
132
-                    <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
133
-                    <Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbHorizontalTop}"/>
134
-                    <Setter Property="Margin" TargetName="TrackBackground" Value="5,2,5,0"/>
135
-                </Trigger>
136
-                <Trigger Property="TickPlacement" Value="BottomRight">
137
-                    <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
138
-                    <Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbHorizontalBottom}"/>
139
-                    <Setter Property="Margin" TargetName="TrackBackground" Value="5,0,5,2"/>
140
-                </Trigger>
141
-                <Trigger Property="TickPlacement" Value="Both">
142
-                    <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
143
-                    <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
144
-                </Trigger>
145
-                <Trigger Property="IsSelectionRangeEnabled" Value="true">
146
-                    <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
147
-                </Trigger>
148
-                <Trigger Property="IsKeyboardFocused" Value="true">
149
-                    <Setter Property="Foreground" TargetName="Thumb" Value="Blue"/>
150
-                </Trigger>
151
-            </ControlTemplate.Triggers>
152
-        </ControlTemplate>
153
-        <ControlTemplate x:Key="SliderThumbVerticalLeft" TargetType="{x:Type Thumb}">
154
-            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
155
-                <Path x:Name="grip" Data="M 6,11 C6,11 0,5.5 0,5.5 0,5.5 6,0 6,0 6,0 18,0 18,0 18,0 18,11 18,11 18,11 6,11 6,11 z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" Stroke="{StaticResource SliderThumb.Static.Border}"/>
156
-            </Grid>
157
-            <ControlTemplate.Triggers>
158
-                <Trigger Property="IsMouseOver" Value="true">
159
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
160
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
161
-                </Trigger>
162
-                <Trigger Property="IsDragging" Value="true">
163
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
164
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
165
-                </Trigger>
166
-                <Trigger Property="IsEnabled" Value="false">
167
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
168
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
169
-                </Trigger>
170
-            </ControlTemplate.Triggers>
171
-        </ControlTemplate>
172
-        <ControlTemplate x:Key="SliderThumbVerticalRight" TargetType="{x:Type Thumb}">
173
-            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
174
-                <Path x:Name="grip" Data="M 12,11 C12,11 18,5.5 18,5.5 18,5.5 12,0 12,0 12,0 0,0 0,0 0,0 0,11 0,11 0,11 12,11 12,11 z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" Stroke="{StaticResource SliderThumb.Static.Border}"/>
175
-            </Grid>
176
-            <ControlTemplate.Triggers>
177
-                <Trigger Property="IsMouseOver" Value="true">
178
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
179
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
180
-                </Trigger>
181
-                <Trigger Property="IsDragging" Value="true">
182
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
183
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
184
-                </Trigger>
185
-                <Trigger Property="IsEnabled" Value="false">
186
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
187
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
188
-                </Trigger>
189
-            </ControlTemplate.Triggers>
190
-        </ControlTemplate>
191
-        <ControlTemplate x:Key="SliderThumbVerticalDefault" TargetType="{x:Type Thumb}">
192
-            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
193
-                <Path x:Name="grip" Data="M0.5,0.5 L18.5,0.5 18.5,11.5 0.5,11.5z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" Stroke="{StaticResource SliderThumb.Static.Border}"/>
194
-            </Grid>
195
-            <ControlTemplate.Triggers>
196
-                <Trigger Property="IsMouseOver" Value="true">
197
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
198
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
199
-                </Trigger>
200
-                <Trigger Property="IsDragging" Value="true">
201
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
202
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
203
-                </Trigger>
204
-                <Trigger Property="IsEnabled" Value="false">
205
-                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
206
-                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
207
-                </Trigger>
208
-            </ControlTemplate.Triggers>
209
-        </ControlTemplate>
210
-        <ControlTemplate x:Key="SliderVertical" TargetType="{x:Type Slider}">
211
-            <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
212
-                <Grid>
213
-                    <Grid.ColumnDefinitions>
214
-                        <ColumnDefinition Width="Auto"/>
215
-                        <ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto"/>
216
-                        <ColumnDefinition Width="Auto"/>
217
-                    </Grid.ColumnDefinitions>
218
-                    <TickBar x:Name="TopTick" Grid.Column="0" Fill="{TemplateBinding Foreground}" Margin="0,0,2,0" Placement="Left" Visibility="Collapsed" Width="4"/>
219
-                    <TickBar x:Name="BottomTick" Grid.Column="2" Fill="{TemplateBinding Foreground}" Margin="2,0,0,0" Placement="Right" Visibility="Collapsed" Width="4"/>
220
-                    <Border x:Name="TrackBackground" BorderBrush="{StaticResource SliderThumb.Track.Border}" BorderThickness="1" Background="{StaticResource SliderThumb.Track.Background}" Grid.Column="1" HorizontalAlignment="center" Margin="0,5" Width="4.0">
221
-                        <Canvas Margin="-1,-6">
222
-                            <Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Visibility="Hidden" Width="4.0"/>
223
-                        </Canvas>
224
-                    </Border>
225
-                    <Track x:Name="PART_Track" Grid.Column="1">
226
-                        <Track.DecreaseRepeatButton>
227
-                            <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"/>
228
-                        </Track.DecreaseRepeatButton>
229
-                        <Track.IncreaseRepeatButton>
230
-                            <RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"/>
231
-                        </Track.IncreaseRepeatButton>
232
-                        <Track.Thumb>
233
-                            <Thumb x:Name="Thumb" Focusable="False" Height="11" OverridesDefaultStyle="True" Template="{StaticResource SliderThumbVerticalDefault}" VerticalAlignment="Top" Width="18"/>
234
-                        </Track.Thumb>
235
-                    </Track>
236
-                </Grid>
237
-            </Border>
238
-            <ControlTemplate.Triggers>
239
-                <Trigger Property="TickPlacement" Value="TopLeft">
240
-                    <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
241
-                    <Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbVerticalLeft}"/>
242
-                    <Setter Property="Margin" TargetName="TrackBackground" Value="2,5,0,5"/>
243
-                </Trigger>
244
-                <Trigger Property="TickPlacement" Value="BottomRight">
245
-                    <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
246
-                    <Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbVerticalRight}"/>
247
-                    <Setter Property="Margin" TargetName="TrackBackground" Value="0,5,2,5"/>
248
-                </Trigger>
249
-                <Trigger Property="TickPlacement" Value="Both">
250
-                    <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
251
-                    <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
252
-                </Trigger>
253
-                <Trigger Property="IsSelectionRangeEnabled" Value="true">
254
-                    <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
255
-                </Trigger>
256
-                <Trigger Property="IsKeyboardFocused" Value="true">
257
-                    <Setter Property="Foreground" TargetName="Thumb" Value="Blue"/>
258
-                </Trigger>
259
-            </ControlTemplate.Triggers>
260
-        </ControlTemplate>
261
-    </Window.Resources>
262
-    <Grid Name="Main_Grid">
25
+    <Window.Resources />
26
+    <Grid Name="MainGrid">
263 27
         <Grid.RowDefinitions>
264
-            <RowDefinition Height="50*"></RowDefinition>
265
-            <RowDefinition Height="750*"></RowDefinition>
266
-            <RowDefinition Height="auto"></RowDefinition>
267
-            <RowDefinition Height="147*"></RowDefinition>
28
+            <RowDefinition Height="50*" />
29
+            <RowDefinition Height="750*" />
30
+            <RowDefinition Height="auto" />
31
+            <RowDefinition Height="147*" />
268 32
         </Grid.RowDefinitions>
269
-        <Grid Background="#3f6fff" Grid.Row="0" MouseLeftButtonDown="Title_MouseLeftButtonDown">
270
-            <TextBlock Text="视频剪辑" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
271
-            <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right"  Click="Button_Click"/>
33
+        <Grid
34
+            Grid.Row="0"
35
+            Background="#4597FF"
36
+            MouseLeftButtonDown="Title_MouseLeftButtonDown">
37
+            <TextBlock
38
+                Padding="10,13,0,0"
39
+                FontSize="16"
40
+                Foreground="#FFFFFF"
41
+                Text="视频剪辑" />
42
+            <Button
43
+                x:Name="BtnDown"
44
+                Grid.Row="0"
45
+                Padding="10,0,10,0"
46
+                HorizontalAlignment="Right"
47
+                Click="Button_Click"
48
+                Content="×"
49
+                Cursor="Hand"
50
+                FontSize="25"
51
+                Foreground="#FFFFFF" />
272 52
         </Grid>
273
-        <Grid x:Name="GridMovie" Grid.Row="1" Background="Black">
274
-            <MediaElement Stretch="Fill" LoadedBehavior="Manual" Name="QS_Movie" MediaOpened="Element_MediaOpened" Loaded="QS_Movie_Loaded" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.ColumnSpan="2" Volume="1"/>
53
+        <Grid
54
+            x:Name="GridMovie"
55
+            Grid.Row="1"
56
+            Background="Black">
57
+            <MediaElement
58
+                Name="QsMovie"
59
+                Grid.ColumnSpan="2"
60
+                HorizontalAlignment="Stretch"
61
+                VerticalAlignment="Stretch"
62
+                Loaded="QS_Movie_Loaded"
63
+                LoadedBehavior="Manual"
64
+                MediaOpened="Element_MediaOpened"
65
+                Stretch="Fill"
66
+                Volume="1" />
275 67
             <!--<Button Name="LeftButton" Width="50" Height="50" HorizontalAlignment="Left" VerticalAlignment="Center" Click="Left_Click" Visibility="Hidden" Margin="0,147">上一个</Button>
276 68
             <Button Name="RightButton" Width="50" Height="50" HorizontalAlignment="Right" VerticalAlignment="Center" Click="Right_Click" Visibility="Hidden" Grid.Column="1" Margin="0,147">下一个</Button>-->
277 69
         </Grid>
278 70
         <!--<StackPanel Grid.Row="2" Orientation="Horizontal">-->
279 71
         <Grid Grid.Row="2">
280 72
             <Grid.ColumnDefinitions>
281
-                <ColumnDefinition Width="50*"/>
282
-                <ColumnDefinition Width="1796*"/>
283
-                <ColumnDefinition Width="60*"/>
73
+                <ColumnDefinition Width="50*" />
74
+                <ColumnDefinition Width="1796*" />
75
+                <ColumnDefinition Width="60*" />
284 76
             </Grid.ColumnDefinitions>
285 77
             <Grid Grid.Column="0">
286
-                <Button Cursor="Hand" x:Name="Play"  Margin="0" Click="Play_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
78
+                <Button
79
+                    x:Name="Play"
80
+                    Margin="0"
81
+                    HorizontalAlignment="Stretch"
82
+                    VerticalAlignment="Stretch"
83
+                    Click="Play_Click"
84
+                    Cursor="Hand">
287 85
                     <StackPanel Orientation="Vertical">
288
-                        <Image x:Name="ImgPlay" Source="/Images/Clip_Play.png" Visibility="Visible"/>
289
-                        <Image x:Name="ImgPause" Source="/Images/Clip_Pause.png" Visibility="Collapsed"/>
86
+                        <Image
87
+                            x:Name="ImgPlay"
88
+                            Source="/Images/Clip_Play.png"
89
+                            Visibility="Visible" />
90
+                        <Image
91
+                            x:Name="ImgPause"
92
+                            Source="/Images/Clip_Pause.png"
93
+                            Visibility="Collapsed" />
290 94
                     </StackPanel>
291 95
                 </Button>
292
-                <!--<Button Height="40" Width="40" x:Name="Pause" Click="Pause_Click" Margin="45,0,0,0">暂停</Button>-->
96
+
293 97
             </Grid>
294 98
             <!--<Grid Grid.Row="0" Grid.Column="1">
295 99
                 <Slider x:Name="timelineSlider" Minimum="0" VerticalAlignment="Center"  PreviewMouseLeftButtonDown="timelineMDown"  PreviewMouseLeftButtonUp="timelineMUp" BorderThickness="0,5,0,0" />
@@ -297,61 +101,156 @@
297 101
             <Grid Grid.Row="1" Grid.Column="1">
298 102
                 <local:UC_MultiRangeSlider x:Name="UcSlider" Minimum="0" Maximum="1000"  SilderWidth="1807" SliderTickFrequency="1" Grid.RowSpan="2" PreviewMouseLeftButtonDown="UcSlider_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="UcSlider_PreviewMouseLeftButtonUp" PreviewMouseMove="UcSlider_PreviewMouseMove"/>
299 103
             </Grid>-->
300
-            <Grid Name="Control_Progress" Grid.Column="1" Height="54">
301
-                <local:UC_MultiRangeSlider x:Name="UcSlider" Minimum="0" Maximum="1000"  Grid.Row="2" SilderWidth="1807" SliderTickFrequency="1" Margin="0,18,5,0" Grid.RowSpan="2" PreviewMouseLeftButtonDown="UcSlider_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="UcSlider_PreviewMouseLeftButtonUp" PreviewMouseMove="UcSlider_PreviewMouseMove" VerticalAlignment="Top"/>
302
-                <Slider x:Name="timelineSlider" Minimum="0" VerticalAlignment="Top"  PreviewMouseLeftButtonDown="timelineMDown"  PreviewMouseLeftButtonUp="timelineMUp" BorderThickness="0,5,0,0" Margin="12,5,7,0" />
104
+            <Grid
105
+                Name="ControlProgress"
106
+                Grid.Column="1"
107
+                Height="54">
108
+                <local:UC_MultiRangeSlider
109
+                    x:Name="UcSlider"
110
+                    Margin="0,18,5,0"
111
+                    VerticalAlignment="Top"
112
+                    Maximum="1000"
113
+                    Minimum="0"
114
+                    PreviewMouseLeftButtonDown="UcSlider_PreviewMouseLeftButtonDown"
115
+                    PreviewMouseLeftButtonUp="UcSlider_PreviewMouseLeftButtonUp"
116
+                    PreviewMouseMove="UcSlider_PreviewMouseMove"
117
+                    SilderWidth="1807"
118
+                    SliderTickFrequency="1" />
119
+                <Slider
120
+                    x:Name="TimelineSlider"
121
+                    Margin="12,5,7,0"
122
+                    VerticalAlignment="Top"
123
+                    BorderThickness="0,5,0,0"
124
+                    Minimum="0"
125
+                    PreviewMouseLeftButtonDown="TimelineMDown"
126
+                    PreviewMouseLeftButtonUp="TimelineMUp" />
303 127
             </Grid>
304 128
         </Grid>
305 129
         <!--</StackPanel>-->
306
-        <Grid Name="Movie_Control" Grid.Row="3" Margin="0">
130
+        <Grid
131
+            Name="MovieControl"
132
+            Grid.Row="3"
133
+            Margin="0">
307 134
             <Grid.RowDefinitions>
308
-                <RowDefinition Height="53*"/>
309
-                <RowDefinition Height="100*"/>
135
+                <RowDefinition Height="53*" />
136
+                <RowDefinition Height="100*" />
310 137
             </Grid.RowDefinitions>
311 138
             <Grid.ColumnDefinitions>
312
-                <ColumnDefinition Width="5*"/>
313
-                <ColumnDefinition Width="90*"/>
314
-                <ColumnDefinition Width="1086*"/>
315
-                <ColumnDefinition Width="90*"/>
316
-                <ColumnDefinition Width="5*"/>
139
+                <ColumnDefinition Width="5*" />
140
+                <ColumnDefinition Width="90*" />
141
+                <ColumnDefinition Width="1086*" />
142
+                <ColumnDefinition Width="90*" />
143
+                <ColumnDefinition Width="5*" />
317 144
             </Grid.ColumnDefinitions>
318 145
             <Grid Grid.Row="0" Grid.Column="1">
319
-                <Label x:Name="LblProgress" Content="00:00:00" FontSize="{Binding WordSize18}" VerticalAlignment="Center"/>
146
+                <Label
147
+                    x:Name="LblProgress"
148
+                    VerticalAlignment="Center"
149
+                    Content="00:00:00"
150
+                    FontSize="{Binding WordSize18}" />
320 151
             </Grid>
321 152
             <Grid Grid.Row="0" Grid.Column="2">
322
-                <StackPanel VerticalAlignment="Center" Orientation="Horizontal" Margin="0" HorizontalAlignment="Center">
323
-                    <Label Content="开始时间:" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" FontSize="{Binding WordSize18}"/>
324
-                    <TextBox x:Name="TxbStartTime" HorizontalAlignment="Left" Margin="5,0,0,0" Text="00:00:00.000" VerticalAlignment="Center" Width="130" LostFocus="TxbStartTime_LostFocus" FontSize="{Binding WordSize18}"/>
153
+                <StackPanel
154
+                    Margin="0"
155
+                    HorizontalAlignment="Center"
156
+                    VerticalAlignment="Center"
157
+                    Orientation="Horizontal">
158
+                    <Label
159
+                        Margin="10,0,0,0"
160
+                        HorizontalAlignment="Left"
161
+                        VerticalAlignment="Center"
162
+                        Content="开始时间:"
163
+                        FontSize="{Binding WordSize18}" />
164
+                    <TextBox
165
+                        x:Name="TxbStartTime"
166
+                        Width="130"
167
+                        Margin="5,0,0,0"
168
+                        HorizontalAlignment="Left"
169
+                        VerticalAlignment="Center"
170
+                        FontSize="{Binding WordSize18}"
171
+                        LostFocus="TxbStartTime_LostFocus"
172
+                        Text="00:00:00.000" />
325 173
 
326
-                    <Label Content="结束时间:" HorizontalAlignment="Center" Margin="20,0,0,0" VerticalAlignment="Center" FontSize="{Binding WordSize18}"/>
327
-                    <TextBox x:Name="TxbEndTime" HorizontalAlignment="Center" Margin="5,0,0,0" Text="00:00:00.000" VerticalAlignment="Center" Width="130" LostFocus="TxbEndTime_LostFocus" FontSize="{Binding WordSize18}"/>
174
+                    <Label
175
+                        Margin="20,0,0,0"
176
+                        HorizontalAlignment="Center"
177
+                        VerticalAlignment="Center"
178
+                        Content="结束时间:"
179
+                        FontSize="{Binding WordSize18}" />
180
+                    <TextBox
181
+                        x:Name="TxbEndTime"
182
+                        Width="130"
183
+                        Margin="5,0,0,0"
184
+                        HorizontalAlignment="Center"
185
+                        VerticalAlignment="Center"
186
+                        FontSize="{Binding WordSize18}"
187
+                        LostFocus="TxbEndTime_LostFocus"
188
+                        Text="00:00:00.000" />
328 189
 
329
-                    <Label Content="视频时长:" HorizontalAlignment="Right" Margin="20,0,0,0" VerticalAlignment="Center" FontSize="{Binding WordSize18}"/>
330
-                    <Label x:Name="LblVideoTime" Content="00:00:00.000" HorizontalAlignment="Right" Margin="5,0,10,0" VerticalAlignment="Center" FontSize="{Binding WordSize18}"/>
190
+                    <Label
191
+                        Margin="20,0,0,0"
192
+                        HorizontalAlignment="Right"
193
+                        VerticalAlignment="Center"
194
+                        Content="视频时长:"
195
+                        FontSize="{Binding WordSize18}" />
196
+                    <Label
197
+                        x:Name="LblVideoTime"
198
+                        Margin="5,0,10,0"
199
+                        HorizontalAlignment="Right"
200
+                        VerticalAlignment="Center"
201
+                        Content="00:00:00.000"
202
+                        FontSize="{Binding WordSize18}" />
331 203
                 </StackPanel>
332 204
             </Grid>
333
-            <Grid Grid.Row="0" Grid.Column="3" >
205
+            <Grid Grid.Row="0" Grid.Column="3">
334 206
                 <Grid.ColumnDefinitions>
335
-                    <ColumnDefinition Width="30*"/>
336
-                    <ColumnDefinition Width="120*"/>
207
+                    <ColumnDefinition Width="30*" />
208
+                    <ColumnDefinition Width="120*" />
337 209
                 </Grid.ColumnDefinitions>
338 210
                 <Grid.RowDefinitions>
339
-                    <RowDefinition Height="27*"/>
340
-                    <RowDefinition Height="27*"/>
211
+                    <RowDefinition Height="27*" />
212
+                    <RowDefinition Height="27*" />
341 213
                 </Grid.RowDefinitions>
342
-                    <Image Grid.Column="0" Grid.Row="1" Source="/Images/Clip_Volunme.png" Name="Horn" Margin="0"/>
343
-                    <Slider Grid.Row="1" Grid.Column="1" Name="Volunme" Minimum="0" Maximum="1" Value="{Binding ElementName=QS_Movie,Path=Volume,Mode=TwoWay}" Margin="0" VerticalAlignment="Center" />
344
-                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,10,0">
345
-                </StackPanel>
214
+                <Image
215
+                    Name="Horn"
216
+                    Grid.Row="1"
217
+                    Grid.Column="0"
218
+                    Margin="0"
219
+                    Source="/Images/Clip_Volunme.png" />
220
+                <Slider
221
+                    Name="Volunme"
222
+                    Grid.Row="1"
223
+                    Grid.Column="1"
224
+                    Margin="0"
225
+                    VerticalAlignment="Center"
226
+                    Maximum="1"
227
+                    Minimum="0"
228
+                    Value="{Binding ElementName=QsMovie, Path=Volume, Mode=TwoWay}" />
229
+
346 230
             </Grid>
347 231
             <Grid Grid.Row="1" Grid.Column="2">
348 232
 
349
-                <Button x:Name="BtnClip" Cursor="Hand" Content="  剪  辑  " Foreground="White" FontSize="{Binding WordSize20}" Click="BtnClip_Click"  HorizontalAlignment="Center" VerticalAlignment="Center">
233
+                <Button
234
+                    x:Name="BtnClip"
235
+                    HorizontalAlignment="Center"
236
+                    VerticalAlignment="Center"
237
+                    Click="BtnClip_Click"
238
+                    Content="  剪  辑  "
239
+                    Cursor="Hand"
240
+                    FontSize="{Binding WordSize20}"
241
+                    Foreground="White">
350 242
                     <Button.Template>
351 243
                         <ControlTemplate TargetType="{x:Type Button}">
352
-                            <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="8" Padding="10,5">
353
-                                <Border.Background>#3f6fff</Border.Background>
354
-                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding ContentControl.Content}" />
244
+                            <Border
245
+                                Padding="10,5"
246
+                                BorderBrush="{TemplateBinding Control.BorderBrush}"
247
+                                BorderThickness="1"
248
+                                CornerRadius="8">
249
+                                <Border.Background>#4597FF</Border.Background>
250
+                                <ContentPresenter
251
+                                    HorizontalAlignment="Center"
252
+                                    VerticalAlignment="Center"
253
+                                    Content="{TemplateBinding ContentControl.Content}" />
355 254
                             </Border>
356 255
                         </ControlTemplate>
357 256
                     </Button.Template>

+ 176
- 112
XHWK.WKTool/VideoClipWindow.xaml.cs View File

@@ -1,6 +1,4 @@
1
-using Common.system;
2
-
3
-using System;
1
+using System;
4 2
 using System.Text.RegularExpressions;
5 3
 using System.Windows;
6 4
 using System.Windows.Input;
@@ -11,17 +9,18 @@ namespace XHWK.WKTool
11 9
     using system;
12 10
 
13 11
     /// <summary>
14
-    /// 视频剪辑
15
-    /// VideoClipWindow.xaml 的交互逻辑
12
+    ///     视频剪辑
13
+    ///     VideoClipWindow.xaml 的交互逻辑
16 14
     /// </summary>
17
-    public partial class VideoClipWindow : Window
15
+    public partial class VideoClipWindow
18 16
     {
19 17
         /// <summary>
20
-        /// 视频地址
18
+        ///     视频地址
21 19
         /// </summary>
22
-        string VideoPath;
20
+        string _videoPath;
21
+
23 22
         /// <summary>
24
-        /// 视频剪辑
23
+        ///     视频剪辑
25 24
         /// </summary>
26 25
         public VideoClipWindow()
27 26
         {
@@ -29,24 +28,24 @@ namespace XHWK.WKTool
29 28
             Width = App.W_XHMicroLessonSystemWindow.ActualWidth;
30 29
             Height = App.W_XHMicroLessonSystemWindow.ActualHeight;
31 30
         }
32
-        public bool InitClipVideo(string _videoPath)
31
+
32
+        public bool InitClipVideo(string mVideoPath)
33 33
         {
34
-            if (FileToolsCommon.IsExistFile(_videoPath))
34
+            if (FileToolsCommon.IsExistFile(mVideoPath))
35 35
             {
36
-                VideoPath = _videoPath;
37
-                QS_Movie.Source = new Uri(VideoPath);
38
-
39
-                double Prop = (double)QS_Movie.NaturalVideoHeight / (double)QS_Movie.NaturalVideoWidth;
40
-                double gridWidth = GridMovie.ActualHeight / Prop;
36
+                _videoPath = mVideoPath;
37
+                QsMovie.Source = new Uri(_videoPath);
38
+                double prop = QsMovie.NaturalVideoHeight / (double)QsMovie.NaturalVideoWidth;
39
+                double gridWidth = GridMovie.ActualHeight / prop;
41 40
                 if (gridWidth <= GridMovie.ActualWidth)
42 41
                 {
43
-                    QS_Movie.Width = gridWidth;
44
-                    QS_Movie.Height = GridMovie.ActualHeight;
42
+                    QsMovie.Width = gridWidth;
43
+                    QsMovie.Height = GridMovie.ActualHeight;
45 44
                 }
46 45
                 else
47 46
                 {
48
-                    QS_Movie.Height = GridMovie.ActualWidth * Prop;
49
-                    QS_Movie.Width = GridMovie.ActualWidth;
47
+                    QsMovie.Height = GridMovie.ActualWidth * prop;
48
+                    QsMovie.Width = GridMovie.ActualWidth;
50 49
                 }
51 50
                 DataContext = App.PageContextData;
52 51
             }
@@ -56,19 +55,20 @@ namespace XHWK.WKTool
56 55
             }
57 56
             return true;
58 57
         }
58
+
59 59
         /// <summary>
60
-        /// 计时器
60
+        ///     计时器
61 61
         /// </summary>
62
-        DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); // 定义一个DT
62
+        DispatcherTimer _dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); // 定义一个DT
63 63
 
64 64
         /// <summary>
65
-        /// 播放/暂停
65
+        ///     播放/暂停
66 66
         /// </summary>
67 67
         /// <param name="sender"></param>
68 68
         /// <param name="e"></param>
69 69
         private void Play_Click(object sender, RoutedEventArgs e)
70 70
         {
71
-            if (IsPlay)
71
+            if (_isPlay)
72 72
             {
73 73
                 MoviePause();
74 74
             }
@@ -77,85 +77,93 @@ namespace XHWK.WKTool
77 77
                 MoviePlay();
78 78
             }
79 79
         }
80
+
80 81
         /// <summary>
81
-        /// 正在播放
82
+        ///     正在播放
82 83
         /// </summary>
83
-        bool IsPlay = false;
84
+        bool _isPlay;
85
+
84 86
         /// <summary>
85
-        /// 播放
87
+        ///     播放
86 88
         /// </summary>
87 89
         public void MoviePlay()
88 90
         {
89
-            IsPlay = true;
91
+            _isPlay = true;
90 92
             ImgPlay.Visibility = Visibility.Collapsed;
91 93
             ImgPause.Visibility = Visibility.Visible;
92
-            QS_Movie.Play();
94
+            QsMovie.Play();
93 95
         }
96
+
94 97
         /// <summary>
95
-        /// 暂停
98
+        ///     暂停
96 99
         /// </summary>
97 100
         public void MoviePause()
98 101
         {
99
-            IsPlay = false;
102
+            _isPlay = false;
100 103
             ImgPlay.Visibility = Visibility.Visible;
101 104
             ImgPause.Visibility = Visibility.Collapsed;
102
-            QS_Movie.Pause();
103
-        }
104
-        /// <summary>
105
-        /// 暂停
106
-        /// </summary>
107
-        /// <param name="sender"></param>
108
-        /// <param name="e"></param>
109
-        private void Pause_Click(object sender, RoutedEventArgs e)
110
-        {
111
-            MoviePause();
105
+            QsMovie.Pause();
112 106
         }
107
+
113 108
         /// <summary>
114
-        /// slider滑动值随播放内容位置变化
109
+        ///     slider滑动值随播放内容位置变化
115 110
         /// </summary>
116 111
         /// <param name="sender"></param>
117 112
         /// <param name="e"></param>
118 113
         private void dispatcherTimer_Tick(object sender, EventArgs e)
119 114
         {
120
-            timelineSlider.Value = QS_Movie.Position.TotalMilliseconds; //slider滑动值随播放内容位置变化
121
-            LblProgress.Content = new TimeSpan(0, 0, 0, 0, (int)QS_Movie.Position.TotalMilliseconds).ToString(@"hh\:mm\:ss");
115
+            TimelineSlider.Value = QsMovie.Position.TotalMilliseconds; //slider滑动值随播放内容位置变化
116
+            LblProgress.Content = new TimeSpan(
117
+                0,
118
+                0,
119
+                0,
120
+                0,
121
+                (int)QsMovie.Position.TotalMilliseconds
122
+            ).ToString(@"hh\:mm\:ss");
122 123
         }
124
+
123 125
         /// <summary>
124
-        /// 拖动进度条
126
+        ///     拖动进度条
125 127
         /// </summary>
126 128
         /// <param name="sender"></param>
127 129
         /// <param name="e"></param>
128
-        private void timelineMDown(object sender, EventArgs e)
130
+        private void TimelineMDown(object sender, EventArgs e)
129 131
         {
130
-            dispatcherTimer.Stop();
132
+            _dispatcherTimer.Stop();
131 133
         }
134
+
132 135
         /// <summary>
133
-        /// 拖动进度条
136
+        ///     拖动进度条
134 137
         /// </summary>
135 138
         /// <param name="sender"></param>
136 139
         /// <param name="e"></param>
137
-        private void timelineMUp(object sender, EventArgs e)
140
+        private void TimelineMUp(object sender, EventArgs e)
138 141
         {
139
-            QS_Movie.Position = new TimeSpan(0, 0, 0, 0, (int)timelineSlider.Value);
140
-            dispatcherTimer.Start();
142
+            QsMovie.Position = new TimeSpan(
143
+                0,
144
+                0,
145
+                0,
146
+                0,
147
+                (int)TimelineSlider.Value
148
+            );
149
+            _dispatcherTimer.Start();
141 150
             MoviePlay();
142 151
         }
143 152
 
144 153
         /// <summary>
145
-        /// 加载视频
154
+        ///     加载视频
146 155
         /// </summary>
147 156
         /// <param name="sender"></param>
148 157
         /// <param name="e"></param>
149 158
         private void QS_Movie_Loaded(object sender, RoutedEventArgs e)
150 159
         {
151 160
             //GridMovie.Height
152
-            UcSlider.SilderWidth = (int)timelineSlider.ActualWidth;
161
+            UcSlider.SilderWidth = (int)TimelineSlider.ActualWidth;
153 162
             MoviePlay();
154
-            while (QS_Movie.NaturalVideoWidth == 0)
163
+            while (QsMovie.NaturalVideoWidth == 0)
155 164
             {
156 165
                 System.Threading.Thread.Sleep(50);
157 166
             }
158
-
159 167
             MoviePause();
160 168
 
161 169
             //new Thread(new ThreadStart(new Action(() =>
@@ -165,38 +173,47 @@ namespace XHWK.WKTool
165 173
             //});
166 174
             //}))).Start();
167 175
         }
176
+
168 177
         /// <summary>
169
-        /// 关闭
178
+        ///     关闭
170 179
         /// </summary>
171 180
         /// <param name="sender"></param>
172 181
         /// <param name="e"></param>
173 182
         private void Button_Click(object sender, RoutedEventArgs e)
174 183
         {
175 184
             //this.Close();
176
-            QS_Movie.Stop();
177
-            IsPlay = false;
185
+            QsMovie.Stop();
186
+            _isPlay = false;
178 187
             ImgPlay.Visibility = Visibility.Visible;
179 188
             ImgPause.Visibility = Visibility.Collapsed;
180 189
             UcSlider.StartValue = 0;
181
-            timelineSlider.Value = 0;
182
-            dispatcherTimer.Stop();
183
-            this.Hide();
190
+            TimelineSlider.Value = 0;
191
+            _dispatcherTimer.Stop();
192
+            Hide();
184 193
         }
185
-        double statime = 0;
194
+
195
+        double _statime;
196
+
186 197
         private void UcSlider_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
187 198
         {
188 199
             //dispatcherTimer.Stop();
189
-            statime = UcSlider.StartValue;
200
+            _statime = UcSlider.StartValue;
190 201
         }
191 202
 
192 203
         private void UcSlider_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
193 204
         {
194
-            if (Math.Abs(UcSlider.StartValue - statime) > 100)
205
+            if (Math.Abs(UcSlider.StartValue - _statime) > 100)
195 206
             {
196
-                dispatcherTimer.Stop();
197
-                timelineSlider.Value = UcSlider.StartValue;
198
-                QS_Movie.Position = new TimeSpan(0, 0, 0, 0, (int)timelineSlider.Value);
199
-                dispatcherTimer.Start();
207
+                _dispatcherTimer.Stop();
208
+                TimelineSlider.Value = UcSlider.StartValue;
209
+                QsMovie.Position = new TimeSpan(
210
+                    0,
211
+                    0,
212
+                    0,
213
+                    0,
214
+                    (int)TimelineSlider.Value
215
+                );
216
+                _dispatcherTimer.Start();
200 217
                 UcSlider_PreviewMouseMove(null, null);
201 218
                 MoviePlay();
202 219
             }
@@ -204,17 +221,34 @@ namespace XHWK.WKTool
204 221
 
205 222
         private void UcSlider_PreviewMouseMove(object sender, MouseEventArgs e)
206 223
         {
207
-            TxbStartTime.Text = new TimeSpan(0, 0, 0, 0, (int)UcSlider.StartValue).ToString(@"hh\:mm\:ss\.fff");
208
-            TxbEndTime.Text = new TimeSpan(0, 0, 0, 0, (int)UcSlider.EndValue).ToString(@"hh\:mm\:ss\.fff");
209
-            LblVideoTime.Content = new TimeSpan(0, 0, 0, 0, ((int)UcSlider.EndValue - (int)UcSlider.StartValue)).ToString(@"hh\:mm\:ss\.fff");
224
+            TxbStartTime.Text = new TimeSpan(
225
+                0,
226
+                0,
227
+                0,
228
+                0,
229
+                (int)UcSlider.StartValue
230
+            ).ToString(@"hh\:mm\:ss\.fff");
231
+            TxbEndTime.Text = new TimeSpan(
232
+                0,
233
+                0,
234
+                0,
235
+                0,
236
+                (int)UcSlider.EndValue
237
+            ).ToString(@"hh\:mm\:ss\.fff");
238
+            LblVideoTime.Content = new TimeSpan(
239
+                0,
240
+                0,
241
+                0,
242
+                0,
243
+                ((int)UcSlider.EndValue - (int)UcSlider.StartValue)
244
+            ).ToString(@"hh\:mm\:ss\.fff");
210 245
             //LblStartTime.Content = new TimeSpan(0, 0, 0, 0, (int)UcSlider.StartValue).ToString(@"hh\:mm\:ss");
211 246
             //LblEndTime.Content = new TimeSpan(0, 0, 0, 0, (int)UcSlider.EndValue).ToString(@"hh\:mm\:ss");
212 247
             //LblVideoTime.Content = new TimeSpan(0, 0, 0, 0, ((int)(UcSlider.EndValue - (UcSlider.EndValue % 1000)) - (int)(UcSlider.StartValue - (UcSlider.StartValue % 1000)))).ToString(@"hh\:mm\:ss");
213
-
214 248
         }
215 249
 
216 250
         /// <summary>
217
-        /// 剪辑
251
+        ///     剪辑
218 252
         /// </summary>
219 253
         /// <param name="sender"></param>
220 254
         /// <param name="e"></param>
@@ -225,32 +259,47 @@ namespace XHWK.WKTool
225 259
                 MessageWindow.Show("剪辑时间不得小于1秒!");
226 260
                 return;
227 261
             }
228
-            dispatcherTimer.Stop();
262
+            _dispatcherTimer.Stop();
229 263
             MoviePause();
230
-            string Extension = FileToolsCommon.GetIoExtension(VideoPath);
231
-            string FileName = FileToolsCommon.GetIoFileNameNoExtension(VideoPath);
264
+            string extension = FileToolsCommon.GetIoExtension(_videoPath);
265
+            string fileName = FileToolsCommon.GetIoFileNameNoExtension(_videoPath);
232 266
             System.Windows.Forms.SaveFileDialog saveDg = new System.Windows.Forms.SaveFileDialog();
233
-            saveDg.Filter = "(*" + Extension + ")|*" + Extension;// + "|(*.MP4)|*.MP4";
267
+            saveDg.Filter = @"(*" + extension + @")|*" + extension; // + "|(*.MP4)|*.MP4";
234 268
             //saveDg.FileName = tableName + DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss") + "";
235
-            saveDg.FileName = FileName + "剪辑";
269
+            saveDg.FileName = fileName + "剪辑";
236 270
             saveDg.AddExtension = true;
237 271
             saveDg.RestoreDirectory = true;
238 272
             if (saveDg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
239 273
             {
240 274
                 string filePath = saveDg.FileName;
241 275
                 //duration.ToString(@"dd\.hh\:mm\:ss");
242
-                TimeSpan startTP = new TimeSpan(0, 0, 0, 0, (int)UcSlider.StartValue);
243
-                string startTime = startTP.ToString(@"hh\:mm\:ss\.fff");
244
-                TimeSpan EndTP = new TimeSpan(0, 0, 0, 0, (int)UcSlider.EndValue);
245
-                string EndTime = EndTP.ToString(@"hh\:mm\:ss\.fff");
246
-                App.FFmpeg.ClipVideo
247
-                (
248
-                    VideoPath,
276
+                TimeSpan startTp = new TimeSpan(
277
+                    0,
278
+                    0,
279
+                    0,
280
+                    0,
281
+                    (int)UcSlider.StartValue
282
+                );
283
+                string startTime = startTp.ToString(@"hh\:mm\:ss\.fff");
284
+                TimeSpan endTp = new TimeSpan(
285
+                    0,
286
+                    0,
287
+                    0,
288
+                    0,
289
+                    (int)UcSlider.EndValue
290
+                );
291
+                string endTime = endTp.ToString(@"hh\:mm\:ss\.fff");
292
+                App.FFmpeg.ClipVideo(
293
+                    _videoPath,
249 294
                     startTime,
250
-                    EndTime,
295
+                    endTime,
251 296
                     filePath
252 297
                 );
253
-                MessageBoxResult br = MessageWindow.Show("剪辑完成是否打开文件夹?", "剪辑", MessageBoxButton.OKCancel);
298
+                MessageBoxResult br = MessageWindow.Show(
299
+                    "剪辑完成是否打开文件夹?",
300
+                    "剪辑",
301
+                    MessageBoxButton.OKCancel
302
+                );
254 303
                 if (br == MessageBoxResult.OK)
255 304
                 {
256 305
                     //System.Diagnostics.Process.Start(FileToolsCommon.GetDirectoryName(filePath));
@@ -260,7 +309,7 @@ namespace XHWK.WKTool
260 309
         }
261 310
 
262 311
         /// <summary>
263
-        /// 输入开始时间
312
+        ///     输入开始时间
264 313
         /// </summary>
265 314
         /// <param name="sender"></param>
266 315
         /// <param name="e"></param>
@@ -278,17 +327,17 @@ namespace XHWK.WKTool
278 327
                 MessageWindow.Show("开始时间不能大于结束时间!");
279 328
                 return;
280 329
             }
281
-            if (time.TotalMilliseconds > QS_Movie.NaturalDuration.TimeSpan.TotalMilliseconds - 1000 || time.TotalMilliseconds > UcSlider.EndValue - 1000)
330
+            if (time.TotalMilliseconds > QsMovie.NaturalDuration.TimeSpan.TotalMilliseconds - 1000 || time.TotalMilliseconds > UcSlider.EndValue - 1000)
282 331
             {
283 332
                 MessageWindow.Show("剪辑时间不能小于1秒!");
284 333
                 return;
285 334
             }
286 335
             UcSlider.StartValue = time.TotalMilliseconds;
287
-
288 336
             UcSlider_PreviewMouseLeftButtonUp(null, null);
289 337
         }
338
+
290 339
         /// <summary>
291
-        /// 输入结束时间
340
+        ///     输入结束时间
292 341
         /// </summary>
293 342
         /// <param name="sender"></param>
294 343
         /// <param name="e"></param>
@@ -311,17 +360,17 @@ namespace XHWK.WKTool
311 360
                 MessageWindow.Show("剪辑时间不能小于1秒!");
312 361
                 return;
313 362
             }
314
-            if (time.TotalMilliseconds > QS_Movie.NaturalDuration.TimeSpan.TotalMilliseconds)
363
+            if (time.TotalMilliseconds > QsMovie.NaturalDuration.TimeSpan.TotalMilliseconds)
315 364
             {
316 365
                 MessageWindow.Show("结束时间不能超出视频总时长!");
317 366
                 return;
318 367
             }
319 368
             UcSlider.EndValue = time.TotalMilliseconds;
320
-
321 369
             UcSlider_PreviewMouseLeftButtonUp(null, null);
322 370
         }
371
+
323 372
         /// <summary>
324
-        /// string转TimeSpan
373
+        ///     string转TimeSpan
325 374
         /// </summary>
326 375
         /// <param name="str"></param>
327 376
         /// <returns></returns>
@@ -360,12 +409,19 @@ namespace XHWK.WKTool
360 409
             }
361 410
             catch (Exception)
362 411
             {
412
+                // ignored
363 413
             }
364
-            return new TimeSpan(day, hour, min, sec, mil);
414
+            return new TimeSpan(
415
+                day,
416
+                hour,
417
+                min,
418
+                sec,
419
+                mil
420
+            );
365 421
         }
366 422
 
367 423
         /// <summary>
368
-        /// 判断是否为时间格式
424
+        ///     判断是否为时间格式
369 425
         /// </summary>
370 426
         /// <param name="str"></param>
371 427
         /// <returns></returns>
@@ -381,8 +437,9 @@ namespace XHWK.WKTool
381 437
                 return false;
382 438
             }
383 439
         }
440
+
384 441
         /// <summary>
385
-        /// 鼠标点击移动
442
+        ///     鼠标点击移动
386 443
         /// </summary>
387 444
         /// <param name="sender"></param>
388 445
         /// <param name="e"></param>
@@ -392,36 +449,43 @@ namespace XHWK.WKTool
392 449
         }
393 450
 
394 451
         /// <summary>
395
-        /// 启动定时器 同步进度条和视频进度
452
+        ///     启动定时器 同步进度条和视频进度
396 453
         /// </summary>
397 454
         /// <param name="sender"></param>
398 455
         /// <param name="e"></param>
399 456
         private void Element_MediaOpened(object sender, RoutedEventArgs e)
400 457
         {
401
-            timelineSlider.Maximum = QS_Movie.NaturalDuration.TimeSpan.TotalMilliseconds;  //设置slider最大值
402
-            UcSlider.Maximum = QS_Movie.NaturalDuration.TimeSpan.TotalMilliseconds;
458
+            TimelineSlider.Maximum = QsMovie.NaturalDuration.TimeSpan.TotalMilliseconds; //设置slider最大值
459
+            UcSlider.Maximum = QsMovie.NaturalDuration.TimeSpan.TotalMilliseconds;
403 460
             UcSlider.StartValue = 0;
404
-            UcSlider.EndValue = QS_Movie.NaturalDuration.TimeSpan.TotalMilliseconds;
461
+            UcSlider.EndValue = QsMovie.NaturalDuration.TimeSpan.TotalMilliseconds;
405 462
             UcSlider_PreviewMouseMove(null, null);
406
-            int sec = (int)QS_Movie.NaturalDuration.TimeSpan.TotalSeconds;
407
-            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); //超过计时间隔时发生
408
-            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 500); //DT间隔
409
-            dispatcherTimer.Start(); //DT启动 
463
+            _dispatcherTimer.Tick += dispatcherTimer_Tick; //超过计时间隔时发生
464
+            _dispatcherTimer.Interval = new TimeSpan(
465
+                0,
466
+                0,
467
+                0,
468
+                0,
469
+                500
470
+            ); //DT间隔
471
+            _dispatcherTimer.Start(); //DT启动 
410 472
 
411 473
             #region 调整视频大小
412
-            double Prop = (double)QS_Movie.NaturalVideoHeight / (double)QS_Movie.NaturalVideoWidth;
413
-            double gridWidth = GridMovie.ActualHeight / Prop;
474
+
475
+            double prop = QsMovie.NaturalVideoHeight / (double)QsMovie.NaturalVideoWidth;
476
+            double gridWidth = GridMovie.ActualHeight / prop;
414 477
             if (gridWidth <= GridMovie.ActualWidth)
415 478
             {
416
-                QS_Movie.Width = gridWidth;
417
-                QS_Movie.Height = GridMovie.ActualHeight;
479
+                QsMovie.Width = gridWidth;
480
+                QsMovie.Height = GridMovie.ActualHeight;
418 481
             }
419 482
             else
420 483
             {
421
-                QS_Movie.Height = GridMovie.ActualWidth * Prop;
422
-                QS_Movie.Width = GridMovie.ActualWidth;
484
+                QsMovie.Height = GridMovie.ActualWidth * prop;
485
+                QsMovie.Width = GridMovie.ActualWidth;
423 486
             }
487
+
424 488
             #endregion
425 489
         }
426 490
     }
427
-}
491
+}

+ 58
- 43
XHWK.WKTool/View/UControl/UC_MultiRangeSlider.xaml View File

@@ -1,59 +1,74 @@
1
-<UserControl x:Class="XHWK.WKTool.UC_MultiRangeSlider"
2
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
5
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
6
-             xmlns:local="clr-namespace:XHWK.WKTool.UControl"
7
-             mc:Ignorable="d" Name="UC_Arrange" Loaded="UC_Arrange_Loaded">
8
-    <StackPanel Orientation="Horizontal" Height="{Binding ElementName=UC_Arrange,Path=SilderHeight}" >
9
-        <TextBox Text="{Binding  ElementName=SL_Bat1,Path=Value,Mode=TwoWay}"
10
-                 KeyUp="TextBox_KeyUp1" Visibility="Hidden"
11
-                 Width="10"
12
-                 Margin="0,3" BorderBrush="CornflowerBlue" HorizontalAlignment="Left" VerticalAlignment="Center" />
13
-        <Canvas Width="{Binding ElementName=UC_Arrange,Path=SilderWidth}" Margin="0">
14
-            <Slider Name="SL_Bat1"
15
-                Value="{Binding ElementName=UC_Arrange,Path=StartValue}"
16
-                Minimum="{Binding ElementName=UC_Arrange,Path=Minimum}"
17
-                Maximum="{Binding ElementName=UC_Arrange,Path=Maximum}"
18
-                SelectionStart="{Binding ElementName=UC_Arrange,Path=StartValue}"
19
-                SelectionEnd="{Binding ElementName=UC_Arrange,Path=EndValue}"
20
-                Width="{Binding ElementName=UC_Arrange,Path=SilderWidth}"
21
-                TickFrequency="{Binding ElementName=UC_Arrange,Path=SliderTickFrequency}"
1
+<UserControl
2
+    x:Class="XHWK.WKTool.UC_MultiRangeSlider"
3
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6
+    xmlns:local="clr-namespace:XHWK.WKTool.UControl"
7
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8
+    Name="UC_Arrange"
9
+    Loaded="UC_Arrange_Loaded"
10
+    mc:Ignorable="d">
11
+    <StackPanel Height="{Binding ElementName=UC_Arrange, Path=SilderHeight}" Orientation="Horizontal">
12
+        <TextBox
13
+            Width="10"
14
+            Margin="0,3"
15
+            HorizontalAlignment="Left"
16
+            VerticalAlignment="Center"
17
+            BorderBrush="CornflowerBlue"
18
+            KeyUp="TextBox_KeyUp1"
19
+            Text="{Binding ElementName=SL_Bat1, Path=Value, Mode=TwoWay}"
20
+            Visibility="Hidden" />
21
+        <Canvas Width="{Binding ElementName=UC_Arrange, Path=SilderWidth}" Margin="0">
22
+            <Slider
23
+                Name="SL_Bat1"
24
+                Width="{Binding ElementName=UC_Arrange, Path=SilderWidth}"
25
+                Margin="2"
26
+                VerticalAlignment="Center"
22 27
                 FocusVisualStyle="{x:Null}"
23 28
                 IsSelectionRangeEnabled="True"
24
-                TickPlacement="TopLeft"
25 29
                 IsSnapToTickEnabled="True"
26
-                VerticalAlignment="Center"
27
-                Margin="2"
28
-                ValueChanged="SL_Bat1_ValueChanged">
30
+                Maximum="{Binding ElementName=UC_Arrange, Path=Maximum}"
31
+                Minimum="{Binding ElementName=UC_Arrange, Path=Minimum}"
32
+                SelectionEnd="{Binding ElementName=UC_Arrange, Path=EndValue}"
33
+                SelectionStart="{Binding ElementName=UC_Arrange, Path=StartValue}"
34
+                TickFrequency="{Binding ElementName=UC_Arrange, Path=SliderTickFrequency}"
35
+                TickPlacement="TopLeft"
36
+                ValueChanged="SL_Bat1_ValueChanged"
37
+                Value="{Binding ElementName=UC_Arrange, Path=StartValue}">
29 38
                 <Slider.Clip>
30
-                    <RectangleGeometry Rect="{Binding ElementName=UC_Arrange,Path=StartRect}" />
39
+                    <RectangleGeometry Rect="{Binding ElementName=UC_Arrange, Path=StartRect}" />
31 40
                 </Slider.Clip>
32 41
             </Slider>
33
-            <Slider Name="SL_Bat2"
34
-                Value="{Binding ElementName=UC_Arrange,Path=EndValue}"
35
-                Minimum="{Binding ElementName=UC_Arrange,Path=Minimum}"
36
-                Maximum="{Binding ElementName=UC_Arrange,Path=Maximum}"
37
-                SelectionStart="{Binding ElementName=UC_Arrange,Path=StartValue}"
38
-                SelectionEnd="{Binding ElementName=UC_Arrange,Path=EndValue}"
39
-                Width="{Binding ElementName=UC_Arrange,Path=SilderWidth}"
40
-                TickFrequency="{Binding ElementName=UC_Arrange,Path=SliderTickFrequency}"
42
+            <Slider
43
+                Name="SL_Bat2"
44
+                Width="{Binding ElementName=UC_Arrange, Path=SilderWidth}"
45
+                Margin="2"
46
+                VerticalAlignment="Center"
41 47
                 FocusVisualStyle="{x:Null}"
42 48
                 IsSelectionRangeEnabled="True"
43
-                TickPlacement="TopLeft"
44 49
                 IsSnapToTickEnabled="True"
45
-                VerticalAlignment="Center"
46
-                Margin="2"
47
-                ValueChanged="SL_Bat2_ValueChanged">
50
+                Maximum="{Binding ElementName=UC_Arrange, Path=Maximum}"
51
+                Minimum="{Binding ElementName=UC_Arrange, Path=Minimum}"
52
+                SelectionEnd="{Binding ElementName=UC_Arrange, Path=EndValue}"
53
+                SelectionStart="{Binding ElementName=UC_Arrange, Path=StartValue}"
54
+                TickFrequency="{Binding ElementName=UC_Arrange, Path=SliderTickFrequency}"
55
+                TickPlacement="TopLeft"
56
+                ValueChanged="SL_Bat2_ValueChanged"
57
+                Value="{Binding ElementName=UC_Arrange, Path=EndValue}">
48 58
                 <Slider.Clip>
49
-                    <RectangleGeometry Rect="{Binding ElementName=UC_Arrange,Path=EndRect}" />
59
+                    <RectangleGeometry Rect="{Binding ElementName=UC_Arrange, Path=EndRect}" />
50 60
                 </Slider.Clip>
51 61
             </Slider>
52 62
         </Canvas>
53
-        <TextBox   KeyUp="TextBox_KeyUp2" Visibility="Hidden"
54
-                  Text="{Binding  ElementName=SL_Bat2,Path=Value,Mode=TwoWay}"
55
-                 Width="10" Margin="0,3"
56
-                 BorderBrush="CornflowerBlue" HorizontalAlignment="Right" VerticalAlignment="Center"/>
63
+        <TextBox
64
+            Width="10"
65
+            Margin="0,3"
66
+            HorizontalAlignment="Right"
67
+            VerticalAlignment="Center"
68
+            BorderBrush="CornflowerBlue"
69
+            KeyUp="TextBox_KeyUp2"
70
+            Text="{Binding ElementName=SL_Bat2, Path=Value, Mode=TwoWay}"
71
+            Visibility="Hidden" />
57 72
     </StackPanel>
58 73
 
59 74
 </UserControl>

+ 2
- 2
XHWK.WKTool/View/UControl/Uc_VideoItem.xaml View File

@@ -91,7 +91,7 @@
91 91
                         x:Name="TbName"
92 92
                         VerticalAlignment="Center"
93 93
                         FontSize="{Binding WordSize18}"
94
-                        Foreground="#3f6fff"
94
+                        Foreground="#4597FF"
95 95
                         MouseLeftButtonDown="TextBlock_MouseLeftButtonDown"
96 96
                         Text="一二三四五六七八九十一..."
97 97
                         TextAlignment="Center"
@@ -165,7 +165,7 @@
165 165
                                 Height="30"
166 166
                                 HorizontalAlignment="Stretch"
167 167
                                 VerticalAlignment="Stretch"
168
-                                Background="#3f6fff"
168
+                                Background="#4597FF"
169 169
                                 Click="BtnUpload_Click"
170 170
                                 Content="上传"
171 171
                                 Cursor="Hand"

+ 0
- 1
XHWK.WKTool/Welcome.xaml View File

@@ -3,7 +3,6 @@
3 3
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4 4
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5 5
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6
-    xmlns:local="clr-namespace:XHWK.WKTool"
7 6
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8 7
     Title="Welcome"
9 8
     Width="100"

+ 3
- 4
XHWK.WKTool/Welcome.xaml.cs View File

@@ -1,12 +1,11 @@
1 1
 using System.IO;
2
-using System.Windows;
3 2
 
4 3
 namespace XHWK.WKTool
5 4
 {
6 5
     /// <summary>
7
-    /// Welcome.xaml 的交互逻辑
6
+    ///     Welcome.xaml 的交互逻辑
8 7
     /// </summary>
9
-    public partial class Welcome : Window
8
+    public partial class Welcome
10 9
     {
11 10
         public Welcome()
12 11
         {
@@ -26,4 +25,4 @@ namespace XHWK.WKTool
26 25
             }
27 26
         }
28 27
     }
29
-}
28
+}

+ 4
- 4
XHWK.WKTool/XHWK.WKTool.csproj View File

@@ -214,7 +214,7 @@
214 214
     </Reference>
215 215
   </ItemGroup>
216 216
   <ItemGroup>
217
-    <Compile Include="AESHelper.cs" />
217
+    <Compile Include="Utils\AESHelper.cs" />
218 218
     <Compile Include="App.xaml.cs">
219 219
       <DependentUpon>App.xaml</DependentUpon>
220 220
     </Compile>
@@ -362,8 +362,8 @@
362 362
     <Compile Include="MainWindow.xaml.cs">
363 363
       <DependentUpon>MainWindow.xaml</DependentUpon>
364 364
     </Compile>
365
-    <Compile Include="CreateAMicroLessonWindow.xaml.cs">
366
-      <DependentUpon>CreateAMicroLessonWindow.xaml</DependentUpon>
365
+    <Compile Include="CreateWin.xaml.cs">
366
+      <DependentUpon>CreateWin.xaml</DependentUpon>
367 367
       <SubType>Code</SubType>
368 368
     </Compile>
369 369
     <ApplicationDefinition Include="App.xaml">
@@ -378,7 +378,7 @@
378 378
       <SubType>Designer</SubType>
379 379
       <Generator>MSBuild:Compile</Generator>
380 380
     </Page>
381
-    <Page Include="CreateAMicroLessonWindow.xaml">
381
+    <Page Include="CreateWin.xaml">
382 382
       <Generator>MSBuild:Compile</Generator>
383 383
       <SubType>Designer</SubType>
384 384
     </Page>

Loading…
Cancel
Save