Browse Source

代码优化

master
张剑 1 year 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
   </startup>
5
   </startup>
6
   <appSettings>
6
   <appSettings>
7
     <!--0正式 1测试-->
7
     <!--0正式 1测试-->
8
-    <add key="IsDebug" value="0" />
8
+    <add key="IsDebug" value="1" />
9
     <!--版本号-->
9
     <!--版本号-->
10
     <add key="VersionCode" value="133" />
10
     <add key="VersionCode" value="133" />
11
     <add key="VersionName" value="3.13.6" />
11
     <add key="VersionName" value="3.13.6" />

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1
-
2
-using ComeCapture.Controls;
1
+using ComeCapture.Controls;
3
 using ComeCapture.Helpers;
2
 using ComeCapture.Helpers;
4
 using ComeCapture.Models;
3
 using ComeCapture.Models;
5
 
4
 
6
 using Common.system;
5
 using Common.system;
7
 
6
 
8
-
9
 using System;
7
 using System;
10
 using System.Collections.Generic;
8
 using System.Collections.Generic;
11
 using System.Drawing;
9
 using System.Drawing;
24
 namespace ComeCapture
22
 namespace ComeCapture
25
 {
23
 {
26
     /// <summary>
24
     /// <summary>
27
-    /// 截图 MainWindow.xaml 的交互逻辑
25
+    ///     截图 MainWindow.xaml 的交互逻辑
28
     /// </summary>
26
     /// </summary>
29
-    public partial class JieTuWindow : Window
27
+    public partial class JieTuWindow
30
     {
28
     {
31
         public static double ScreenWidth = SystemParameters.PrimaryScreenWidth;
29
         public static double ScreenWidth = SystemParameters.PrimaryScreenWidth;
32
         public static double ScreenHeight = SystemParameters.PrimaryScreenHeight;
30
         public static double ScreenHeight = SystemParameters.PrimaryScreenHeight;
43
         public int num = 1;
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
         /// <summary>
52
         /// <summary>
54
-        /// 键盘钩子
53
+        ///     键盘钩子
55
         /// </summary>
54
         /// </summary>
56
-        private KeyboardHookCommon k_hook;
55
+        private readonly KeyboardHookCommon _kHook;
56
+
57
         //private IntPtr BitmapPtr = IntPtr.Zero;
57
         //private IntPtr BitmapPtr = IntPtr.Zero;
58
         //private IntPtr JieTuBitmapPtr = IntPtr.Zero;
58
         //private IntPtr JieTuBitmapPtr = IntPtr.Zero;
59
         /// <summary>
59
         /// <summary>
60
-        /// 截图
60
+        ///     截图
61
         /// </summary>
61
         /// </summary>
62
         public JieTuWindow()
62
         public JieTuWindow()
63
         {
63
         {
64
-            _Current = this;
64
+            _current = this;
65
             InitializeComponent();
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
             DataContext = new AppModel();
68
             DataContext = new AppModel();
69
-            initialization();
69
+            Initialization();
70
             Screenshot();
70
             Screenshot();
71
             MaxWindow();
71
             MaxWindow();
72
             MaskLeft.Height = ScreenHeight;
72
             MaskLeft.Height = ScreenHeight;
79
 
79
 
80
         public void Screenshot()
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
             string tempPath = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
82
             string tempPath = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
87
             if (!Directory.Exists(tempPath))
83
             if (!Directory.Exists(tempPath))
88
             {
84
             {
89
                 Directory.CreateDirectory(tempPath);
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
                 Background = new ImageBrush(bitmap);
99
                 Background = new ImageBrush(bitmap);
95
             }
100
             }
96
         }
101
         }
97
 
102
 
98
-        public void initialization()
103
+        public void Initialization()
99
         {
104
         {
100
             Background = null;
105
             Background = null;
101
-            _IsMouseDown = false;
102
-            _IsCapture = false;
106
+            _isMouseDown = false;
107
+            _isCapture = false;
103
             ImageEditBar.Current.Visibility = Visibility.Collapsed;
108
             ImageEditBar.Current.Visibility = Visibility.Collapsed;
104
             SizeColorBar.Current.Visibility = Visibility.Collapsed;
109
             SizeColorBar.Current.Visibility = Visibility.Collapsed;
105
-            SizeRGB.Visibility = Visibility.Collapsed;
110
+            SizeRgb.Visibility = Visibility.Collapsed;
106
             MainImage.Visibility = Visibility.Collapsed;
111
             MainImage.Visibility = Visibility.Collapsed;
107
             DataContext = new AppModel();
112
             DataContext = new AppModel();
108
             WpfHelper.MainDispatcher = Dispatcher;
113
             WpfHelper.MainDispatcher = Dispatcher;
109
         }
114
         }
115
+
110
         /// <summary>
116
         /// <summary>
111
-        /// 初始化快捷键
117
+        ///     初始化快捷键
112
         /// </summary>
118
         /// </summary>
113
         public void InitializeKeyDownEvent()
119
         public void InitializeKeyDownEvent()
114
         {
120
         {
115
-
116
-            k_hook.Start();//安装键盘钩子
121
+            _kHook.Start(); //安装键盘钩子
117
         }
122
         }
123
+
118
         /// <summary>
124
         /// <summary>
119
-        /// 快捷键
125
+        ///     快捷键
120
         /// </summary>
126
         /// </summary>
121
         /// <param name="sender"></param>
127
         /// <param name="sender"></param>
122
         /// <param name="e"></param>
128
         /// <param name="e"></param>
124
         {
130
         {
125
             if (e.KeyValue == (int)System.Windows.Forms.Keys.Escape)
131
             if (e.KeyValue == (int)System.Windows.Forms.Keys.Escape)
126
             {
132
             {
127
-                k_hook.Stop();
133
+                _kHook.Stop();
128
                 Current.OnCancel();
134
                 Current.OnCancel();
129
                 App.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
135
                 App.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
130
                 App.W_XHMicroLessonSystemWindow.WindowType();
136
                 App.W_XHMicroLessonSystemWindow.WindowType();
134
 
140
 
135
         #region 属性 Current
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
         #endregion 属性 Current
147
         #endregion 属性 Current
142
 
148
 
157
 
163
 
158
         public static void Register(object control)
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
         #endregion 注册画图
172
         #endregion 注册画图
169
 
175
 
170
         public static void AddControl(UIElement e)
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
         #endregion 截图区域添加画图
181
         #endregion 截图区域添加画图
178
 
184
 
179
         public static void RemoveControl(UIElement e)
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
         #endregion 截图区域撤回画图
190
         #endregion 截图区域撤回画图
251
 
257
 
252
         #region 获取截图
258
         #region 获取截图
253
 
259
 
254
-
255
         private void GetCapture()
260
         private void GetCapture()
256
         {
261
         {
257
-
258
             string time = GetTimeStamp();
262
             string time = GetTimeStamp();
259
             string tempPath = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
263
             string tempPath = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
260
             if (!Directory.Exists(tempPath))
264
             if (!Directory.Exists(tempPath))
270
 
274
 
271
             //BitmapSource bitmap = ImageHelper.GetBitmapSource((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2, out JieTuBitmapPtr);
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
             /* BitmapImage bitmap = */
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
             ImageEditBar.Current.Visibility = Visibility.Collapsed;
290
             ImageEditBar.Current.Visibility = Visibility.Collapsed;
277
             SizeColorBar.Current.Visibility = Visibility.Collapsed;
291
             SizeColorBar.Current.Visibility = Visibility.Collapsed;
278
-            SizeRGB.Visibility = Visibility.Collapsed;
292
+            SizeRgb.Visibility = Visibility.Collapsed;
279
             MainImage.Visibility = Visibility.Collapsed;
293
             MainImage.Visibility = Visibility.Collapsed;
280
             DataContext = new AppModel();
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
             WpfHelper.MainDispatcher = Dispatcher;
295
             WpfHelper.MainDispatcher = Dispatcher;
284
             MaxWindow();
296
             MaxWindow();
285
             MaskLeft.Height = ScreenHeight;
297
             MaskLeft.Height = ScreenHeight;
286
             MaskRight.Height = ScreenHeight;
298
             MaskRight.Height = ScreenHeight;
287
             //计算Windows项目缩放比例
299
             //计算Windows项目缩放比例
288
             ScreenHelper.ResetScreenScale();
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
             Owner = null;
302
             Owner = null;
322
             WindowState = WindowState.Minimized;
303
             WindowState = WindowState.Minimized;
323
             Visibility = Visibility.Hidden;
304
             Visibility = Visibility.Hidden;
325
             //this.Hide();
306
             //this.Hide();
326
             if (ChangeTextEvent != null)
307
             if (ChangeTextEvent != null)
327
             {
308
             {
328
-                k_hook.Stop();
309
+                _kHook.Stop();
329
                 ChangeTextEvent("关闭窗口");
310
                 ChangeTextEvent("关闭窗口");
330
             }
311
             }
331
         }
312
         }
332
 
313
 
333
         #endregion 获取截图
314
         #endregion 获取截图
315
+
334
         /// <summary>
316
         /// <summary>
335
-        /// 获取时间戳
317
+        ///     获取时间戳
336
         /// </summary>
318
         /// </summary>
337
         /// <returns></returns>
319
         /// <returns></returns>
338
         public string GetTimeStamp()
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
             return Convert.ToInt64(ts.TotalMilliseconds).ToString();
332
             return Convert.ToInt64(ts.TotalMilliseconds).ToString();
342
         }
333
         }
334
+
343
         #region 退出截图
335
         #region 退出截图
344
 
336
 
345
         public void OnCancel()
337
         public void OnCancel()
347
             //Close();
339
             //Close();
348
             //ImageHelper.DeleteObject(BitmapPtr);
340
             //ImageHelper.DeleteObject(BitmapPtr);
349
             //ImageHelper.DeleteObject(JieTuBitmapPtr);
341
             //ImageHelper.DeleteObject(JieTuBitmapPtr);
350
-            initialization();
342
+            Initialization();
351
             Owner = null;
343
             Owner = null;
352
             WindowState = WindowState.Minimized;
344
             WindowState = WindowState.Minimized;
353
             Visibility = Visibility.Hidden;
345
             Visibility = Visibility.Hidden;
354
             ShowInTaskbar = false;
346
             ShowInTaskbar = false;
355
             //this.Hide();
347
             //this.Hide();
356
             //_Bitmap.Dispose();
348
             //_Bitmap.Dispose();
357
-
358
             if (ChangeTextEvent != null)
349
             if (ChangeTextEvent != null)
359
             {
350
             {
360
-                k_hook.Stop();
351
+                _kHook.Stop();
361
                 ChangeTextEvent("取消");
352
                 ChangeTextEvent("取消");
362
             }
353
             }
363
         }
354
         }
369
         public void OnOK()
360
         public void OnOK()
370
         {
361
         {
371
             Hidden();
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
             t.Start();
370
             t.Start();
403
         }
371
         }
404
 
372
 
411
             //隐藏尺寸RGB框
379
             //隐藏尺寸RGB框
412
             if (AppModel.Current.MaskTopHeight < 40)
380
             if (AppModel.Current.MaskTopHeight < 40)
413
             {
381
             {
414
-                SizeRGB.Visibility = Visibility.Collapsed;
382
+                SizeRgb.Visibility = Visibility.Collapsed;
415
             }
383
             }
416
             int need = SizeColorBar.Current.Selected == Tool.Null ? 30 : 67;
384
             int need = SizeColorBar.Current.Selected == Tool.Null ? 30 : 67;
417
             if (AppModel.Current.MaskBottomHeight < need && AppModel.Current.MaskTopHeight < need)
385
             if (AppModel.Current.MaskBottomHeight < need && AppModel.Current.MaskTopHeight < need)
428
 
396
 
429
         private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
397
         private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
430
         {
398
         {
431
-            if (_IsCapture)
399
+            if (_isCapture)
432
             {
400
             {
433
                 return;
401
                 return;
434
             }
402
             }
435
             System.Windows.Point point = e.GetPosition(this);
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
         private void Window_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
415
         private void Window_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
448
         {
416
         {
449
-            if (!_IsMouseDown || _IsCapture)
417
+            if (!_isMouseDown || _isCapture)
450
             {
418
             {
451
                 return;
419
                 return;
452
             }
420
             }
453
-            _IsMouseDown = false;
421
+            _isMouseDown = false;
454
             if (MainImage.Width >= MinSize && MainImage.Height >= MinSize)
422
             if (MainImage.Width >= MinSize && MainImage.Height >= MinSize)
455
             {
423
             {
456
-                _IsCapture = true;
424
+                _isCapture = true;
457
                 ImageEditBar.Current.Visibility = Visibility.Visible;
425
                 ImageEditBar.Current.Visibility = Visibility.Visible;
458
                 ImageEditBar.Current.ResetCanvas();
426
                 ImageEditBar.Current.ResetCanvas();
459
                 Cursor = Cursors.Arrow;
427
                 Cursor = Cursors.Arrow;
472
             {
440
             {
473
                 MessageWindow.Show(ex.Message);
441
                 MessageWindow.Show(ex.Message);
474
             }
442
             }
475
-            if (_IsCapture)
443
+            if (_isCapture)
476
             {
444
             {
477
                 return;
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
                 if (w < MinSize || h < MinSize)
455
                 if (w < MinSize || h < MinSize)
490
                 {
456
                 {
491
                     return;
457
                     return;
512
         {
478
         {
513
             if (e.Key == Key.Escape)
479
             if (e.Key == Key.Escape)
514
             {
480
             {
515
-                initialization();
481
+                Initialization();
516
                 Owner = null;
482
                 Owner = null;
517
                 WindowState = WindowState.Minimized;
483
                 WindowState = WindowState.Minimized;
518
                 Visibility = Visibility.Hidden;
484
                 Visibility = Visibility.Hidden;
523
         #endregion 鼠标及键盘事件
489
         #endregion 鼠标及键盘事件
524
 
490
 
525
         /// <summary>
491
         /// <summary>
526
-        /// 关闭时清除tool页记录的截图数据
492
+        ///     关闭时清除tool页记录的截图数据
527
         /// </summary>
493
         /// </summary>
528
         /// <param name="sender"></param>
494
         /// <param name="sender"></param>
529
         /// <param name="e"></param>
495
         /// <param name="e"></param>
530
         private void Window_Closed(object sender, EventArgs e)
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
         /// <summary>
504
         /// <summary>
536
-        /// 非正常关闭时jietuWindow=null;
505
+        ///     非正常关闭时jietuWindow=null;
537
         /// </summary>
506
         /// </summary>
538
-        /// <param name="sender"></param>
539
-        /// <param name="e"></param>
540
         public delegate void CloseJietuWindowClick();
507
         public delegate void CloseJietuWindowClick();
541
 
508
 
542
         /// <summary>
509
         /// <summary>
543
-        /// 非正常关闭时jietuWindow=null;
510
+        ///     非正常关闭时jietuWindow=null;
544
         /// </summary>
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
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7
     Title="KeyVerification"
7
     Title="KeyVerification"
8
-    Width="400"
8
+    Width="446"
9
     Height="200"
9
     Height="200"
10
     AllowsTransparency="True"
10
     AllowsTransparency="True"
11
     Background="Transparent"
11
     Background="Transparent"
19
     <Window.Resources />
19
     <Window.Resources />
20
     <Grid Margin="0,0,0,0" Background="White">
20
     <Grid Margin="0,0,0,0" Background="White">
21
         <Grid.RowDefinitions>
21
         <Grid.RowDefinitions>
22
-            <RowDefinition Height="50" />
22
+            <RowDefinition Height="40" />
23
             <RowDefinition Height="*" />
23
             <RowDefinition Height="*" />
24
             <RowDefinition Height="75" />
24
             <RowDefinition Height="75" />
25
         </Grid.RowDefinitions>
25
         </Grid.RowDefinitions>
26
         <!--  头部  -->
26
         <!--  头部  -->
27
         <Grid
27
         <Grid
28
             Grid.Row="0"
28
             Grid.Row="0"
29
-            Height="50"
30
             Background="#4597FF"
29
             Background="#4597FF"
31
             MouseLeftButtonDown="Window_MouseLeftButtonDown_1">
30
             MouseLeftButtonDown="Window_MouseLeftButtonDown_1">
32
             <TextBlock
31
             <TextBlock
44
                 Grid.Row="0"
43
                 Grid.Row="0"
45
                 Padding="10,0,10,0"
44
                 Padding="10,0,10,0"
46
                 HorizontalAlignment="Right"
45
                 HorizontalAlignment="Right"
46
+                VerticalAlignment="Center"
47
                 Click="CloseClick"
47
                 Click="CloseClick"
48
                 Content="×"
48
                 Content="×"
49
                 Cursor="Hand"
49
                 Cursor="Hand"

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

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

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

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

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

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

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

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

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

563
                                                             Cursor="SizeAll"
563
                                                             Cursor="SizeAll"
564
                                                             Fill="#00000000"
564
                                                             Fill="#00000000"
565
                                                             SnapsToDevicePixels="True"
565
                                                             SnapsToDevicePixels="True"
566
-                                                            Stroke="#3f6fff"
566
+                                                            Stroke="#4597FF"
567
                                                             StrokeDashArray="4 4"
567
                                                             StrokeDashArray="4 4"
568
                                                             StrokeThickness="4"
568
                                                             StrokeThickness="4"
569
                                                             Visibility="Hidden" />
569
                                                             Visibility="Hidden" />
590
                                                                 HorizontalAlignment="Left"
590
                                                                 HorizontalAlignment="Left"
591
                                                                 VerticalAlignment="Top"
591
                                                                 VerticalAlignment="Top"
592
                                                                 Background="White"
592
                                                                 Background="White"
593
-                                                                BorderBrush="#3f6fff"
593
+                                                                BorderBrush="#4597FF"
594
                                                                 BorderThickness="2"
594
                                                                 BorderThickness="2"
595
                                                                 Cursor="SizeNWSE"
595
                                                                 Cursor="SizeNWSE"
596
                                                                 DragCompleted="RectRightUp_DragCompleted"
596
                                                                 DragCompleted="RectRightUp_DragCompleted"
606
                                                                 HorizontalAlignment="Left"
606
                                                                 HorizontalAlignment="Left"
607
                                                                 VerticalAlignment="Top"
607
                                                                 VerticalAlignment="Top"
608
                                                                 Background="White"
608
                                                                 Background="White"
609
-                                                                BorderBrush="#3f6fff"
609
+                                                                BorderBrush="#4597FF"
610
                                                                 BorderThickness="2"
610
                                                                 BorderThickness="2"
611
                                                                 Cursor="SizeNESW"
611
                                                                 Cursor="SizeNESW"
612
                                                                 DragCompleted="RectRightUp_DragCompleted"
612
                                                                 DragCompleted="RectRightUp_DragCompleted"
622
                                                                 HorizontalAlignment="Left"
622
                                                                 HorizontalAlignment="Left"
623
                                                                 VerticalAlignment="Top"
623
                                                                 VerticalAlignment="Top"
624
                                                                 Background="White"
624
                                                                 Background="White"
625
-                                                                BorderBrush="#3f6fff"
625
+                                                                BorderBrush="#4597FF"
626
                                                                 BorderThickness="2"
626
                                                                 BorderThickness="2"
627
                                                                 Cursor="SizeNESW"
627
                                                                 Cursor="SizeNESW"
628
                                                                 DragCompleted="RectRightUp_DragCompleted"
628
                                                                 DragCompleted="RectRightUp_DragCompleted"
638
                                                                 HorizontalAlignment="Left"
638
                                                                 HorizontalAlignment="Left"
639
                                                                 VerticalAlignment="Top"
639
                                                                 VerticalAlignment="Top"
640
                                                                 Background="White"
640
                                                                 Background="White"
641
-                                                                BorderBrush="#3f6fff"
641
+                                                                BorderBrush="#4597FF"
642
                                                                 BorderThickness="2"
642
                                                                 BorderThickness="2"
643
                                                                 Cursor="SizeNWSE"
643
                                                                 Cursor="SizeNWSE"
644
                                                                 DragCompleted="RectRightUp_DragCompleted"
644
                                                                 DragCompleted="RectRightUp_DragCompleted"
1337
                                                 Height="30"
1337
                                                 Height="30"
1338
                                                 HorizontalAlignment="Stretch"
1338
                                                 HorizontalAlignment="Stretch"
1339
                                                 VerticalAlignment="Stretch"
1339
                                                 VerticalAlignment="Stretch"
1340
-                                                Background="#3f6fff"
1340
+                                                Background="#4597FF"
1341
                                                 Click="BtnBrowse_Click"
1341
                                                 Click="BtnBrowse_Click"
1342
                                                 Content="浏览"
1342
                                                 Content="浏览"
1343
                                                 Cursor="Hand"
1343
                                                 Cursor="Hand"
1351
                                                 Height="30"
1351
                                                 Height="30"
1352
                                                 HorizontalAlignment="Stretch"
1352
                                                 HorizontalAlignment="Stretch"
1353
                                                 VerticalAlignment="Stretch"
1353
                                                 VerticalAlignment="Stretch"
1354
-                                                Background="#3f6fff"
1354
+                                                Background="#4597FF"
1355
                                                 Click="btnOpen_Click"
1355
                                                 Click="btnOpen_Click"
1356
                                                 Content="打开"
1356
                                                 Content="打开"
1357
                                                 Cursor="Hand"
1357
                                                 Cursor="Hand"
1455
                                             Height="30"
1455
                                             Height="30"
1456
                                             HorizontalAlignment="Stretch"
1456
                                             HorizontalAlignment="Stretch"
1457
                                             VerticalAlignment="Center"
1457
                                             VerticalAlignment="Center"
1458
-                                            Background="#3f6fff"
1458
+                                            Background="#4597FF"
1459
                                             Click="BtnSave_Click"
1459
                                             Click="BtnSave_Click"
1460
                                             Content="保存"
1460
                                             Content="保存"
1461
                                             Cursor="Hand"
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
 
20
 
21
     <Border
21
     <Border
22
         Background="White"
22
         Background="White"
23
-        BorderBrush="#3f6fff"
23
+        BorderBrush="#4597FF"
24
         BorderThickness="0">
24
         BorderThickness="0">
25
         <Grid>
25
         <Grid>
26
             <Grid.RowDefinitions>
26
             <Grid.RowDefinitions>
28
                 <RowDefinition Height="*" />
28
                 <RowDefinition Height="*" />
29
                 <RowDefinition Height="60" />
29
                 <RowDefinition Height="60" />
30
             </Grid.RowDefinitions>
30
             </Grid.RowDefinitions>
31
-            <Grid Grid.Row="0" Background="#3f6fff">
31
+            <Grid Grid.Row="0" Background="#4597FF">
32
                 <Label
32
                 <Label
33
                     x:Name="LblTitle"
33
                     x:Name="LblTitle"
34
                     Margin="14,0,0,0"
34
                     Margin="14,0,0,0"
69
                     Margin="0,0,10,0"
69
                     Margin="0,0,10,0"
70
                     HorizontalAlignment="Right"
70
                     HorizontalAlignment="Right"
71
                     VerticalAlignment="Center"
71
                     VerticalAlignment="Center"
72
-                    Background="#3f6fff"
72
+                    Background="#4597FF"
73
                     CornerRadius="6">
73
                     CornerRadius="6">
74
                     <Button
74
                     <Button
75
                         x:Name="BtnOk"
75
                         x:Name="BtnOk"

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

4
 namespace XHWK.WKTool
4
 namespace XHWK.WKTool
5
 {
5
 {
6
     /// <summary>
6
     /// <summary>
7
-    /// 消息提示框 .show()
7
+    ///     消息提示框 .show()
8
     /// </summary>
8
     /// </summary>
9
-    public partial class MessageWindow : Window
9
+    public partial class MessageWindow
10
     {
10
     {
11
         /// <summary>
11
         /// <summary>
12
-        /// 提示框
12
+        ///     提示框
13
         /// </summary>
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
             InitializeComponent();
24
             InitializeComponent();
20
-            switch (MessageType)
25
+            switch (messageType)
21
             {
26
             {
22
                 case 1:
27
                 case 1:
23
                     BorCancel.Visibility = Visibility.Hidden;
28
                     BorCancel.Visibility = Visibility.Hidden;
25
                 case 2:
30
                 case 2:
26
                     BorCancel.Visibility = Visibility.Visible;
31
                     BorCancel.Visibility = Visibility.Visible;
27
                     break;
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
             else
43
             else
41
             {
44
             {
42
-                TbkContent.Text = "错误!";
45
+                TbkContent.Text = "请求失败请重试!";
43
             }
46
             }
44
         }
47
         }
48
+
45
         /// <summary>
49
         /// <summary>
46
-        /// 取消
50
+        ///     取消
47
         /// </summary>
51
         /// </summary>
48
         /// <param name="sender"></param>
52
         /// <param name="sender"></param>
49
         /// <param name="e"></param>
53
         /// <param name="e"></param>
51
         {
55
         {
52
             DialogResult = false;
56
             DialogResult = false;
53
         }
57
         }
58
+
54
         /// <summary>
59
         /// <summary>
55
-        /// 确定
60
+        ///     确定
56
         /// </summary>
61
         /// </summary>
57
         /// <param name="sender"></param>
62
         /// <param name="sender"></param>
58
         /// <param name="e"></param>
63
         /// <param name="e"></param>
60
         {
65
         {
61
             DialogResult = true;
66
             DialogResult = true;
62
         }
67
         }
68
+
63
         /// <summary>
69
         /// <summary>
64
-        /// 消息提示框
70
+        ///     消息提示框
65
         /// </summary>
71
         /// </summary>
66
-        /// <param name="Message">消息</param>
72
+        /// <param name="message">消息</param>
67
         /// <returns></returns>
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
         /// <summary>
80
         /// <summary>
74
-        /// 消息提示框
81
+        ///     消息提示框
75
         /// </summary>
82
         /// </summary>
76
-        /// <param name="Message">消息</param>
83
+        /// <param name="content">消息</param>
84
+        /// <param name="title"></param>
77
         /// <returns></returns>
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
             message.ShowDialog();
93
             message.ShowDialog();
82
             return MessageBoxResult.Cancel;
94
             return MessageBoxResult.Cancel;
83
         }
95
         }
96
+
84
         /// <summary>
97
         /// <summary>
85
-        /// 消息提示框
98
+        ///     消息提示框
86
         /// </summary>
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
         /// <returns></returns>
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
             bool? res = message.ShowDialog();
120
             bool? res = message.ShowDialog();
98
-            if ((bool)res)
121
+            if (res != null && (bool)res)
99
             {
122
             {
100
                 if (messageBox == MessageBoxButton.OKCancel)
123
                 if (messageBox == MessageBoxButton.OKCancel)
101
                 {
124
                 {
102
                     return MessageBoxResult.OK;
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
         private static MessageBoxResult Win32ToMessageBoxResult(int value)
136
         private static MessageBoxResult Win32ToMessageBoxResult(int value)
122
         {
137
         {
123
             switch (value)
138
             switch (value)
144
             }
159
             }
145
         }
160
         }
146
     }
161
     }
147
-}
162
+}

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

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

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

3
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
-        xmlns:local="clr-namespace:XHWK.WKTool"
7
         mc:Ignorable="d"
6
         mc:Ignorable="d"
8
         Title="PracticeWindow"  Width="1280"
7
         Title="PracticeWindow"  Width="1280"
9
     Height="800"
8
     Height="800"
14
     ShowInTaskbar="False"
13
     ShowInTaskbar="False"
15
     WindowStyle="None">
14
     WindowStyle="None">
16
     <Grid>
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
     </Grid>
18
     </Grid>
20
 </Window>
19
 </Window>

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

1
 using Common.system;
1
 using Common.system;
2
+
2
 using System;
3
 using System;
3
 using System.Threading;
4
 using System.Threading;
4
 using System.Windows;
5
 using System.Windows;
6
 using System.Windows.Ink;
7
 using System.Windows.Ink;
7
 using System.Windows.Input;
8
 using System.Windows.Input;
8
 using System.Windows.Media;
9
 using System.Windows.Media;
10
+
9
 using XHWK.Model;
11
 using XHWK.Model;
10
 
12
 
11
 namespace XHWK.WKTool
13
 namespace XHWK.WKTool
12
 {
14
 {
13
     /// <summary>
15
     /// <summary>
14
-    /// 录屏画板
16
+    ///     录屏画板
15
     /// </summary>
17
     /// </summary>
16
     public partial class PracticeWindow
18
     public partial class PracticeWindow
17
     {
19
     {
22
         private ViewModel _viewModel;
24
         private ViewModel _viewModel;
23
 
25
 
24
         /// <summary>
26
         /// <summary>
25
-        /// 0 画笔 1 矩形 2 圆形
27
+        ///     0 画笔 1 矩形 2 圆形
26
         /// </summary>
28
         /// </summary>
27
 #pragma warning disable CS0414
29
 #pragma warning disable CS0414
28
         private int _flg;
30
         private int _flg;
29
 #pragma warning restore CS0414
31
 #pragma warning restore CS0414
30
 
32
 
31
         /// <summary>
33
         /// <summary>
32
-        /// 当前画笔颜色
34
+        ///     当前画笔颜色
33
         /// </summary>
35
         /// </summary>
34
         private Color _colour = Colors.Red;
36
         private Color _colour = Colors.Red;
35
 
37
 
36
         /// <summary>
38
         /// <summary>
37
-        /// 当前画笔宽
39
+        ///     当前画笔宽
38
         /// </summary>
40
         /// </summary>
39
         private int _wit = 2;
41
         private int _wit = 2;
40
 
42
 
41
         /// <summary>
43
         /// <summary>
42
-        /// 当前画笔高
44
+        ///     当前画笔高
43
         /// </summary>
45
         /// </summary>
44
         private int _hei = 2;
46
         private int _hei = 2;
45
 
47
 
46
         public PracticeWindow()
48
         public PracticeWindow()
47
         {
49
         {
48
             InitializeComponent();
50
             InitializeComponent();
49
-
50
             InitTqlpPen();
51
             InitTqlpPen();
51
         }
52
         }
52
 
53
 
53
         public void Initialize(string imgPath = null)
54
         public void Initialize(string imgPath = null)
54
         {
55
         {
55
             _flg = 0;
56
             _flg = 0;
56
-            blackboard_canvas.Strokes.Clear();
57
-            blackboard_canvas.UseCustomCursor = true;
57
+            BlackboardCanvas.Strokes.Clear();
58
+            BlackboardCanvas.UseCustomCursor = true;
58
             //blackboard_canvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
59
             //blackboard_canvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
59
             //加背景 废弃更利于讲解ppt
60
             //加背景 废弃更利于讲解ppt
60
             //if (File.Exists(_imgPath))
61
             //if (File.Exists(_imgPath))
71
 
72
 
72
             ////将 InkCanvas 的 DefaultDrawingAttributes 属性的值赋成创建的 DrawingAttributes 类的对象的引用
73
             ////将 InkCanvas 的 DefaultDrawingAttributes 属性的值赋成创建的 DrawingAttributes 类的对象的引用
73
             ////InkCanvas 通过 DefaultDrawingAttributes 属性来获取墨迹的各种设置,该属性的类型为 DrawingAttributes 型
74
             ////InkCanvas 通过 DefaultDrawingAttributes 属性来获取墨迹的各种设置,该属性的类型为 DrawingAttributes 型
74
-            blackboard_canvas.DefaultDrawingAttributes = _drawingAttributes;
75
+            BlackboardCanvas.DefaultDrawingAttributes = _drawingAttributes;
75
             Pen();
76
             Pen();
76
             //blackboard_canvas.Cursor = Cursors.Pen;
77
             //blackboard_canvas.Cursor = Cursors.Pen;
77
 
78
 
78
             //Cursor cus = new Cursor(@"G:\06.cur");
79
             //Cursor cus = new Cursor(@"G:\06.cur");
79
 
80
 
80
             //blackboard_canvas.Cursor = cus;
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
             DataContext = _viewModel;
83
             DataContext = _viewModel;
88
             //APP.W_ScreenRecordingToolbarWindow.Owner = this;
84
             //APP.W_ScreenRecordingToolbarWindow.Owner = this;
89
             //APP.W_ScreenRecordingToolbarWindow.Topmost = true;
85
             //APP.W_ScreenRecordingToolbarWindow.Topmost = true;
90
         }
86
         }
91
 
87
 
92
         /// <summary>
88
         /// <summary>
93
-        /// 画笔颜色事件 白色
89
+        ///     画笔颜色事件 白色
94
         /// </summary>
90
         /// </summary>
95
         public void White()
91
         public void White()
96
         {
92
         {
100
         }
96
         }
101
 
97
 
102
         /// <summary>
98
         /// <summary>
103
-        /// 画笔颜色事件 红色
99
+        ///     画笔颜色事件 红色
104
         /// </summary>
100
         /// </summary>
105
         public void Red()
101
         public void Red()
106
         {
102
         {
109
         }
105
         }
110
 
106
 
111
         /// <summary>
107
         /// <summary>
112
-        /// 画笔颜色事件 黑色
108
+        ///     画笔颜色事件 黑色
113
         /// </summary>
109
         /// </summary>
114
         public void Gray()
110
         public void Gray()
115
         {
111
         {
119
         }
115
         }
120
 
116
 
121
         /// <summary>
117
         /// <summary>
122
-        /// 画笔颜色事件 青色
118
+        ///     画笔颜色事件 青色
123
         /// </summary>
119
         /// </summary>
124
         public void CyanBlue()
120
         public void CyanBlue()
125
         {
121
         {
129
         }
125
         }
130
 
126
 
131
         /// <summary>
127
         /// <summary>
132
-        /// 画笔颜色事件 黄色
128
+        ///     画笔颜色事件 黄色
133
         /// </summary>
129
         /// </summary>
134
         public void Yellow()
130
         public void Yellow()
135
         {
131
         {
139
         }
135
         }
140
 
136
 
141
         /// <summary>
137
         /// <summary>
142
-        /// 画笔颜色事件 蓝色
138
+        ///     画笔颜色事件 蓝色
143
         /// </summary>
139
         /// </summary>
144
         public void Blue()
140
         public void Blue()
145
         {
141
         {
149
         }
145
         }
150
 
146
 
151
         /// <summary>
147
         /// <summary>
152
-        /// 画笔粗细事件 细
148
+        ///     画笔粗细事件 细
153
         /// </summary>
149
         /// </summary>
154
         public void Fine()
150
         public void Fine()
155
         {
151
         {
161
         }
157
         }
162
 
158
 
163
         /// <summary>
159
         /// <summary>
164
-        /// 画笔粗细事件 中
160
+        ///     画笔粗细事件 中
165
         /// </summary>
161
         /// </summary>
166
         public void In()
162
         public void In()
167
         {
163
         {
173
         }
169
         }
174
 
170
 
175
         /// <summary>
171
         /// <summary>
176
-        /// 画笔粗细事件 粗
172
+        ///     画笔粗细事件 粗
177
         /// </summary>
173
         /// </summary>
178
         public void Crude()
174
         public void Crude()
179
         {
175
         {
185
         }
181
         }
186
 
182
 
187
         /// <summary>
183
         /// <summary>
188
-        /// 橡皮
184
+        ///     橡皮
189
         /// </summary>
185
         /// </summary>
190
         public void Eraser()
186
         public void Eraser()
191
         {
187
         {
192
             _flg = 0;
188
             _flg = 0;
193
             //this.type = ZPenType.Erase;
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
         /// <summary>
199
         /// <summary>
200
-        /// 画笔
200
+        ///     画笔
201
         /// </summary>
201
         /// </summary>
202
         public void Pen()
202
         public void Pen()
203
         {
203
         {
204
             _flg = 0;
204
             _flg = 0;
205
-            blackboard_canvas.EditingMode = InkCanvasEditingMode.Ink;
206
-            blackboard_canvas.UseCustomCursor = true;
205
+            BlackboardCanvas.EditingMode = InkCanvasEditingMode.Ink;
206
+            BlackboardCanvas.UseCustomCursor = true;
207
             _drawingAttributes.FitToCurve = true;
207
             _drawingAttributes.FitToCurve = true;
208
             _drawingAttributes.IgnorePressure = false;
208
             _drawingAttributes.IgnorePressure = false;
209
-
210
-            blackboard_canvas.Cursor = Cursors.Pen;
209
+            BlackboardCanvas.Cursor = Cursors.Pen;
211
         }
210
         }
212
 
211
 
213
         /// <summary>
212
         /// <summary>
214
-        /// 圆
213
+        ///     
215
         /// </summary>
214
         /// </summary>
216
         public void Round()
215
         public void Round()
217
         {
216
         {
226
                 IsHighlighter = false,
225
                 IsHighlighter = false,
227
                 IgnorePressure = true,
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
         /// <summary>
233
         /// <summary>
235
-        /// 矩形
234
+        ///     矩形
236
         /// </summary>
235
         /// </summary>
237
         public void Rectangle()
236
         public void Rectangle()
238
         {
237
         {
247
                 IsHighlighter = false,
246
                 IsHighlighter = false,
248
                 IgnorePressure = true,
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
         /// <summary>
254
         /// <summary>
256
-        /// 鼠标中键点击
255
+        ///     鼠标中键点击
257
         /// </summary>
256
         /// </summary>
258
         private void SwitchPages()
257
         private void SwitchPages()
259
         {
258
         {
260
             try
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
             catch (Exception ex)
269
             catch (Exception ex)
269
             {
270
             {
281
             {
282
             {
282
                 App.W_ScreenRecordingToolbarWindow.flg = 1;
283
                 App.W_ScreenRecordingToolbarWindow.flg = 1;
283
             }
284
             }
284
-
285
             ReturnPractice();
285
             ReturnPractice();
286
             //模拟切到ppt
286
             //模拟切到ppt
287
             SwitchPages();
287
             SwitchPages();
289
         }
289
         }
290
 
290
 
291
         /// <summary>
291
         /// <summary>
292
-        /// 退出批注并清空画板
292
+        ///     退出批注并清空画板
293
         /// </summary>
293
         /// </summary>
294
         public void ReturnPractice()
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
         #region 点阵笔相关
314
         #region 点阵笔相关
326
         private Stroke _strokes;
330
         private Stroke _strokes;
327
 
331
 
328
         /// <summary>
332
         /// <summary>
329
-        /// 引用user32.dll动态链接库(windows api),
330
-        /// 使用库中定义 API:SetCursorPos
331
-        /// 设置光标位置
333
+        ///     引用user32.dll动态链接库(windows api),
334
+        ///     使用库中定义 API:SetCursorPos
335
+        ///     设置光标位置
332
         /// </summary>
336
         /// </summary>
333
         [System.Runtime.InteropServices.DllImport("user32.dll")]
337
         [System.Runtime.InteropServices.DllImport("user32.dll")]
334
         private static extern int SetCursorPos(int x, int y);
338
         private static extern int SetCursorPos(int x, int y);
338
         #region 腾千里手写笔
342
         #region 腾千里手写笔
339
 
343
 
340
         /// <summary>
344
         /// <summary>
341
-        /// 是否在书写
345
+        ///     是否在书写
342
         /// </summary>
346
         /// </summary>
343
         private bool _isTqlPenDown;
347
         private bool _isTqlPenDown;
344
 
348
 
345
         /// <summary>
349
         /// <summary>
346
-        /// TQL点阵笔宽高
350
+        ///     TQL点阵笔宽高
347
         /// </summary>
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
 //static float TQLA4_HEIGHT = (float)1512 / (float)150 * (float)25.4 / (float)1.524;
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
         /// <summary>
358
         /// <summary>
355
-        /// 初始化
359
+        ///     初始化
356
         /// </summary>
360
         /// </summary>
357
         public void InitTqlpPen()
361
         public void InitTqlpPen()
358
         {
362
         {
367
         }
371
         }
368
 
372
 
369
         /// <summary>
373
         /// <summary>
370
-        /// 笔落下
374
+        ///     笔落下
371
         /// </summary>
375
         /// </summary>
372
         public void TqlDown()
376
         public void TqlDown()
373
         {
377
         {
377
             {
381
             {
378
                 _isFirst = true;
382
                 _isFirst = true;
379
             }
383
             }
380
-
381
             _stylusPoints = new StylusPointCollection();
384
             _stylusPoints = new StylusPointCollection();
382
             _stylusPoint = new StylusPoint();
385
             _stylusPoint = new StylusPoint();
383
             _strokes = null;
386
             _strokes = null;
384
         }
387
         }
385
 
388
 
386
         /// <summary>
389
         /// <summary>
387
-        /// 笔抬起
390
+        ///     笔抬起
388
         /// </summary>
391
         /// </summary>
389
         public void TqlUp()
392
         public void TqlUp()
390
         {
393
         {
391
             _isTqlPenDown = false;
394
             _isTqlPenDown = false;
392
-
393
             if (_strokes != null && _strokes.StylusPoints.Count > 1)
395
             if (_strokes != null && _strokes.StylusPoints.Count > 1)
394
             {
396
             {
395
                 _isFirst = true;
397
                 _isFirst = true;
396
             }
398
             }
397
-
398
             _stylusPoints = new StylusPointCollection();
399
             _stylusPoints = new StylusPointCollection();
399
             _stylusPoint = new StylusPoint();
400
             _stylusPoint = new StylusPoint();
400
             _strokes = null;
401
             _strokes = null;
401
         }
402
         }
402
 
403
 
403
         /// <summary>
404
         /// <summary>
404
-        /// 笔书写
405
+        ///     笔书写
405
         /// </summary>
406
         /// </summary>
406
         /// <param name="cx"></param>
407
         /// <param name="cx"></param>
407
         /// <param name="cy"></param>
408
         /// <param name="cy"></param>
408
         /// <param name="force"></param>
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
                 if (!_isTqlPenDown)
420
                 if (!_isTqlPenDown)
415
                 {
421
                 {
416
                     return;
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
                 double tempX = cy * propW;
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
                             _stylusPoint.X = tempX;
435
                             _stylusPoint.X = tempX;
457
                             _stylusPoint.Y = tempY;
436
                             _stylusPoint.Y = tempY;
458
                             _stylusPoints.Add(_stylusPoint);
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
         #endregion 腾千里手写笔
488
         #endregion 腾千里手写笔
487
     }
489
     }
488
-}
490
+}

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

2
     x:Class="XHWK.WKTool.ProductVerification"
2
     x:Class="XHWK.WKTool.ProductVerification"
3
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5
-    xmlns:Views="clr-namespace:XHWK.WKTool.Helpers"
6
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7
-    xmlns:local="clr-namespace:XHWK.WKTool"
8
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7
+    xmlns:views="clr-namespace:XHWK.WKTool.Helpers"
9
     Title="ProductVerification"
8
     Title="ProductVerification"
10
     Width="300"
9
     Width="300"
11
     Height="230"
10
     Height="230"
23
             ShadowDepth="0"
22
             ShadowDepth="0"
24
             Color="#bababa" />
23
             Color="#bababa" />
25
     </Window.Effect>
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
         <Grid Margin="0,0,0,0">
27
         <Grid Margin="0,0,0,0">
61
             <Grid.RowDefinitions>
28
             <Grid.RowDefinitions>
62
-                <RowDefinition Height="50" />
29
+                <RowDefinition Height="40" />
63
                 <RowDefinition Height="*" />
30
                 <RowDefinition Height="*" />
64
                 <RowDefinition Height="75" />
31
                 <RowDefinition Height="75" />
65
             </Grid.RowDefinitions>
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
                 <TextBlock
35
                 <TextBlock
72
-                    x:Name="title_tb"
36
+                    x:Name="TitleTb"
73
                     Grid.Row="0"
37
                     Grid.Row="0"
74
                     Margin="15,0,0,0"
38
                     Margin="15,0,0,0"
75
                     HorizontalAlignment="Left"
39
                     HorizontalAlignment="Left"
86
                     VerticalAlignment="Center"
50
                     VerticalAlignment="Center"
87
                     Background="White"
51
                     Background="White"
88
                     Click="CloseClick"
52
                     Click="CloseClick"
89
-                    Cursor="Hand"
90
-                    >
53
+                    Cursor="Hand">
91
                     <Button.Template>
54
                     <Button.Template>
92
                         <ControlTemplate TargetType="{x:Type Button}">
55
                         <ControlTemplate TargetType="{x:Type Button}">
93
                             <Border
56
                             <Border
116
                 </StackPanel>
79
                 </StackPanel>
117
             </Grid>
80
             </Grid>
118
         </Grid>
81
         </Grid>
119
-    </Views:ZJClippingBorder>
120
-</Window>
82
+    </views:ZJClippingBorder>
83
+</Window>

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

7
 
7
 
8
 using XHWK.Model;
8
 using XHWK.Model;
9
 using XHWK.WKTool.DAL;
9
 using XHWK.WKTool.DAL;
10
-using XHWK.WKTool.Skin;
11
 
10
 
12
 namespace XHWK.WKTool
11
 namespace XHWK.WKTool
13
 {
12
 {
14
     /// <summary>
13
     /// <summary>
15
-    /// ProductVerification.xaml 的交互逻辑
14
+    ///     ProductVerification.xaml 的交互逻辑
15
+    ///     本地解密  解密成功 日期在有效期内 ,判断当天是否调用添加历史接口,没有则调用
16
+    ///     解密失败 或解密获取的时间 过期 , 跳到输入code 激活界面
16
     /// </summary>
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
         public ProductVerification()
23
         public ProductVerification()
27
         {
24
         {
30
             Topmost = true;
27
             Topmost = true;
31
             App.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationDecryptServering, InvokeActivationDecryptServerCompate);
28
             App.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationDecryptServering, InvokeActivationDecryptServerCompate);
32
         }
29
         }
30
+
33
         /// <summary>
31
         /// <summary>
34
-        /// 激活信息--验证签名是否过期-调用
32
+        ///     激活信息--验证签名是否过期-调用
35
         /// </summary>
33
         /// </summary>
36
         /// <returns></returns>
34
         /// <returns></returns>
37
         private object InvokeActivationDecryptServering()
35
         private object InvokeActivationDecryptServering()
40
         }
38
         }
41
 
39
 
42
         /// <summary>
40
         /// <summary>
43
-        /// 激活信息--验证签名是否过期-返回结果
41
+        ///     激活信息--验证签名是否过期-返回结果
44
         /// </summary>
42
         /// </summary>
45
         /// <returns></returns>
43
         /// <returns></returns>
46
         public void InvokeActivationDecryptServerCompate(object obj)
44
         public void InvokeActivationDecryptServerCompate(object obj)
53
                 decrypt = decrypt.Replace("\u0001", "").Replace("\u0007", "").Trim();
51
                 decrypt = decrypt.Replace("\u0001", "").Replace("\u0007", "").Trim();
54
                 ModelSignatures msgBean = JsonHelper.JsonToObj<ModelSignatures>(decrypt);
52
                 ModelSignatures msgBean = JsonHelper.JsonToObj<ModelSignatures>(decrypt);
55
                 long currentTimeTimestamp = DataProvider.TimestampTotalSeconds(); //当前时间 时间戳
53
                 long currentTimeTimestamp = DataProvider.TimestampTotalSeconds(); //当前时间 时间戳
56
-                if (msgBean.endtime > currentTimeTimestamp)//条件成立  解析成功 code 在有效期内
54
+                if (msgBean.endtime > currentTimeTimestamp) //条件成立  解析成功 code 在有效期内
57
                 {
55
                 {
58
                     if (File.Exists(App.DataPath + "signatureTime.txt"))
56
                     if (File.Exists(App.DataPath + "signatureTime.txt"))
59
                     {
57
                     {
60
                         string signatureTime = System.IO.File.ReadAllText(App.DataPath + "signatureTime.txt", Encoding.Default);
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
                         if (signatureTime != currentTime)
60
                         if (signatureTime != currentTime)
63
                         {
61
                         {
64
                             App.BackgroundWorkerHelper.RunWorkerAsync(InvokeActivationAddHistoryServering, InvokeActivationAddHistoryServerCompate);
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
             catch (Exception ex) //解析失败 输code  
88
             catch (Exception ex) //解析失败 输code  
90
             {
89
             {
91
                 LogHelper.Logerror.Error("ProductVerification(解析失败)" + ex.Message, ex);
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
         /// <summary>
103
         /// <summary>
106
-        /// 激活信息--添加激活历史-调用
104
+        ///     激活信息--添加激活历史-调用
107
         /// </summary>
105
         /// </summary>
108
         /// <returns></returns>
106
         /// <returns></returns>
109
         private object InvokeActivationAddHistoryServering()
107
         private object InvokeActivationAddHistoryServering()
110
         {
108
         {
111
-            serverReturnCode = registerController.ActivationAddHistory();
109
+            _serverReturnCode = _registerController.ActivationAddHistory();
112
             return App.ServerMsg;
110
             return App.ServerMsg;
113
         }
111
         }
114
 
112
 
115
         /// <summary>
113
         /// <summary>
116
-        /// 激活信息--添加激活历史-返回结果
114
+        ///     激活信息--添加激活历史-返回结果
117
         /// </summary>
115
         /// </summary>
118
         /// <returns></returns>
116
         /// <returns></returns>
119
         public void InvokeActivationAddHistoryServerCompate(object obj)
117
         public void InvokeActivationAddHistoryServerCompate(object obj)
122
             {
120
             {
123
                 Directory.CreateDirectory(App.DataPath);
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
         /// <summary>
132
         /// <summary>
131
-        /// 关闭弹窗
133
+        ///     关闭弹窗
132
         /// </summary>
134
         /// </summary>
133
         /// <param name="sender"></param>
135
         /// <param name="sender"></param>
134
         /// <param name="e"></param>
136
         /// <param name="e"></param>
138
         }
140
         }
139
 
141
 
140
         /// <summary>
142
         /// <summary>
141
-        /// 退出程序
143
+        ///     退出程序
142
         /// </summary>
144
         /// </summary>
143
         private void CloseAction()
145
         private void CloseAction()
144
         {
146
         {
145
-            Dispatcher.Invoke
146
-            (
147
+            Dispatcher.Invoke(
147
                 () =>
148
                 () =>
148
                 {
149
                 {
149
                     Application.Current.Shutdown();
150
                     Application.Current.Shutdown();
156
             //Console.WriteLine("{0}被销毁", this);
157
             //Console.WriteLine("{0}被销毁", this);
157
             Dispose(false);
158
             Dispose(false);
158
         }
159
         }
160
+
159
         public void Dispose()
161
         public void Dispose()
160
         {
162
         {
161
             //Console.WriteLine("{0}被手动销毁", this);
163
             //Console.WriteLine("{0}被手动销毁", this);
163
             GC.SuppressFinalize(this);
165
             GC.SuppressFinalize(this);
164
         }
166
         }
165
 
167
 
166
-        private bool disposed;
168
+        private bool _disposed;
169
+
167
         protected void Dispose(bool disposing)
170
         protected void Dispose(bool disposing)
168
         {
171
         {
169
             //Console.WriteLine("{0}被自动销毁", this);
172
             //Console.WriteLine("{0}被自动销毁", this);
170
-            if (!disposed)
173
+            if (!_disposed)
171
             {
174
             {
172
                 if (disposing)
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
                 Foreground="#919191"
42
                 Foreground="#919191"
43
                 Text="删除" />
43
                 Text="删除" />
44
             <TextBlock
44
             <TextBlock
45
-                x:Name="txbName"
45
+                x:Name="TxbName"
46
                 FontSize="18"
46
                 FontSize="18"
47
                 Foreground="#919191"
47
                 Foreground="#919191"
48
                 Text="微课01" />
48
                 Text="微课01" />
54
             HorizontalAlignment="Right"
54
             HorizontalAlignment="Right"
55
             Orientation="Horizontal">
55
             Orientation="Horizontal">
56
             <Border
56
             <Border
57
-                x:Name="borCancel"
57
+                x:Name="BorCancel"
58
                 Background="#E5E5E5"
58
                 Background="#E5E5E5"
59
                 CornerRadius="6">
59
                 CornerRadius="6">
60
                 <Button
60
                 <Button
61
-                    x:Name="btnCancel"
61
+                    x:Name="BtnCancel"
62
                     Width="104"
62
                     Width="104"
63
                     Height="42"
63
                     Height="42"
64
                     Background="Transparent"
64
                     Background="Transparent"

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

4
 namespace XHWK.WKTool
4
 namespace XHWK.WKTool
5
 {
5
 {
6
     /// <summary>
6
     /// <summary>
7
-    /// PromptWindow.xaml 的交互逻辑
7
+    ///     PromptWindow.xaml 的交互逻辑
8
     /// </summary>
8
     /// </summary>
9
-    public partial class PromptWindow : Window
9
+    public partial class PromptWindow
10
     {
10
     {
11
         public PromptWindow()
11
         public PromptWindow()
12
         {
12
         {
13
             InitializeComponent();
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
         private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
21
         private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
20
         {
22
         {
21
             System.Windows.Rect r = new System.Windows.Rect(e.NewSize);
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
             ((UIElement)sender).Clip = gm;
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
-<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
     <FontFamily x:Key="QuartzRegular">../Resources/#QuartzRegular</FontFamily>
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
                     Grid.Column="3">
146
                     Grid.Column="3">
147
                     <Label
147
                     <Label
148
                         x:Name="TxbTime"
148
                         x:Name="TxbTime"
149
-                        Grid.Column="1"
150
                         Padding="0"
149
                         Padding="0"
151
                         HorizontalContentAlignment="Center"
150
                         HorizontalContentAlignment="Center"
152
                         VerticalContentAlignment="Center"
151
                         VerticalContentAlignment="Center"
192
                     </Button>
191
                     </Button>
193
                     <!--  选中  -->
192
                     <!--  选中  -->
194
                     <Button
193
                     <Button
195
-                        x:Name="BtnPenBlue_CL"
194
+                        x:Name="BtnPenBlueCl"
196
                         Click="BtnBrush_Click"
195
                         Click="BtnBrush_Click"
197
                         Cursor="Hand"
196
                         Cursor="Hand"
198
                         ToolTip="蓝笔"
197
                         ToolTip="蓝笔"
227
                     </Button>
226
                     </Button>
228
                     <!--  选中  -->
227
                     <!--  选中  -->
229
                     <Button
228
                     <Button
230
-                        x:Name="BtnPenRed_CL"
229
+                        x:Name="BtnPenRedCl"
231
                         Click="BtnBlackPenTwo_Click"
230
                         Click="BtnBlackPenTwo_Click"
232
                         Cursor="Hand"
231
                         Cursor="Hand"
233
                         ToolTip="批注"
232
                         ToolTip="批注"
277
             </Grid>
276
             </Grid>
278
         </Grid>
277
         </Grid>
279
     </Grid>
278
     </Grid>
280
-</Window>
279
+</Window>

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

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

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

52
         <ControlTemplate.Triggers>
52
         <ControlTemplate.Triggers>
53
             <Trigger Property="IsMouseOver" Value="True">
53
             <Trigger Property="IsMouseOver" Value="True">
54
                 <Setter TargetName="ImgSetUp" Property="Source" Value="/SkinImages/TechnologyBlue/HM_Close_MI.png" />
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
             </Trigger>
56
             </Trigger>
57
         </ControlTemplate.Triggers>
57
         </ControlTemplate.Triggers>
58
     </ControlTemplate>
58
     </ControlTemplate>
80
         <ControlTemplate.Triggers>
80
         <ControlTemplate.Triggers>
81
             <Trigger Property="IsMouseOver" Value="True">
81
             <Trigger Property="IsMouseOver" Value="True">
82
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_MI.png" />
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
             </Trigger>
84
             </Trigger>
85
             <Trigger Property="IsPressed" Value="True">
85
             <Trigger Property="IsPressed" Value="True">
86
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_MI.png" />
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
             </Trigger>
88
             </Trigger>
89
             <Trigger Property="IsEnabled" Value="False">
89
             <Trigger Property="IsEnabled" Value="False">
90
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_N.png" />
90
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_N.png" />
115
         <ControlTemplate.Triggers>
115
         <ControlTemplate.Triggers>
116
             <Trigger Property="IsMouseOver" Value="True">
116
             <Trigger Property="IsMouseOver" Value="True">
117
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_MI.png" />
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
             </Trigger>
119
             </Trigger>
120
             <Trigger Property="IsPressed" Value="True">
120
             <Trigger Property="IsPressed" Value="True">
121
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_MI.png" />
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
             </Trigger>
123
             </Trigger>
124
             <Trigger Property="IsEnabled" Value="False">
124
             <Trigger Property="IsEnabled" Value="False">
125
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_N.png" />
125
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_N.png" />
150
         <ControlTemplate.Triggers>
150
         <ControlTemplate.Triggers>
151
             <Trigger Property="IsMouseOver" Value="True">
151
             <Trigger Property="IsMouseOver" Value="True">
152
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_MI.png" />
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
             </Trigger>
154
             </Trigger>
155
             <Trigger Property="IsPressed" Value="True">
155
             <Trigger Property="IsPressed" Value="True">
156
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_MI.png" />
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
             </Trigger>
158
             </Trigger>
159
             <Trigger Property="IsEnabled" Value="False">
159
             <Trigger Property="IsEnabled" Value="False">
160
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_N.png" />
160
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_N.png" />

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

78
         <ControlTemplate.Triggers>
78
         <ControlTemplate.Triggers>
79
             <Trigger Property="IsMouseOver" Value="True">
79
             <Trigger Property="IsMouseOver" Value="True">
80
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/White/Toolbar_LZ_MI.png" />
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
             </Trigger>
82
             </Trigger>
83
             <Trigger Property="IsPressed" Value="True">
83
             <Trigger Property="IsPressed" Value="True">
84
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/White/Toolbar_LZ_MI.png" />
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
             </Trigger>
86
             </Trigger>
87
             <Trigger Property="IsEnabled" Value="False">
87
             <Trigger Property="IsEnabled" Value="False">
88
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/White/Toolbar_LZ_N.png" />
88
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/White/Toolbar_LZ_N.png" />
113
         <ControlTemplate.Triggers>
113
         <ControlTemplate.Triggers>
114
             <Trigger Property="IsMouseOver" Value="True">
114
             <Trigger Property="IsMouseOver" Value="True">
115
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/White/Toolbar_LZZT_MI.png" />
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
             </Trigger>
117
             </Trigger>
118
             <Trigger Property="IsPressed" Value="True">
118
             <Trigger Property="IsPressed" Value="True">
119
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/White/Toolbar_LZZT_MI.png" />
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
             </Trigger>
121
             </Trigger>
122
             <Trigger Property="IsEnabled" Value="False">
122
             <Trigger Property="IsEnabled" Value="False">
123
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/White/Toolbar_LZZT_N.png" />
123
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/White/Toolbar_LZZT_N.png" />
148
         <ControlTemplate.Triggers>
148
         <ControlTemplate.Triggers>
149
             <Trigger Property="IsMouseOver" Value="True">
149
             <Trigger Property="IsMouseOver" Value="True">
150
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/White/Toolbar_Save_MI.png" />
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
             </Trigger>
152
             </Trigger>
153
             <Trigger Property="IsPressed" Value="True">
153
             <Trigger Property="IsPressed" Value="True">
154
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/White/Toolbar_Save_MI.png" />
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
             </Trigger>
156
             </Trigger>
157
             <Trigger Property="IsEnabled" Value="False">
157
             <Trigger Property="IsEnabled" Value="False">
158
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/White/Toolbar_Save_N.png" />
158
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/White/Toolbar_Save_N.png" />

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

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

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

15
 namespace XHWK.WKTool
15
 namespace XHWK.WKTool
16
 {
16
 {
17
     /// <summary>
17
     /// <summary>
18
-    /// UploadWindow.xaml 的交互逻辑
18
+    ///     UploadWindow.xaml 的交互逻辑
19
     /// </summary>
19
     /// </summary>
20
     public partial class UploadWindow
20
     public partial class UploadWindow
21
     {
21
     {
22
         /// <summary>
22
         /// <summary>
23
-        /// 调用接口
23
+        ///     调用接口
24
         /// </summary>
24
         /// </summary>
25
         private readonly XhApi _xhapi = new XhApi();
25
         private readonly XhApi _xhapi = new XhApi();
26
 
26
 
27
         /// <summary>
27
         /// <summary>
28
-        /// 前台数据
28
+        ///     前台数据
29
         /// </summary>
29
         /// </summary>
30
         internal LoginPageData pageData = new LoginPageData();
30
         internal LoginPageData pageData = new LoginPageData();
31
 
31
 
32
         /// <summary>
32
         /// <summary>
33
-        /// 文件名
33
+        ///     文件名
34
         /// </summary>
34
         /// </summary>
35
         private string _resourcename = string.Empty;
35
         private string _resourcename = string.Empty;
36
 
36
 
37
         /// <summary>
37
         /// <summary>
38
-        /// 文件大小
38
+        ///     文件大小
39
         /// </summary>
39
         /// </summary>
40
         private long _resourcesize;
40
         private long _resourcesize;
41
 
41
 
42
         /// <summary>
42
         /// <summary>
43
-        /// 文件类型
43
+        ///     文件类型
44
         /// </summary>
44
         /// </summary>
45
         private string _suffix = string.Empty;
45
         private string _suffix = string.Empty;
46
 
46
 
47
         /// <summary>
47
         /// <summary>
48
-        /// 唯一编号
48
+        ///     唯一编号
49
         /// </summary>
49
         /// </summary>
50
         private string _guid = string.Empty;
50
         private string _guid = string.Empty;
51
 
51
 
53
         public event ChangeTextHandlers ResultEvents;
53
         public event ChangeTextHandlers ResultEvents;
54
 
54
 
55
         /// <summary>
55
         /// <summary>
56
-        /// 当前视频的下标
56
+        ///     当前视频的下标
57
         /// </summary>
57
         /// </summary>
58
         private int _i;
58
         private int _i;
59
 
59
 
65
         }
65
         }
66
 
66
 
67
         /// <summary>
67
         /// <summary>
68
-        /// 初始化
68
+        ///     初始化
69
         /// </summary>
69
         /// </summary>
70
         public void Initialize
70
         public void Initialize
71
         (
71
         (
76
             int m
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
             Tsubjectbook();
85
             Tsubjectbook();
86
         }
86
         }
87
 
87
 
88
         /// <summary>
88
         /// <summary>
89
-        /// 教材接口调用
89
+        ///     教材接口调用
90
         /// </summary>
90
         /// </summary>
91
         /// <returns>
91
         /// <returns>
92
         /// </returns>
92
         /// </returns>
97
             {
97
             {
98
                 for (int i = 0; i < App.TsubjectbookList.Count; i++)
98
                 for (int i = 0; i < App.TsubjectbookList.Count; i++)
99
                 {
99
                 {
100
-                    pageData.bookList.Add
101
-                    (
100
+                    pageData.bookList.Add(
102
                         new ComboBoxBean()
101
                         new ComboBoxBean()
103
                         {
102
                         {
104
                             Key = App.TsubjectbookList[i].Lsbid,
103
                             Key = App.TsubjectbookList[i].Lsbid,
107
                         }
106
                         }
108
                     );
107
                     );
109
                 }
108
                 }
110
-                book_list.SelectedIndex = 0;
109
+                BookList.SelectedIndex = 0;
111
                 DataContext = pageData;
110
                 DataContext = pageData;
112
                 if (App.TsubjectbookList.Count > 0)
111
                 if (App.TsubjectbookList.Count > 0)
113
                 {
112
                 {
128
         }
127
         }
129
 
128
 
130
         /// <summary>
129
         /// <summary>
131
-        /// 章节接口调用
130
+        ///     章节接口调用
132
         /// </summary>
131
         /// </summary>
133
         private void Director()
132
         private void Director()
134
         {
133
         {
135
-            int selectIndex = book_list.SelectedIndex;
134
+            int selectIndex = BookList.SelectedIndex;
136
             if (selectIndex < 0)
135
             if (selectIndex < 0)
137
             {
136
             {
138
                 selectIndex = 0;
137
                 selectIndex = 0;
139
             }
138
             }
140
             if (App.TsubjectbookList.Count > selectIndex)
139
             if (App.TsubjectbookList.Count > selectIndex)
141
             {
140
             {
142
-                int code = _xhapi.DirectorList
143
-                (
141
+                int code = _xhapi.DirectorList(
144
                     App.TsubjectbookList[selectIndex].Lsbid,
142
                     App.TsubjectbookList[selectIndex].Lsbid,
145
                     4,
143
                     4,
146
                     App.UserInfo.Userid
144
                     App.UserInfo.Userid
148
                 if (code == 0)
146
                 if (code == 0)
149
                 {
147
                 {
150
                     pageData.zhangjieList.Clear();
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
                         AddChild(item);
159
                         AddChild(item);
155
                     }
160
                     }
156
-                    cmbTeachingMaterial.SelectedIndex = 0;
161
+                    CmbTeachingMaterial.SelectedIndex = 0;
157
                 }
162
                 }
158
                 else
163
                 else
159
                 {
164
                 {
163
         }
168
         }
164
 
169
 
165
         /// <summary>
170
         /// <summary>
166
-        /// 子章节递归
171
+        ///     子章节递归
167
         /// </summary>
172
         /// </summary>
168
         /// <param name="directorList">
173
         /// <param name="directorList">
169
         /// </param>
174
         /// </param>
173
             {
178
             {
174
                 foreach (ModelDirectorList child in directorList.children)
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
                     if (child.children != null && child.children.Count > 0)
189
                     if (child.children != null && child.children.Count > 0)
178
                     {
190
                     {
179
                         AddChild(child);
191
                         AddChild(child);
183
         }
195
         }
184
 
196
 
185
         /// <summary>
197
         /// <summary>
186
-        /// 章节是否加空格符
198
+        ///     章节是否加空格符
187
         /// </summary>
199
         /// </summary>
188
         /// <param name="num">
200
         /// <param name="num">
189
         /// </param>
201
         /// </param>
213
         }
225
         }
214
 
226
 
215
         /// <summary>
227
         /// <summary>
216
-        /// 教材下拉框改变事件
228
+        ///     教材下拉框改变事件
217
         /// </summary>
229
         /// </summary>
218
         /// <param name="sender">
230
         /// <param name="sender">
219
         /// </param>
231
         /// </param>
240
         }
252
         }
241
 
253
 
242
         /// <summary>
254
         /// <summary>
243
-        /// 上传到个人空间
255
+        ///     上传到个人空间
244
         /// </summary>
256
         /// </summary>
245
         /// <param name="sender">
257
         /// <param name="sender">
246
         /// </param>
258
         /// </param>
248
         /// </param>
260
         /// </param>
249
         private void BtnStart_Click(object sender, RoutedEventArgs e)
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
                 MessageWindow.Show("请选择教材!");
265
                 MessageWindow.Show("请选择教材!");
254
                 return;
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
                 if (leaf != 1)
271
                 if (leaf != 1)
261
                 {
272
                 {
262
                     MessageWindow.Show("只能选择小节或全部进行上传!");
273
                     MessageWindow.Show("只能选择小节或全部进行上传!");
263
                     return;
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
             Thread myThread = new Thread(StartUpload);
280
             Thread myThread = new Thread(StartUpload);
271
             _num = 0;
281
             _num = 0;
272
-            tip_outer.Visibility = Visibility.Visible;
282
+            TipOuter.Visibility = Visibility.Visible;
273
             myThread.Start();
283
             myThread.Start();
274
             _times = new System.Timers.Timer(100);
284
             _times = new System.Timers.Timer(100);
275
             _times.Elapsed += Times_ElapsedClick;
285
             _times.Elapsed += Times_ElapsedClick;
302
                     //suffix: "mp4"
312
                     //suffix: "mp4"
303
                     //uid: 80
313
                     //uid: 80
304
                     ModelResourceAdd modelResourceAdd = new ModelResourceAdd();
314
                     ModelResourceAdd modelResourceAdd = new ModelResourceAdd();
305
-                    Dispatcher.Invoke
306
-                    (
315
+                    Dispatcher.Invoke(
307
                         () =>
316
                         () =>
308
                         {
317
                         {
309
                             modelResourceAdd = new ModelResourceAdd
318
                             modelResourceAdd = new ModelResourceAdd
310
                             {
319
                             {
311
                                 converted = 0,
320
                                 converted = 0,
312
                                 createid = App.UserInfo.Userid,
321
                                 createid = App.UserInfo.Userid,
313
-                                directorid = cmbTeachingMaterial.SelectedValue.ToString(),
322
+                                directorid = CmbTeachingMaterial.SelectedValue.ToString(),
314
                                 duration = App.ResourceAddTwo.duration,
323
                                 duration = App.ResourceAddTwo.duration,
315
-                                subjectid = App.TsubjectbookList[book_list.SelectedIndex].Subjectid,
324
+                                subjectid = App.TsubjectbookList[BookList.SelectedIndex].Subjectid,
316
                                 imgUrl = "",
325
                                 imgUrl = "",
317
                                 level = 2,
326
                                 level = 2,
318
-                                lsbid = book_list.SelectedValue.ToString(),
327
+                                lsbid = BookList.SelectedValue.ToString(),
319
                                 mp4code = App.ResourceAddTwo.mp4code,
328
                                 mp4code = App.ResourceAddTwo.mp4code,
320
                                 resourcebelong = 3,
329
                                 resourcebelong = 3,
321
                                 resourceclass = 5,
330
                                 resourceclass = 5,
345
                     int code = _xhapi.ResourceAdd(modelResourceAdd);
354
                     int code = _xhapi.ResourceAdd(modelResourceAdd);
346
                     if (code == 0)
355
                     if (code == 0)
347
                     {
356
                     {
348
-                        Dispatcher.Invoke
349
-                        (
357
+                        Dispatcher.Invoke(
350
                             () =>
358
                             () =>
351
                             {
359
                             {
352
                                 foreach (ModelWkData vdata in App.WKDataList)
360
                                 foreach (ModelWkData vdata in App.WKDataList)
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
                                 _num = 99;
378
                                 _num = 99;
371
                                 _times.Stop();
379
                                 _times.Stop();
372
-                                pgbProcess.Value = 100;
373
-                                lbProcess.Content = "100%";
380
+                                PgbProcess.Value = 100;
381
+                                LbProcess.Content = "100%";
374
                                 Hide();
382
                                 Hide();
375
-                                tip_outer.Visibility = Visibility.Collapsed;
383
+                                TipOuter.Visibility = Visibility.Collapsed;
376
                                 MessageWindow.Show("视频上传成功!");
384
                                 MessageWindow.Show("视频上传成功!");
377
                                 if (ResultEvents != null)
385
                                 if (ResultEvents != null)
378
                                 {
386
                                 {
383
                     }
391
                     }
384
                     else
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
                                 _times.Stop();
400
                                 _times.Stop();
394
-                                tip_outer.Visibility = Visibility.Collapsed;
401
+                                TipOuter.Visibility = Visibility.Collapsed;
395
                                 MessageWindow.Show(App.ServerMsg);
402
                                 MessageWindow.Show(App.ServerMsg);
396
                             }
403
                             }
397
                         );
404
                         );
399
                 }
406
                 }
400
                 else
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
                             _times.Stop();
415
                             _times.Stop();
410
-                            tip_outer.Visibility = Visibility.Collapsed;
416
+                            TipOuter.Visibility = Visibility.Collapsed;
411
                             MessageWindow.Show(errMessage);
417
                             MessageWindow.Show(errMessage);
412
                         }
418
                         }
413
                     );
419
                     );
415
             }
421
             }
416
             catch (Exception ex)
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
         private int _num;
441
         private int _num;
434
 
442
 
435
         /// <summary>
443
         /// <summary>
436
-        /// 计时器
444
+        ///     计时器
437
         /// </summary>
445
         /// </summary>
438
         /// <param name="sender">
446
         /// <param name="sender">
439
         /// </param>
447
         /// </param>
441
         /// </param>
449
         /// </param>
442
         private void Times_ElapsedClick(object sender, System.Timers.ElapsedEventArgs e)
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
             zhangjieList = new ObservableCollection<ComboBoxBean>();
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
-<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
     ShowInTaskbar="True"
14
     ShowInTaskbar="True"
10
     WindowStartupLocation="CenterScreen"
15
     WindowStartupLocation="CenterScreen"
11
-    WindowStyle="None"  BorderThickness="7"  ResizeMode="CanMinimize" Height="1036" Width="1290" >
16
+    WindowStyle="None"
17
+    mc:Ignorable="d">
12
     <Window.Effect>
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
     </Window.Effect>
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
         <Grid.RowDefinitions>
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
         </Grid.RowDefinitions>
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
         </Grid>
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
             <!--<Button Name="LeftButton" Width="50" Height="50" HorizontalAlignment="Left" VerticalAlignment="Center" Click="Left_Click" Visibility="Hidden" Margin="0,147">上一个</Button>
67
             <!--<Button Name="LeftButton" Width="50" Height="50" HorizontalAlignment="Left" VerticalAlignment="Center" Click="Left_Click" Visibility="Hidden" Margin="0,147">上一个</Button>
276
             <Button Name="RightButton" Width="50" Height="50" HorizontalAlignment="Right" VerticalAlignment="Center" Click="Right_Click" Visibility="Hidden" Grid.Column="1" Margin="0,147">下一个</Button>-->
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
         </Grid>
69
         </Grid>
278
         <!--<StackPanel Grid.Row="2" Orientation="Horizontal">-->
70
         <!--<StackPanel Grid.Row="2" Orientation="Horizontal">-->
279
         <Grid Grid.Row="2">
71
         <Grid Grid.Row="2">
280
             <Grid.ColumnDefinitions>
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
             </Grid.ColumnDefinitions>
76
             </Grid.ColumnDefinitions>
285
             <Grid Grid.Column="0">
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
                     <StackPanel Orientation="Vertical">
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
                     </StackPanel>
94
                     </StackPanel>
291
                 </Button>
95
                 </Button>
292
-                <!--<Button Height="40" Width="40" x:Name="Pause" Click="Pause_Click" Margin="45,0,0,0">暂停</Button>-->
96
+
293
             </Grid>
97
             </Grid>
294
             <!--<Grid Grid.Row="0" Grid.Column="1">
98
             <!--<Grid Grid.Row="0" Grid.Column="1">
295
                 <Slider x:Name="timelineSlider" Minimum="0" VerticalAlignment="Center"  PreviewMouseLeftButtonDown="timelineMDown"  PreviewMouseLeftButtonUp="timelineMUp" BorderThickness="0,5,0,0" />
99
                 <Slider x:Name="timelineSlider" Minimum="0" VerticalAlignment="Center"  PreviewMouseLeftButtonDown="timelineMDown"  PreviewMouseLeftButtonUp="timelineMUp" BorderThickness="0,5,0,0" />
297
             <Grid Grid.Row="1" Grid.Column="1">
101
             <Grid Grid.Row="1" Grid.Column="1">
298
                 <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"/>
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
             </Grid>-->
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
             </Grid>
127
             </Grid>
304
         </Grid>
128
         </Grid>
305
         <!--</StackPanel>-->
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
             <Grid.RowDefinitions>
134
             <Grid.RowDefinitions>
308
-                <RowDefinition Height="53*"/>
309
-                <RowDefinition Height="100*"/>
135
+                <RowDefinition Height="53*" />
136
+                <RowDefinition Height="100*" />
310
             </Grid.RowDefinitions>
137
             </Grid.RowDefinitions>
311
             <Grid.ColumnDefinitions>
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
             </Grid.ColumnDefinitions>
144
             </Grid.ColumnDefinitions>
318
             <Grid Grid.Row="0" Grid.Column="1">
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
             </Grid>
151
             </Grid>
321
             <Grid Grid.Row="0" Grid.Column="2">
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
                 </StackPanel>
203
                 </StackPanel>
332
             </Grid>
204
             </Grid>
333
-            <Grid Grid.Row="0" Grid.Column="3" >
205
+            <Grid Grid.Row="0" Grid.Column="3">
334
                 <Grid.ColumnDefinitions>
206
                 <Grid.ColumnDefinitions>
335
-                    <ColumnDefinition Width="30*"/>
336
-                    <ColumnDefinition Width="120*"/>
207
+                    <ColumnDefinition Width="30*" />
208
+                    <ColumnDefinition Width="120*" />
337
                 </Grid.ColumnDefinitions>
209
                 </Grid.ColumnDefinitions>
338
                 <Grid.RowDefinitions>
210
                 <Grid.RowDefinitions>
339
-                    <RowDefinition Height="27*"/>
340
-                    <RowDefinition Height="27*"/>
211
+                    <RowDefinition Height="27*" />
212
+                    <RowDefinition Height="27*" />
341
                 </Grid.RowDefinitions>
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
             </Grid>
230
             </Grid>
347
             <Grid Grid.Row="1" Grid.Column="2">
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
                     <Button.Template>
242
                     <Button.Template>
351
                         <ControlTemplate TargetType="{x:Type Button}">
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
                             </Border>
254
                             </Border>
356
                         </ControlTemplate>
255
                         </ControlTemplate>
357
                     </Button.Template>
256
                     </Button.Template>

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

1
-using Common.system;
2
-
3
-using System;
1
+using System;
4
 using System.Text.RegularExpressions;
2
 using System.Text.RegularExpressions;
5
 using System.Windows;
3
 using System.Windows;
6
 using System.Windows.Input;
4
 using System.Windows.Input;
11
     using system;
9
     using system;
12
 
10
 
13
     /// <summary>
11
     /// <summary>
14
-    /// 视频剪辑
15
-    /// VideoClipWindow.xaml 的交互逻辑
12
+    ///     视频剪辑
13
+    ///     VideoClipWindow.xaml 的交互逻辑
16
     /// </summary>
14
     /// </summary>
17
-    public partial class VideoClipWindow : Window
15
+    public partial class VideoClipWindow
18
     {
16
     {
19
         /// <summary>
17
         /// <summary>
20
-        /// 视频地址
18
+        ///     视频地址
21
         /// </summary>
19
         /// </summary>
22
-        string VideoPath;
20
+        string _videoPath;
21
+
23
         /// <summary>
22
         /// <summary>
24
-        /// 视频剪辑
23
+        ///     视频剪辑
25
         /// </summary>
24
         /// </summary>
26
         public VideoClipWindow()
25
         public VideoClipWindow()
27
         {
26
         {
29
             Width = App.W_XHMicroLessonSystemWindow.ActualWidth;
28
             Width = App.W_XHMicroLessonSystemWindow.ActualWidth;
30
             Height = App.W_XHMicroLessonSystemWindow.ActualHeight;
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
                 if (gridWidth <= GridMovie.ActualWidth)
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
                 else
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
                 DataContext = App.PageContextData;
50
                 DataContext = App.PageContextData;
52
             }
51
             }
56
             }
55
             }
57
             return true;
56
             return true;
58
         }
57
         }
58
+
59
         /// <summary>
59
         /// <summary>
60
-        /// 计时器
60
+        ///     计时器
61
         /// </summary>
61
         /// </summary>
62
-        DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); // 定义一个DT
62
+        DispatcherTimer _dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); // 定义一个DT
63
 
63
 
64
         /// <summary>
64
         /// <summary>
65
-        /// 播放/暂停
65
+        ///     播放/暂停
66
         /// </summary>
66
         /// </summary>
67
         /// <param name="sender"></param>
67
         /// <param name="sender"></param>
68
         /// <param name="e"></param>
68
         /// <param name="e"></param>
69
         private void Play_Click(object sender, RoutedEventArgs e)
69
         private void Play_Click(object sender, RoutedEventArgs e)
70
         {
70
         {
71
-            if (IsPlay)
71
+            if (_isPlay)
72
             {
72
             {
73
                 MoviePause();
73
                 MoviePause();
74
             }
74
             }
77
                 MoviePlay();
77
                 MoviePlay();
78
             }
78
             }
79
         }
79
         }
80
+
80
         /// <summary>
81
         /// <summary>
81
-        /// 正在播放
82
+        ///     正在播放
82
         /// </summary>
83
         /// </summary>
83
-        bool IsPlay = false;
84
+        bool _isPlay;
85
+
84
         /// <summary>
86
         /// <summary>
85
-        /// 播放
87
+        ///     播放
86
         /// </summary>
88
         /// </summary>
87
         public void MoviePlay()
89
         public void MoviePlay()
88
         {
90
         {
89
-            IsPlay = true;
91
+            _isPlay = true;
90
             ImgPlay.Visibility = Visibility.Collapsed;
92
             ImgPlay.Visibility = Visibility.Collapsed;
91
             ImgPause.Visibility = Visibility.Visible;
93
             ImgPause.Visibility = Visibility.Visible;
92
-            QS_Movie.Play();
94
+            QsMovie.Play();
93
         }
95
         }
96
+
94
         /// <summary>
97
         /// <summary>
95
-        /// 暂停
98
+        ///     暂停
96
         /// </summary>
99
         /// </summary>
97
         public void MoviePause()
100
         public void MoviePause()
98
         {
101
         {
99
-            IsPlay = false;
102
+            _isPlay = false;
100
             ImgPlay.Visibility = Visibility.Visible;
103
             ImgPlay.Visibility = Visibility.Visible;
101
             ImgPause.Visibility = Visibility.Collapsed;
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
         /// <summary>
108
         /// <summary>
114
-        /// slider滑动值随播放内容位置变化
109
+        ///     slider滑动值随播放内容位置变化
115
         /// </summary>
110
         /// </summary>
116
         /// <param name="sender"></param>
111
         /// <param name="sender"></param>
117
         /// <param name="e"></param>
112
         /// <param name="e"></param>
118
         private void dispatcherTimer_Tick(object sender, EventArgs e)
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
         /// <summary>
125
         /// <summary>
124
-        /// 拖动进度条
126
+        ///     拖动进度条
125
         /// </summary>
127
         /// </summary>
126
         /// <param name="sender"></param>
128
         /// <param name="sender"></param>
127
         /// <param name="e"></param>
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
         /// <summary>
135
         /// <summary>
133
-        /// 拖动进度条
136
+        ///     拖动进度条
134
         /// </summary>
137
         /// </summary>
135
         /// <param name="sender"></param>
138
         /// <param name="sender"></param>
136
         /// <param name="e"></param>
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
             MoviePlay();
150
             MoviePlay();
142
         }
151
         }
143
 
152
 
144
         /// <summary>
153
         /// <summary>
145
-        /// 加载视频
154
+        ///     加载视频
146
         /// </summary>
155
         /// </summary>
147
         /// <param name="sender"></param>
156
         /// <param name="sender"></param>
148
         /// <param name="e"></param>
157
         /// <param name="e"></param>
149
         private void QS_Movie_Loaded(object sender, RoutedEventArgs e)
158
         private void QS_Movie_Loaded(object sender, RoutedEventArgs e)
150
         {
159
         {
151
             //GridMovie.Height
160
             //GridMovie.Height
152
-            UcSlider.SilderWidth = (int)timelineSlider.ActualWidth;
161
+            UcSlider.SilderWidth = (int)TimelineSlider.ActualWidth;
153
             MoviePlay();
162
             MoviePlay();
154
-            while (QS_Movie.NaturalVideoWidth == 0)
163
+            while (QsMovie.NaturalVideoWidth == 0)
155
             {
164
             {
156
                 System.Threading.Thread.Sleep(50);
165
                 System.Threading.Thread.Sleep(50);
157
             }
166
             }
158
-
159
             MoviePause();
167
             MoviePause();
160
 
168
 
161
             //new Thread(new ThreadStart(new Action(() =>
169
             //new Thread(new ThreadStart(new Action(() =>
165
             //});
173
             //});
166
             //}))).Start();
174
             //}))).Start();
167
         }
175
         }
176
+
168
         /// <summary>
177
         /// <summary>
169
-        /// 关闭
178
+        ///     关闭
170
         /// </summary>
179
         /// </summary>
171
         /// <param name="sender"></param>
180
         /// <param name="sender"></param>
172
         /// <param name="e"></param>
181
         /// <param name="e"></param>
173
         private void Button_Click(object sender, RoutedEventArgs e)
182
         private void Button_Click(object sender, RoutedEventArgs e)
174
         {
183
         {
175
             //this.Close();
184
             //this.Close();
176
-            QS_Movie.Stop();
177
-            IsPlay = false;
185
+            QsMovie.Stop();
186
+            _isPlay = false;
178
             ImgPlay.Visibility = Visibility.Visible;
187
             ImgPlay.Visibility = Visibility.Visible;
179
             ImgPause.Visibility = Visibility.Collapsed;
188
             ImgPause.Visibility = Visibility.Collapsed;
180
             UcSlider.StartValue = 0;
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
         private void UcSlider_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
197
         private void UcSlider_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
187
         {
198
         {
188
             //dispatcherTimer.Stop();
199
             //dispatcherTimer.Stop();
189
-            statime = UcSlider.StartValue;
200
+            _statime = UcSlider.StartValue;
190
         }
201
         }
191
 
202
 
192
         private void UcSlider_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
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
                 UcSlider_PreviewMouseMove(null, null);
217
                 UcSlider_PreviewMouseMove(null, null);
201
                 MoviePlay();
218
                 MoviePlay();
202
             }
219
             }
204
 
221
 
205
         private void UcSlider_PreviewMouseMove(object sender, MouseEventArgs e)
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
             //LblStartTime.Content = new TimeSpan(0, 0, 0, 0, (int)UcSlider.StartValue).ToString(@"hh\:mm\:ss");
245
             //LblStartTime.Content = new TimeSpan(0, 0, 0, 0, (int)UcSlider.StartValue).ToString(@"hh\:mm\:ss");
211
             //LblEndTime.Content = new TimeSpan(0, 0, 0, 0, (int)UcSlider.EndValue).ToString(@"hh\:mm\:ss");
246
             //LblEndTime.Content = new TimeSpan(0, 0, 0, 0, (int)UcSlider.EndValue).ToString(@"hh\:mm\:ss");
212
             //LblVideoTime.Content = new TimeSpan(0, 0, 0, 0, ((int)(UcSlider.EndValue - (UcSlider.EndValue % 1000)) - (int)(UcSlider.StartValue - (UcSlider.StartValue % 1000)))).ToString(@"hh\:mm\:ss");
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
         /// <summary>
250
         /// <summary>
217
-        /// 剪辑
251
+        ///     剪辑
218
         /// </summary>
252
         /// </summary>
219
         /// <param name="sender"></param>
253
         /// <param name="sender"></param>
220
         /// <param name="e"></param>
254
         /// <param name="e"></param>
225
                 MessageWindow.Show("剪辑时间不得小于1秒!");
259
                 MessageWindow.Show("剪辑时间不得小于1秒!");
226
                 return;
260
                 return;
227
             }
261
             }
228
-            dispatcherTimer.Stop();
262
+            _dispatcherTimer.Stop();
229
             MoviePause();
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
             System.Windows.Forms.SaveFileDialog saveDg = new System.Windows.Forms.SaveFileDialog();
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
             //saveDg.FileName = tableName + DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss") + "";
268
             //saveDg.FileName = tableName + DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss") + "";
235
-            saveDg.FileName = FileName + "剪辑";
269
+            saveDg.FileName = fileName + "剪辑";
236
             saveDg.AddExtension = true;
270
             saveDg.AddExtension = true;
237
             saveDg.RestoreDirectory = true;
271
             saveDg.RestoreDirectory = true;
238
             if (saveDg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
272
             if (saveDg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
239
             {
273
             {
240
                 string filePath = saveDg.FileName;
274
                 string filePath = saveDg.FileName;
241
                 //duration.ToString(@"dd\.hh\:mm\:ss");
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
                     startTime,
294
                     startTime,
250
-                    EndTime,
295
+                    endTime,
251
                     filePath
296
                     filePath
252
                 );
297
                 );
253
-                MessageBoxResult br = MessageWindow.Show("剪辑完成是否打开文件夹?", "剪辑", MessageBoxButton.OKCancel);
298
+                MessageBoxResult br = MessageWindow.Show(
299
+                    "剪辑完成是否打开文件夹?",
300
+                    "剪辑",
301
+                    MessageBoxButton.OKCancel
302
+                );
254
                 if (br == MessageBoxResult.OK)
303
                 if (br == MessageBoxResult.OK)
255
                 {
304
                 {
256
                     //System.Diagnostics.Process.Start(FileToolsCommon.GetDirectoryName(filePath));
305
                     //System.Diagnostics.Process.Start(FileToolsCommon.GetDirectoryName(filePath));
260
         }
309
         }
261
 
310
 
262
         /// <summary>
311
         /// <summary>
263
-        /// 输入开始时间
312
+        ///     输入开始时间
264
         /// </summary>
313
         /// </summary>
265
         /// <param name="sender"></param>
314
         /// <param name="sender"></param>
266
         /// <param name="e"></param>
315
         /// <param name="e"></param>
278
                 MessageWindow.Show("开始时间不能大于结束时间!");
327
                 MessageWindow.Show("开始时间不能大于结束时间!");
279
                 return;
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
                 MessageWindow.Show("剪辑时间不能小于1秒!");
332
                 MessageWindow.Show("剪辑时间不能小于1秒!");
284
                 return;
333
                 return;
285
             }
334
             }
286
             UcSlider.StartValue = time.TotalMilliseconds;
335
             UcSlider.StartValue = time.TotalMilliseconds;
287
-
288
             UcSlider_PreviewMouseLeftButtonUp(null, null);
336
             UcSlider_PreviewMouseLeftButtonUp(null, null);
289
         }
337
         }
338
+
290
         /// <summary>
339
         /// <summary>
291
-        /// 输入结束时间
340
+        ///     输入结束时间
292
         /// </summary>
341
         /// </summary>
293
         /// <param name="sender"></param>
342
         /// <param name="sender"></param>
294
         /// <param name="e"></param>
343
         /// <param name="e"></param>
311
                 MessageWindow.Show("剪辑时间不能小于1秒!");
360
                 MessageWindow.Show("剪辑时间不能小于1秒!");
312
                 return;
361
                 return;
313
             }
362
             }
314
-            if (time.TotalMilliseconds > QS_Movie.NaturalDuration.TimeSpan.TotalMilliseconds)
363
+            if (time.TotalMilliseconds > QsMovie.NaturalDuration.TimeSpan.TotalMilliseconds)
315
             {
364
             {
316
                 MessageWindow.Show("结束时间不能超出视频总时长!");
365
                 MessageWindow.Show("结束时间不能超出视频总时长!");
317
                 return;
366
                 return;
318
             }
367
             }
319
             UcSlider.EndValue = time.TotalMilliseconds;
368
             UcSlider.EndValue = time.TotalMilliseconds;
320
-
321
             UcSlider_PreviewMouseLeftButtonUp(null, null);
369
             UcSlider_PreviewMouseLeftButtonUp(null, null);
322
         }
370
         }
371
+
323
         /// <summary>
372
         /// <summary>
324
-        /// string转TimeSpan
373
+        ///     string转TimeSpan
325
         /// </summary>
374
         /// </summary>
326
         /// <param name="str"></param>
375
         /// <param name="str"></param>
327
         /// <returns></returns>
376
         /// <returns></returns>
360
             }
409
             }
361
             catch (Exception)
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
         /// <summary>
423
         /// <summary>
368
-        /// 判断是否为时间格式
424
+        ///     判断是否为时间格式
369
         /// </summary>
425
         /// </summary>
370
         /// <param name="str"></param>
426
         /// <param name="str"></param>
371
         /// <returns></returns>
427
         /// <returns></returns>
381
                 return false;
437
                 return false;
382
             }
438
             }
383
         }
439
         }
440
+
384
         /// <summary>
441
         /// <summary>
385
-        /// 鼠标点击移动
442
+        ///     鼠标点击移动
386
         /// </summary>
443
         /// </summary>
387
         /// <param name="sender"></param>
444
         /// <param name="sender"></param>
388
         /// <param name="e"></param>
445
         /// <param name="e"></param>
392
         }
449
         }
393
 
450
 
394
         /// <summary>
451
         /// <summary>
395
-        /// 启动定时器 同步进度条和视频进度
452
+        ///     启动定时器 同步进度条和视频进度
396
         /// </summary>
453
         /// </summary>
397
         /// <param name="sender"></param>
454
         /// <param name="sender"></param>
398
         /// <param name="e"></param>
455
         /// <param name="e"></param>
399
         private void Element_MediaOpened(object sender, RoutedEventArgs e)
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
             UcSlider.StartValue = 0;
460
             UcSlider.StartValue = 0;
404
-            UcSlider.EndValue = QS_Movie.NaturalDuration.TimeSpan.TotalMilliseconds;
461
+            UcSlider.EndValue = QsMovie.NaturalDuration.TimeSpan.TotalMilliseconds;
405
             UcSlider_PreviewMouseMove(null, null);
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
             #region 调整视频大小
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
             if (gridWidth <= GridMovie.ActualWidth)
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
             else
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
             #endregion
488
             #endregion
425
         }
489
         }
426
     }
490
     }
427
-}
491
+}

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

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
                 FocusVisualStyle="{x:Null}"
27
                 FocusVisualStyle="{x:Null}"
23
                 IsSelectionRangeEnabled="True"
28
                 IsSelectionRangeEnabled="True"
24
-                TickPlacement="TopLeft"
25
                 IsSnapToTickEnabled="True"
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
                 <Slider.Clip>
38
                 <Slider.Clip>
30
-                    <RectangleGeometry Rect="{Binding ElementName=UC_Arrange,Path=StartRect}" />
39
+                    <RectangleGeometry Rect="{Binding ElementName=UC_Arrange, Path=StartRect}" />
31
                 </Slider.Clip>
40
                 </Slider.Clip>
32
             </Slider>
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
                 FocusVisualStyle="{x:Null}"
47
                 FocusVisualStyle="{x:Null}"
42
                 IsSelectionRangeEnabled="True"
48
                 IsSelectionRangeEnabled="True"
43
-                TickPlacement="TopLeft"
44
                 IsSnapToTickEnabled="True"
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
                 <Slider.Clip>
58
                 <Slider.Clip>
49
-                    <RectangleGeometry Rect="{Binding ElementName=UC_Arrange,Path=EndRect}" />
59
+                    <RectangleGeometry Rect="{Binding ElementName=UC_Arrange, Path=EndRect}" />
50
                 </Slider.Clip>
60
                 </Slider.Clip>
51
             </Slider>
61
             </Slider>
52
         </Canvas>
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
     </StackPanel>
72
     </StackPanel>
58
 
73
 
59
 </UserControl>
74
 </UserControl>

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

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

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

3
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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"
6
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8
     Title="Welcome"
7
     Title="Welcome"
9
     Width="100"
8
     Width="100"

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

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

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

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

Loading…
Cancel
Save