Browse Source

删除废弃代码

tags/3.0.0
张剑 3 years ago
parent
commit
6b4955c5aa
41 changed files with 2187 additions and 4011 deletions
  1. 2
    0
      XHWK.Model/ComboBoxBean.cs
  2. 1
    1
      XHWK.Model/Model_DirectorList.cs
  3. 6
    6
      XHWK.WKTool/App.config
  4. 0
    805
      XHWK.WKTool/App.cs
  5. 7
    7
      XHWK.WKTool/App.xaml
  6. 666
    9
      XHWK.WKTool/App.xaml.cs
  7. 2
    2
      XHWK.WKTool/AppUpdateWin.xaml
  8. 219
    80
      XHWK.WKTool/CreateAMicroLessonWindow.xaml
  9. 3
    0
      XHWK.WKTool/DAL/Interface.cs
  10. 10
    10
      XHWK.WKTool/DeviceWindow.xaml
  11. BIN
      XHWK.WKTool/Extension/星火微课点阵码打印及印刷指导手册.docx
  12. 0
    240
      XHWK.WKTool/FileDirectoryWindow.xaml
  13. 0
    464
      XHWK.WKTool/FileDirectoryWindow.xaml.cs
  14. 2
    0
      XHWK.WKTool/KeyVerification.xaml.cs
  15. 1
    10
      XHWK.WKTool/LoginWindow.xaml.cs
  16. 92
    34
      XHWK.WKTool/MessageWindow.xaml
  17. 2
    2
      XHWK.WKTool/MinToolbar.xaml.cs
  18. 0
    181
      XHWK.WKTool/PrintWindow.xaml
  19. 0
    709
      XHWK.WKTool/PrintWindow.xaml.cs
  20. 0
    128
      XHWK.WKTool/PrintWindowTStudy.xaml
  21. 0
    630
      XHWK.WKTool/PrintWindowTStudy.xaml.cs
  22. 12
    0
      XHWK.WKTool/Resources/OverwrideDefaultControlStyles.xaml
  23. 25
    0
      XHWK.WKTool/Resources/StyleButton.xaml
  24. 259
    0
      XHWK.WKTool/Resources/StyleScrolllview.xaml
  25. 334
    120
      XHWK.WKTool/ScreenRecordingToolbarWindow.xaml
  26. 60
    128
      XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs
  27. 7
    7
      XHWK.WKTool/Skin/SkinDictionary_TechnologyBlue.xaml
  28. 6
    6
      XHWK.WKTool/Skin/SkinDictionary_White.xaml
  29. 21
    17
      XHWK.WKTool/UControl/Uc_VideoItem.xaml
  30. 3
    4
      XHWK.WKTool/UControl/Uc_VideoItem.xaml.cs
  31. 178
    101
      XHWK.WKTool/UploadWindow.xaml
  32. 18
    17
      XHWK.WKTool/UploadWindow.xaml.cs
  33. 2
    2
      XHWK.WKTool/VideoClipWindow.xaml
  34. 13
    0
      XHWK.WKTool/Welcome.xaml
  35. 28
    0
      XHWK.WKTool/Welcome.xaml.cs
  36. 50
    132
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml
  37. 120
    154
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs
  38. 21
    3
      XHWK.WKTool/XHWK.WKTool.csproj
  39. 1
    1
      XHWK.WKTool/XHWK.WKTool.csproj.user
  40. 1
    1
      打包脚本/Inno Setup星火微课.iss
  41. 15
    0
      样式.txt

+ 2
- 0
XHWK.Model/ComboBoxBean.cs View File

4
     {
4
     {
5
         public string Key { get; set; }
5
         public string Key { get; set; }
6
         public string Value { get; set; }
6
         public string Value { get; set; }
7
+
8
+        public int leaf { get; set; }
7
     }
9
     }
8
 }
10
 }

+ 1
- 1
XHWK.Model/Model_DirectorList.cs View File

47
         /// <summary>
47
         /// <summary>
48
         /// 是否是叶子节点
48
         /// 是否是叶子节点
49
         /// </summary>
49
         /// </summary>
50
-        public int? leaf { get; set; }
50
+        public int leaf { get; set; }
51
 
51
 
52
         /// <summary>
52
         /// <summary>
53
         /// 教材id
53
         /// 教材id

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

9
     <!--参数是否加密 0不加密 1加密-->
9
     <!--参数是否加密 0不加密 1加密-->
10
     <add key="IsParameterEncryption" value="0" />
10
     <add key="IsParameterEncryption" value="0" />
11
     <!--版本号-->
11
     <!--版本号-->
12
-    <add key="VersionCode" value="87" />
13
-    <add key="VersionName" value="2.6.7" />
12
+    <add key="VersionCode" value="88" />
13
+    <add key="VersionName" value="2.6.8" />
14
     <!--皮肤样式 0白 1蓝 2黑色 -->
14
     <!--皮肤样式 0白 1蓝 2黑色 -->
15
     <add key="SkinStyle" value="0" />
15
     <add key="SkinStyle" value="0" />
16
     <!--是否输出视频记录日志:0否-->
16
     <!--是否输出视频记录日志:0否-->
34
     <!--是否为校外 1是 -->
34
     <!--是否为校外 1是 -->
35
     <add key="IsOutsideSchool" value="1" />
35
     <add key="IsOutsideSchool" value="1" />
36
     <!--API请求地址-->
36
     <!--API请求地址-->
37
-    <add key="APIRequestAddress" value="http://schoolapi.xhkjedu.com" />
37
+    <add key="APIRequestAddress" value="https://zwwx.zzfls.com.cn:9001" />
38
     <!--文件平台请求地址-->
38
     <!--文件平台请求地址-->
39
-    <add key="FileRequestAddress" value="http://schoolfile.xhkjedu.com" />
39
+    <add key="FileRequestAddress" value="https://zwwx.zzfls.com.cn:9002" />
40
     <!--展示文件服务器请求地址-->
40
     <!--展示文件服务器请求地址-->
41
-    <add key="SchoolfileRequestAddress" value="http://schoolstatic.xhkjedu.com" />
41
+    <add key="SchoolfileRequestAddress" value="https://zwwx.zzfls.com.cn:9003" />
42
     <!--认证请求地址-->
42
     <!--认证请求地址-->
43
-    <add key="CertapiRequestAddress" value="http://scapi.xhkjedu.com" />
43
+    <add key="CertapiRequestAddress" value="https://scapi.xhkjedu.com" />
44
     <!--摄像头位置 1.右上 2.左上 3.右下 4.左下-->
44
     <!--摄像头位置 1.右上 2.左上 3.右下 4.左下-->
45
     <add key="CameraPosition" value="1" />
45
     <add key="CameraPosition" value="1" />
46
     <!--上传每片大小 Mb-->
46
     <!--上传每片大小 Mb-->

+ 0
- 805
XHWK.WKTool/App.cs View File

1
-using ComeCapture;
2
-
3
-using Common.system;
4
-
5
-using System;
6
-using System.Collections.Generic;
7
-using System.Diagnostics;
8
-using System.IO;
9
-using System.Linq;
10
-using System.Reflection;
11
-using System.Security.Principal;
12
-using System.Threading;
13
-using System.Windows;
14
-using System.Windows.Threading;
15
-
16
-using TStudyDigitalPen.HID;
17
-
18
-using XHWK.Model;
19
-using XHWK.WKTool.Helpers;
20
-using XHWK.WKTool.Skin;
21
-
22
-namespace XHWK.WKTool
23
-{
24
-    public partial class APP : Application
25
-    {
26
-        #region 全局变量
27
-
28
-        #region 更新需改动
29
-
30
-        /// <summary>
31
-        /// 是否为测试版
32
-        /// </summary>
33
-        public static bool isDebug = FileToolsCommon.GetConfigValue("IsDebug") != "0";
34
-
35
-        /// <summary>
36
-        /// 参数是否加密
37
-        /// </summary>
38
-        public static bool IsParameterEncryption = FileToolsCommon.GetConfigValue("IsParameterEncryption") != "0";
39
-
40
-        #endregion 更新需改动
41
-
42
-        #region 接口地址
43
-
44
-        /// <summary>
45
-        /// 是否为校外接口
46
-        /// </summary>
47
-        public static bool IsOutsideSchool = FileToolsCommon.GetConfigValue("IsOutsideSchool") == "1";
48
-
49
-        /// <summary>
50
-        /// 服务地址
51
-        /// </summary>
52
-        public static Model_ServiceAddress ServiceAddress = null;
53
-
54
-        /// <summary>
55
-        /// 接口地址
56
-        /// </summary>
57
-        public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("APIRequestAddress");
58
-
59
-        /// <summary>
60
-        /// 图片地址
61
-        /// </summary>
62
-        public static string uploadUrl = isDebug ? "http://schoolfiletest.xhkjedu.com/" : FileToolsCommon.GetConfigValue("FileRequestAddress");
63
-
64
-        /// <summary>
65
-        /// 展示文件
66
-        /// </summary>
67
-        public static string showImageUrl = isDebug ? "http://schoolstatictest.xhkjedu.com/static/" : FileToolsCommon.GetConfigValue("SchoolfileRequestAddress") + "/static/";
68
-
69
-        /// <summary>
70
-        /// 认证接口地址
71
-        /// </summary>
72
-        public static string certapiUrl = isDebug ? "http://scapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("CertapiRequestAddress");
73
-
74
-        #endregion 接口地址
75
-
76
-        #region 配置项
77
-
78
-        /// <summary>
79
-        /// 是否输出测试记录日志
80
-        /// </summary>
81
-        public static bool IsOutputInfoLog = FileToolsCommon.GetConfigValue("IsOutputInfoLog") != "0";
82
-
83
-        /// <summary>
84
-        /// 是否隐藏录屏工具栏
85
-        /// </summary>
86
-        public static bool IsHideSRTool = FileToolsCommon.GetConfigValue("IsHideSRTool") != "0";
87
-
88
-        /// <summary>
89
-        /// 皮肤样式 0白 1蓝 2黑色
90
-        /// </summary>
91
-        public static string SkinStyle = FileToolsCommon.GetConfigValue("SkinStyle");
92
-
93
-        /// <summary>
94
-        /// 数据存放目录
95
-        /// </summary>
96
-        public static string DataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\XHMicroLesson\\";
97
-
98
-        /// <summary>
99
-        /// 摄像头位置
100
-        /// </summary>
101
-        public static string CameraPosition = string.Empty;
102
-
103
-        /// <summary>
104
-        /// 摄像头名
105
-        /// </summary>
106
-        public static string CameraName = "";
107
-
108
-        /// <summary>
109
-        /// 麦克风名
110
-        /// </summary>
111
-        public static string MicrophoneName = "";
112
-
113
-        #endregion 配置项
114
-
115
-        #region 记录数据
116
-
117
-        /// <summary>
118
-        /// 全局页面数据变量
119
-        /// </summary>
120
-        public static readonly Model_Page PageContextData = new Model.Model_Page();
121
-
122
-        /// <summary>
123
-        /// 录屏工具
124
-        /// </summary>
125
-        public static FFMpeg FFmpeg = new FFMpeg();
126
-
127
-        /// <summary>
128
-        /// 后台线程帮助类
129
-        /// </summary>
130
-        public static BackgroundWorkerHelper BackgroundWorkerHelper => BackgroundWorkerHelper.GetInstance();
131
-
132
-        /// <summary>
133
-        /// 签名
134
-        /// </summary>
135
-        public static string Signature = "";
136
-
137
-        public static string secretKey = "nanhuakaizhangjianwangni";
138
-
139
-        /// <summary>
140
-        /// 用户信息
141
-        /// </summary>
142
-        public static Model_UserInfo UserInfo = null;
143
-
144
-        /// <summary>
145
-        /// 接口返回消息
146
-        /// </summary>
147
-        public static string ServerMsg = string.Empty;
148
-
149
-        /// <summary>
150
-        /// 登录状态 false 未登录 true已登录
151
-        /// </summary>
152
-        public static bool IsLoginType = false;
153
-
154
-        /// <summary>
155
-        /// 截图地址
156
-        /// </summary>
157
-        public static string ImgPath = string.Empty;
158
-
159
-        /// <summary>
160
-        /// 教材列表
161
-        /// </summary>
162
-        public static List<Model_TsubjectbookList> TsubjectbookList = null;
163
-
164
-        /// <summary>
165
-        /// 章节列表
166
-        /// </summary>
167
-        public static List<Model_DirectorList> DirectorList = null;
168
-
169
-        /// <summary>
170
-        /// 上传个人空间 入参
171
-        /// </summary>
172
-        public static Model_ResourceAddTwo ResourceAddTwo = null;
173
-
174
-        /// <summary>
175
-        /// 是否正在上传
176
-        /// </summary>
177
-        public static bool IsUpLoad = false;
178
-
179
-        #endregion 记录数据
180
-
181
-        #region 微课数据记录
182
-
183
-        /// <summary>
184
-        /// 用户微课列表模型
185
-        /// </summary>
186
-        public static List<Model_WKData> WKDataList = null;
187
-
188
-        /// <summary>
189
-        /// 微课模型
190
-        /// </summary>
191
-        public static Model_WKData WKData = null;
192
-
193
-        /// <summary>
194
-        /// 微课视频列表
195
-        /// </summary>
196
-        public static List<Model_Video> VideoList = null;
197
-
198
-        /// <summary>
199
-        /// 画板模型
200
-        /// </summary>
201
-        public static List<Model_DrawData> PageDrawList = null;
202
-
203
-        #endregion 微课数据记录
204
-
205
-        #region 点阵笔
206
-
207
-        /// <summary>
208
-        /// 点阵笔
209
-        /// </summary>
210
-        public static DigitalPenHID digitalPen;
211
-
212
-        /// <summary>
213
-        /// 笔序号
214
-        /// </summary>
215
-        public static string PenSerial;
216
-
217
-        /// <summary>
218
-        /// 笔状态,是否已连接
219
-        /// </summary>
220
-        public static bool PenStatus = false;
221
-
222
-        /// <summary>
223
-        /// 手写板状态,是否已连接
224
-        /// </summary>
225
-        public static bool BoardStatus = false;
226
-
227
-        #endregion 点阵笔
228
-
229
-        #region 腾千里手写笔
230
-
231
-        ///// <summary>
232
-        ///// 铺码服务请求
233
-        ///// </summary>
234
-        //public static DAL_TmatrixCode dAL_TmatrixCode;
235
-        /// <summary>
236
-        /// 腾千里手写笔事件
237
-        /// </summary>
238
-        public static PenEvents TQLPenevents;
239
-
240
-        /// <summary>
241
-        /// 腾千里手写笔是否已连接
242
-        /// </summary>
243
-        public static bool TQLPenStatus = false;
244
-
245
-        #region 打印
246
-
247
-        public static bool gbGenerateBGWithVImage = false;
248
-        public static bool gbGenerateVImage = false;
249
-        public static bool gbGenerateBGWithoutVImage = false;
250
-        public static bool gbGenerateBGWithImage = false;
251
-        public static bool gbGenPageSet = false;
252
-        public static int[] gPointType = new int[5];
253
-        public static int[] gPointDPI = new int[5];
254
-        public static string gTMXElementFileName;
255
-        public static string gNewProjectDirectory;
256
-        public static bool gbElementFileExist { get; set; }
257
-
258
-        #endregion 打印
259
-
260
-        #endregion 腾千里手写笔
261
-
262
-        #region 页面
263
-
264
-        /// <summary>
265
-        /// 主页面
266
-        /// </summary>
267
-        public static XHMicroLessonSystemWindow W_XHMicroLessonSystemWindow = null;
268
-
269
-        /// <summary>
270
-        /// 创建微课页面
271
-        /// </summary>
272
-        public static CreateAMicroLessonWindow W_CreateAMicroLessonWindow = null;
273
-
274
-        /// <summary>
275
-        /// 开始录像
276
-        /// </summary>
277
-        public static CountdownWindow W_CountdownWindow = null;
278
-
279
-        /// <summary>
280
-        /// 录像工具栏
281
-        /// </summary>
282
-        public static ScreenRecordingToolbarWindow W_ScreenRecordingToolbarWindow = null;
283
-
284
-        /// <summary>
285
-        /// 登录
286
-        /// </summary>
287
-        public static LoginWindow W_LoginWindow = null;
288
-
289
-        /// <summary>
290
-        /// 截图
291
-        /// </summary>
292
-        public static JieTuWindow W_JieTuWindow = null;
293
-
294
-        /// <summary>
295
-        /// 批注
296
-        /// </summary>
297
-        public static PracticeWindow W_PracticeWindow = null;
298
-
299
-        /// <summary>
300
-        /// 提示窗口
301
-        /// </summary>
302
-        public static PromptWindow W_PromptWindow = null;
303
-
304
-        /// <summary>
305
-        /// loding页面
306
-        /// </summary>
307
-        public static LoadDialog myloading;
308
-
309
-        /// <summary>
310
-        /// 上传页面
311
-        /// </summary>
312
-        public static UploadWindow W_UploadWindow = null;
313
-
314
-        /// <summary>
315
-        /// 最小化工具栏
316
-        /// </summary>
317
-        public static MinToolbar W_MinToolbar = null;
318
-
319
-        /// <summary>
320
-        /// 视频剪辑
321
-        /// </summary>
322
-        public static VideoClipWindow W_VideoClipWindow = null;
323
-
324
-        /// <summary>
325
-        /// 设备检测
326
-        /// </summary>
327
-        public static DeviceWindow W_DeviceWindow = null;
328
-
329
-        #endregion 页面
330
-
331
-        #endregion 全局变量
332
-
333
-        [STAThread]
334
-        private static void Main()
335
-        {
336
-            myloading = new LoadDialog();
337
-            StopSameProcess();
338
-            Killffmpeg();
339
-            //拓思德打印配置生成
340
-            //LatticeFileHelper.RunPrintConfig();
341
-            try
342
-            {
343
-                UserInfo = new Model_UserInfo();
344
-                WKDataList = new List<Model_WKData>();
345
-                VideoList = new List<Model_Video>();
346
-
347
-                #region 强制以管理员方式运行 修改人:赵耀 修改时间:2020年9月7日
348
-
349
-                WindowsIdentity identity = WindowsIdentity.GetCurrent();
350
-                WindowsPrincipal principal = new WindowsPrincipal(identity);
351
-
352
-                #endregion 强制以管理员方式运行 修改人:赵耀 修改时间:2020年9月7日
353
-
354
-                try
355
-                {
356
-                    if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "Temp"))//清除临时文件
357
-                    {
358
-                        Directory.Delete(AppDomain.CurrentDomain.BaseDirectory + "Temp", true);
359
-                    }
360
-                }
361
-                catch (Exception)
362
-                {
363
-                }
364
-
365
-                //如果本地文件为空,弹出弹窗 输密匙
366
-                //本地文件不为空, 解析
367
-                if (!File.Exists(APP.DataPath + "signature.txt"))//上次登录时间为空 或者签名为空 或者上次登录时间不是今天   都需要输入密匙验证 ,否则只验证本地的签名
368
-                {
369
-                    if (principal.IsInRole(WindowsBuiltInRole.Administrator))
370
-                    {
371
-                        //如果是管理员,则直接运行
372
-                        KeyVerification wins = new KeyVerification();
373
-                        // 定义Application对象作为整个应用程序入口
374
-                        Application app = new Application();
375
-                        SkinConfig.InitSkin();
376
-                        app.Run(wins);
377
-                    }
378
-                    else
379
-                    {
380
-                        //创建启动对象
381
-                        System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo
382
-                        {
383
-                            UseShellExecute = true,
384
-                            WorkingDirectory = Environment.CurrentDirectory,
385
-                            FileName = Assembly.GetExecutingAssembly().Location,
386
-                            //设置启动动作,确保以管理员身份运行
387
-                            Verb = "runas"
388
-                        };
389
-                        try
390
-                        {
391
-                            System.Diagnostics.Process.Start(startInfo);
392
-                        }
393
-                        catch
394
-                        {
395
-                            return;
396
-                        }
397
-                        //退出
398
-                        //Current.Shutdown();
399
-                        Environment.Exit(0);
400
-                    }
401
-                }
402
-                else
403
-                {
404
-                    if (principal.IsInRole(WindowsBuiltInRole.Administrator))
405
-                    {
406
-                        ProductVerification wins = new ProductVerification();
407
-                        Application app = new Application();
408
-                        SkinConfig.InitSkin();
409
-                        app.Run(wins);
410
-                    }
411
-                    else
412
-                    {
413
-                        //创建启动对象
414
-                        System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo
415
-                        {
416
-                            UseShellExecute = true,
417
-                            WorkingDirectory = Environment.CurrentDirectory,
418
-                            FileName = Assembly.GetExecutingAssembly().Location,
419
-                            //设置启动动作,确保以管理员身份运行
420
-                            Verb = "runas"
421
-                        };
422
-                        try
423
-                        {
424
-                            System.Diagnostics.Process.Start(startInfo);
425
-                        }
426
-                        catch
427
-                        {
428
-                            return;
429
-                        }
430
-                        //退出
431
-                        //Current.Shutdown();
432
-                        Environment.Exit(0);
433
-                    }
434
-                }
435
-            }
436
-            catch (Exception ex)
437
-            {
438
-                string ErrMessage = "【进程】(Main):进程意外关闭。 " + ex.Message;
439
-                LogHelper.WriteErrLog(ErrMessage, ex);
440
-            }
441
-        }
442
-
443
-        #region 杀死已存在的进程
444
-
445
-        /// <summary>
446
-        /// 结束已运行的程序
447
-        /// </summary>
448
-        private static void StopSameProcess()
449
-        {
450
-            Process current = Process.GetCurrentProcess();
451
-            Process[] processList = Process.GetProcesses();
452
-            foreach (Process process in processList)
453
-            {
454
-                if (process.ProcessName.ToUpper() == "星火微课")
455
-                {
456
-                    if (process.Id != current.Id) //忽略当前进程
457
-                    {
458
-                        try
459
-                        {
460
-                            process.Kill(); //结束进程
461
-                        }
462
-                        catch (Exception)
463
-                        {
464
-                        }
465
-                    }
466
-                }
467
-            }
468
-        }
469
-
470
-        /// <summary>
471
-        /// 杀死正在运行的ffmpeg
472
-        /// </summary>
473
-        public static void Killffmpeg()
474
-        {
475
-            Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
476
-            foreach (Process KillProcess in KillProcessArray)
477
-            {
478
-                KillProcess.Kill();
479
-            }
480
-        }
481
-
482
-        #endregion 杀死已存在的进程
483
-
484
-        /// <summary>
485
-        /// 错误处理
486
-        /// </summary>
487
-        /// <param name="sender"></param>
488
-        /// <param name="e"></param>
489
-        private void MyApp_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
490
-        {
491
-            LogHelper.WriteErrLog("未标示错误:" + e.Exception.Message, e.Exception);
492
-            MessageWindow.Show("程序异常." + Environment.NewLine + e.Exception.Message);
493
-            e.Handled = true;
494
-        }
495
-
496
-        #region 数据保存和读取
497
-
498
-        /// <summary>
499
-        /// 保存微课信息
500
-        /// </summary>
501
-        public static void SaveWkData()
502
-        {
503
-            try
504
-            {
505
-                VideoList = VideoList.Where((x, i) => VideoList.FindIndex(z => z.FileGuid == x.FileGuid) == i).ToList();
506
-                WKData.VideoList = VideoList;
507
-                if (WKDataList != null)
508
-                {
509
-                    WKDataList.RemoveAll(x => x.WkPath == WKData.WkPath);
510
-                }
511
-                else
512
-                {
513
-                    WKDataList = new List<Model_WKData>();
514
-                }
515
-                WKDataList.Add(WKData);
516
-                //string WkDateXmlStr = XmlUtilHelper.Serializer(typeof(Model_WKData), WKData);
517
-                string WkDateXmlStr = XmlUtilHelper.XmlSerialize(WKDataList);
518
-                string SavePath = FileToolsCommon.GetFileAbsolutePath("/Data/");
519
-                FileToolsCommon.CreateDirectory(SavePath);
520
-                string SaveName = SavePath + "WkDate.d";
521
-                FileToolsCommon.DeleteFile(SaveName);
522
-                FileToolsCommon.WriteText(SaveName, WkDateXmlStr);
523
-            }
524
-            catch (Exception ex)
525
-            {
526
-                LogHelper.WriteErrLog("【微课数据保存】(SaveWkData)保存失败:" + ex.Message, ex);
527
-            }
528
-        }
529
-
530
-        /// <summary>
531
-        /// 读取微课信息
532
-        /// </summary>
533
-        public static void ReadWkData(string WkPath)
534
-        {
535
-            try
536
-            {
537
-                string SavePath = FileToolsCommon.GetFileAbsolutePath("/Data/");
538
-                FileToolsCommon.CreateDirectory(SavePath);
539
-                string SaveName = SavePath + "WkDate.d";
540
-                //文件若存在则读取
541
-                if (FileToolsCommon.IsExistFile(SaveName))
542
-                {
543
-                    string WkDateXmlStr = FileToolsCommon.FileToString(SaveName);
544
-                    WKDataList = XmlUtilHelper.DESerializer<List<Model_WKData>>(WkDateXmlStr);
545
-                    foreach (Model_WKData wklist in WKDataList)
546
-                    {
547
-                        //移除找不到视频的微课数据
548
-                        wklist.VideoList.RemoveAll(x => !FileToolsCommon.IsExistFile(x.VideoPath));
549
-                    }
550
-                    if (WKDataList.Exists(x => x.WkPath == WkPath))
551
-                    {
552
-                        WKData = WKDataList.Find(x => x.WkPath == WkPath);
553
-                        VideoList = new List<Model_Video>();
554
-                        WKData.VideoList = WKData.VideoList.Where((x, i) => WKData.VideoList.FindIndex(z => z.FileGuid == x.FileGuid) == i).ToList();
555
-                        VideoList = WKData.VideoList;
556
-                        //List<Model_Video> companyList = WKData.VideoList;
557
-                        //VideoList = companyList.Where((x, i) => companyList.FindIndex(z => z.FileGuid == x.FileGuid) == i).ToList();
558
-                        //VideoList = companyList.Distinct().ToList();
559
-                    }
560
-                }
561
-            }
562
-            catch (Exception ex)
563
-            {
564
-                LogHelper.WriteErrLog("【微课数据读取】(ReadWkData)读取失败:" + ex.Message, ex);
565
-            }
566
-        }
567
-
568
-        /// <summary>
569
-        /// 保存画板数据
570
-        /// </summary>
571
-        public static void SaveDraw()
572
-        {
573
-            try
574
-            {
575
-                if (PageDrawList == null)
576
-                {
577
-                    return;
578
-                }
579
-                if (PageDrawList.Count < 1)
580
-                {
581
-                    return;
582
-                }
583
-                FileToolsCommon.CreateDirectory(WKData.WkPath);
584
-                string SavePath = WKData.WkPath + "PageData.d";
585
-                FileToolsCommon.DeleteFile(SavePath);
586
-                string PageDataXmlStr = XmlUtilHelper.XmlSerialize(PageDrawList);
587
-                FileToolsCommon.WriteText(SavePath, PageDataXmlStr);
588
-            }
589
-            catch (Exception ex)
590
-            {
591
-                LogHelper.WriteErrLog("【画板数据保存】(SaveDraw)保存失败:" + ex.Message, ex);
592
-            }
593
-        }
594
-
595
-        /// <summary>
596
-        /// 读取文件
597
-        /// </summary>
598
-        public static void ReadDrawData()
599
-        {
600
-            try
601
-            {
602
-                PageDrawList = new List<Model_DrawData>();
603
-                string SavePath = WKData.WkPath + "PageData.d";
604
-                if (FileToolsCommon.IsExistFile(SavePath))
605
-                {
606
-                    string PageDataXmlStr = FileToolsCommon.FileToString(SavePath);
607
-                    PageDrawList = XmlUtilHelper.DESerializer<List<Model_DrawData>>(PageDataXmlStr);
608
-                }
609
-            }
610
-            catch (Exception ex)
611
-            {
612
-                LogHelper.WriteErrLog("【画板数据读取】(ReadDraw)读取失败:" + ex.Message, ex);
613
-            }
614
-        }
615
-
616
-        #endregion 数据保存和读取
617
-
618
-        #region 服务地址数据
619
-
620
-        /// <summary>
621
-        /// 服务地址存储到本地
622
-        /// </summary>
623
-        public static void SaveServiceAddressData()
624
-        {
625
-            try
626
-            {
627
-                if (ServiceAddress == null)
628
-                {
629
-                    return;
630
-                }
631
-                string DateXmlStr = XmlUtilHelper.XmlSerialize(ServiceAddress);
632
-                string SavePath = DataPath;
633
-                FileToolsCommon.CreateDirectory(SavePath);
634
-                string SaveName = SavePath + "ServiceAddress.d";
635
-                FileToolsCommon.DeleteFile(SaveName);
636
-                FileToolsCommon.WriteText(SaveName, DateXmlStr);
637
-            }
638
-            catch (Exception ex)
639
-            {
640
-                LogHelper.WriteErrLog("【服务地址存储】(SaveServiceAddressData)保存失败:" + ex.Message, ex);
641
-            }
642
-        }
643
-
644
-        /// <summary>
645
-        /// 从本地读取服务地址
646
-        /// </summary>
647
-        public static void ReadServiceAddressData()
648
-        {
649
-            try
650
-            {
651
-                string SavePath = DataPath;
652
-                FileToolsCommon.CreateDirectory(SavePath);
653
-                string SaveName = SavePath + "ServiceAddress.d";
654
-                //文件若存在则读取
655
-                if (FileToolsCommon.IsExistFile(SaveName))
656
-                {
657
-                    string DateXmlStr = FileToolsCommon.FileToString(SaveName);
658
-                    ServiceAddress = XmlUtilHelper.DESerializer<Model_ServiceAddress>(DateXmlStr);
659
-                    SwitchAddress();
660
-                }
661
-            }
662
-            catch (Exception ex)
663
-            {
664
-                LogHelper.WriteErrLog("【服务地址读取】(ReadServiceAddressData)读取失败:" + ex.Message, ex);
665
-            }
666
-        }
667
-
668
-        /// <summary>
669
-        /// 切换校内外网
670
-        /// </summary>
671
-        public static void SwitchAddress()
672
-        {
673
-            try
674
-            {
675
-                apiUrl = IsOutsideSchool ? ServiceAddress.wapi : ServiceAddress.napi;
676
-                uploadUrl = (IsOutsideSchool ? ServiceAddress.wfile : ServiceAddress.nfile) + "/";
677
-                showImageUrl = (IsOutsideSchool ? ServiceAddress.wdown : ServiceAddress.ndown) + "/static/";
678
-            }
679
-            catch (Exception ex)
680
-            {
681
-                LogHelper.WriteErrLog("【服务地址切换】(SwitchAddress)服务复制切换失败,请求地址为空!", ex);
682
-            }
683
-        }
684
-
685
-        #endregion 服务地址数据
686
-
687
-        #region 检测安装Screen Capturer Recorder
688
-
689
-        /// <summary>
690
-        /// 检测是否安装了Screen Capturer Recorder
691
-        /// </summary>
692
-        /// <returns></returns>
693
-        public static bool CheckScreenCapturerRecorder()
694
-        {
695
-            if (FileToolsCommon.CheckSoftWartInstallState("Screen Capturer Recorder"))
696
-            {
697
-                //已经安装
698
-                return true;
699
-            }
700
-            else
701
-            {
702
-                return false;
703
-            }
704
-        }
705
-
706
-        /// <summary>
707
-        /// 安装Screen Capturer Recorder
708
-        /// </summary>
709
-        /// <returns></returns>
710
-        public static bool InstallScreenCapturerRecorder()
711
-        {
712
-            Process InstallProcess = new Process();
713
-            string StandardError = "";
714
-            string StandardOutput = "";
715
-            try
716
-            {
717
-                InstallProcess.StartInfo.FileName = FileToolsCommon.GetFileAbsolutePath(@"/SSCR/Setup Screen Capturer Recorder v0.12.10.exe");   //绝对路径
718
-                InstallProcess.StartInfo.UseShellExecute = false;           //不使用操作系统外壳程序启动
719
-                InstallProcess.StartInfo.RedirectStandardError = true;      //重定向标准错误输出
720
-                InstallProcess.StartInfo.RedirectStandardOutput = true;
721
-                InstallProcess.StartInfo.CreateNoWindow = true;             //不显示程序窗口
722
-                InstallProcess.StartInfo.RedirectStandardInput = true;      //用于模拟该进程控制台的输入
723
-                                                                            //外部程序(这里是FFMPEG)输出流时候产生的事件,这里是把流的处理过程转移到下面的方法中,详细请查阅MSDN
724
-                InstallProcess.ErrorDataReceived += new DataReceivedEventHandler(InstallProcess_ErrorDataReceived);
725
-                InstallProcess.Start();                 //启动线程
726
-                InstallProcess.WaitForExit();           //阻塞等待进程结束
727
-                StandardError = InstallProcess.StandardError.ReadToEnd();
728
-                StandardOutput = InstallProcess.StandardOutput.ReadToEnd();
729
-                int ExitCode = InstallProcess.ExitCode;
730
-                InstallProcess.Close();                 //关闭进程
731
-                InstallProcess.Dispose();               //释放资源
732
-                if (ExitCode == 0) //非0则为安装失败 1为取消安装
733
-                {
734
-                    return true;
735
-                }
736
-                else
737
-                {
738
-                    MessageBoxResult br = MessageWindow.Show("不安装环境将无法使用微课录制系统,是否现在安装?", "安装", MessageBoxButton.OKCancel);
739
-                    if (br == MessageBoxResult.OK)
740
-                    {
741
-                        return InstallScreenCapturerRecorder();
742
-                    }
743
-                    else
744
-                    {
745
-                        return false;
746
-                    }
747
-                }
748
-            }
749
-            catch (Exception ex)
750
-            {
751
-                LogHelper.WriteErrLog("【ScreenCapturerRecorder安装】(installScreenCapturerRecorder)安装失败:" + ex.Message, ex);
752
-                if (string.IsNullOrWhiteSpace(StandardError))
753
-                {
754
-                    LogHelper.WriteErrLog("【ScreenCapturerRecorder安装】(installScreenCapturerRecorder)安装失败:" + StandardError, null);
755
-                }
756
-                if (string.IsNullOrWhiteSpace(StandardOutput))
757
-                {
758
-                    LogHelper.WriteErrLog("【ScreenCapturerRecorder安装】(installScreenCapturerRecorder)安装返回信息:" + StandardOutput, null);
759
-                }
760
-                return false;
761
-            }
762
-        }
763
-
764
-        /// <summary>
765
-        /// 安装失败信息
766
-        /// </summary>
767
-        /// <param name="sender"></param>
768
-        /// <param name="e"></param>
769
-        private static void InstallProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)
770
-        {
771
-            LogHelper.WriteErrLog("【ScreenCapturerRecorder安装】(installScreenCapturerRecorder)安装失败:" + e.Data, null);
772
-            //MessageWindow.Show(e.Data);
773
-        }
774
-
775
-        #endregion 检测安装Screen Capturer Recorder
776
-
777
-        #region 内存处理 -创建人:赵耀 -创建时间:2020年8月12日
778
-
779
-        /// <summary>
780
-        /// 内存释放压缩
781
-        /// </summary>
782
-        /// <param name="e"></param>
783
-        protected override void OnStartup(StartupEventArgs e)
784
-        {
785
-            new Thread(o =>
786
-            {
787
-                while (true)
788
-                {
789
-                    try
790
-                    {
791
-                        //FreeMemoryHelper.SetDate();
792
-                        FreeMemoryHelper.ReallocateMemory();
793
-                        Thread.Sleep(20000);//暂定每20秒释放一次
794
-                    }
795
-                    catch (Exception ex)
796
-                    {
797
-                        LogHelper.WriteErrLog("【释放内存(MyApp)" + ex.Message, ex);
798
-                    }
799
-                }
800
-            }).Start();
801
-        }
802
-
803
-        #endregion 内存处理 -创建人:赵耀 -创建时间:2020年8月12日
804
-    }
805
-}

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

1
-<Application x:Class="XHWK.WKTool.App"
2
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
-             xmlns:local="clr-namespace:XHWK.WKTool"
5
-             >
1
+<Application
2
+    x:Class="XHWK.WKTool.APP"
3
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5
+    StartupUri="Welcome.xaml">
6
     <Application.Resources>
6
     <Application.Resources>
7
         <ResourceDictionary>
7
         <ResourceDictionary>
8
             <ResourceDictionary.MergedDictionaries>
8
             <ResourceDictionary.MergedDictionaries>
9
-                <ResourceDictionary Source="Skin\SkinDictionary_White.xaml"></ResourceDictionary>
10
-				<!--<ResourceDictionary Source="Skin\SkinDictionary_TechnologyBlue.xaml"></ResourceDictionary>-->
9
+                <ResourceDictionary Source="Skin\SkinDictionary_White.xaml" />
10
+                <ResourceDictionary Source="pack://application:,,,/Resources/OverwrideDefaultControlStyles.xaml" />
11
             </ResourceDictionary.MergedDictionaries>
11
             </ResourceDictionary.MergedDictionaries>
12
         </ResourceDictionary>
12
         </ResourceDictionary>
13
     </Application.Resources>
13
     </Application.Resources>

+ 666
- 9
XHWK.WKTool/App.xaml.cs View File

1
-using System;
1
+using ComeCapture;
2
+
3
+using Common.system;
4
+
5
+using System;
2
 using System.Collections.Generic;
6
 using System.Collections.Generic;
3
-using System.Configuration;
4
-using System.Data;
7
+using System.Diagnostics;
8
+using System.IO;
5
 using System.Linq;
9
 using System.Linq;
6
-using System.Threading.Tasks;
10
+using System.Reflection;
11
+using System.Security.Principal;
12
+using System.Threading;
7
 using System.Windows;
13
 using System.Windows;
14
+using System.Windows.Threading;
15
+
16
+using TStudyDigitalPen.HID;
17
+
18
+using XHWK.Model;
19
+using XHWK.WKTool.Helpers;
20
+using XHWK.WKTool.Skin;
8
 
21
 
9
 namespace XHWK.WKTool
22
 namespace XHWK.WKTool
10
 {
23
 {
11
-    /// <summary>
12
-    /// App.xaml 的交互逻辑
13
-    /// </summary>
14
-    public partial class App : Application
24
+    public partial class APP : Application
15
     {
25
     {
26
+        #region 全局变量
27
+
28
+        #region 更新需改动
29
+
30
+        /// <summary>
31
+        /// 是否为测试版
32
+        /// </summary>
33
+        public static bool isDebug = FileToolsCommon.GetConfigValue("IsDebug") != "0";
34
+
35
+        /// <summary>
36
+        /// 参数是否加密
37
+        /// </summary>
38
+        public static bool IsParameterEncryption = FileToolsCommon.GetConfigValue("IsParameterEncryption") != "0";
39
+
40
+        #endregion 更新需改动
41
+
42
+        #region 接口地址
43
+
44
+        /// <summary>
45
+        /// 是否为校外接口
46
+        /// </summary>
47
+        public static bool IsOutsideSchool = FileToolsCommon.GetConfigValue("IsOutsideSchool") == "1";
48
+
49
+        /// <summary>
50
+        /// 服务地址
51
+        /// </summary>
52
+        public static Model_ServiceAddress ServiceAddress = null;
53
+
54
+        /// <summary>
55
+        /// 接口地址
56
+        /// </summary>
57
+        public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("APIRequestAddress");
58
+
59
+        /// <summary>
60
+        /// 图片地址
61
+        /// </summary>
62
+        public static string uploadUrl = isDebug ? "http://schoolfiletest.xhkjedu.com/" : FileToolsCommon.GetConfigValue("FileRequestAddress");
63
+
64
+        /// <summary>
65
+        /// 展示文件
66
+        /// </summary>
67
+        public static string showImageUrl = isDebug ? "http://schoolstatictest.xhkjedu.com/static/" : FileToolsCommon.GetConfigValue("SchoolfileRequestAddress") + "/static/";
68
+
69
+        /// <summary>
70
+        /// 认证接口地址
71
+        /// </summary>
72
+        public static string certapiUrl = isDebug ? "http://scapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("CertapiRequestAddress");
73
+
74
+        #endregion 接口地址
75
+
76
+        #region 配置项
77
+
78
+        /// <summary>
79
+        /// 是否输出测试记录日志
80
+        /// </summary>
81
+        public static bool IsOutputInfoLog = FileToolsCommon.GetConfigValue("IsOutputInfoLog") != "0";
82
+
83
+        /// <summary>
84
+        /// 是否隐藏录屏工具栏
85
+        /// </summary>
86
+        public static bool IsHideSRTool = FileToolsCommon.GetConfigValue("IsHideSRTool") != "0";
87
+
88
+        /// <summary>
89
+        /// 皮肤样式 0白 1蓝 2黑色
90
+        /// </summary>
91
+        public static string SkinStyle = FileToolsCommon.GetConfigValue("SkinStyle");
92
+
93
+        /// <summary>
94
+        /// 数据存放目录
95
+        /// </summary>
96
+        public static string DataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\XHMicroLesson\\";
97
+
98
+        /// <summary>
99
+        /// 摄像头位置
100
+        /// </summary>
101
+        public static string CameraPosition = string.Empty;
102
+
103
+        /// <summary>
104
+        /// 摄像头名
105
+        /// </summary>
106
+        public static string CameraName = "";
107
+
108
+        /// <summary>
109
+        /// 麦克风名
110
+        /// </summary>
111
+        public static string MicrophoneName = "";
112
+
113
+        #endregion 配置项
114
+
115
+        #region 记录数据
116
+
117
+        /// <summary>
118
+        /// 全局页面数据变量
119
+        /// </summary>
120
+        public static readonly Model_Page PageContextData = new Model.Model_Page();
121
+
122
+        /// <summary>
123
+        /// 录屏工具
124
+        /// </summary>
125
+        public static FFMpeg FFmpeg = new FFMpeg();
126
+
127
+        /// <summary>
128
+        /// 后台线程帮助类
129
+        /// </summary>
130
+        public static BackgroundWorkerHelper BackgroundWorkerHelper => BackgroundWorkerHelper.GetInstance();
131
+
132
+        /// <summary>
133
+        /// 签名
134
+        /// </summary>
135
+        public static string Signature = "";
136
+
137
+        public static string secretKey = "nanhuakaizhangjianwangni";
138
+
139
+        /// <summary>
140
+        /// 用户信息
141
+        /// </summary>
142
+        public static Model_UserInfo UserInfo = null;
143
+
144
+        /// <summary>
145
+        /// 接口返回消息
146
+        /// </summary>
147
+        public static string ServerMsg = string.Empty;
148
+
149
+        /// <summary>
150
+        /// 登录状态 false 未登录 true已登录
151
+        /// </summary>
152
+        public static bool IsLoginType = false;
153
+
154
+        /// <summary>
155
+        /// 截图地址
156
+        /// </summary>
157
+        public static string ImgPath = string.Empty;
158
+
159
+        /// <summary>
160
+        /// 教材列表
161
+        /// </summary>
162
+        public static List<Model_TsubjectbookList> TsubjectbookList = null;
163
+
164
+        /// <summary>
165
+        /// 章节列表
166
+        /// </summary>
167
+        public static List<Model_DirectorList> DirectorList = null;
168
+
169
+        /// <summary>
170
+        /// 上传个人空间 入参
171
+        /// </summary>
172
+        public static Model_ResourceAddTwo ResourceAddTwo = null;
173
+
174
+        /// <summary>
175
+        /// 是否正在上传
176
+        /// </summary>
177
+        public static bool IsUpLoad = false;
178
+
179
+        #endregion 记录数据
180
+
181
+        #region 微课数据记录
182
+
183
+        /// <summary>
184
+        /// 用户微课列表模型
185
+        /// </summary>
186
+        public static List<Model_WKData> WKDataList = null;
187
+
188
+        /// <summary>
189
+        /// 微课模型
190
+        /// </summary>
191
+        public static Model_WKData WKData = null;
192
+
193
+        /// <summary>
194
+        /// 微课视频列表
195
+        /// </summary>
196
+        public static List<Model_Video> VideoList = null;
197
+
198
+        /// <summary>
199
+        /// 画板模型
200
+        /// </summary>
201
+        public static List<Model_DrawData> PageDrawList = null;
202
+
203
+        #endregion 微课数据记录
204
+
205
+        #region 点阵笔
206
+
207
+        /// <summary>
208
+        /// 点阵笔
209
+        /// </summary>
210
+        public static DigitalPenHID digitalPen;
211
+
212
+        /// <summary>
213
+        /// 笔序号
214
+        /// </summary>
215
+        public static string PenSerial;
216
+
217
+        /// <summary>
218
+        /// 笔状态,是否已连接
219
+        /// </summary>
220
+        public static bool PenStatus = false;
221
+
222
+        /// <summary>
223
+        /// 手写板状态,是否已连接
224
+        /// </summary>
225
+        public static bool BoardStatus = false;
226
+
227
+        #endregion 点阵笔
228
+
229
+        #region 腾千里手写笔
230
+
231
+        ///// <summary>
232
+        ///// 铺码服务请求
233
+        ///// </summary>
234
+        //public static DAL_TmatrixCode dAL_TmatrixCode;
235
+        /// <summary>
236
+        /// 腾千里手写笔事件
237
+        /// </summary>
238
+        public static PenEvents TQLPenevents;
239
+
240
+        /// <summary>
241
+        /// 腾千里手写笔是否已连接
242
+        /// </summary>
243
+        public static bool TQLPenStatus = false;
244
+
245
+        #region 打印
246
+
247
+        public static bool gbGenerateBGWithVImage = false;
248
+        public static bool gbGenerateVImage = false;
249
+        public static bool gbGenerateBGWithoutVImage = false;
250
+        public static bool gbGenerateBGWithImage = false;
251
+        public static bool gbGenPageSet = false;
252
+        public static int[] gPointType = new int[5];
253
+        public static int[] gPointDPI = new int[5];
254
+        public static string gTMXElementFileName;
255
+        public static string gNewProjectDirectory;
256
+        public static bool gbElementFileExist { get; set; }
257
+
258
+        #endregion 打印
259
+
260
+        #endregion 腾千里手写笔
261
+
262
+        #region 页面
263
+
264
+        /// <summary>
265
+        /// 主页面
266
+        /// </summary>
267
+        public static XHMicroLessonSystemWindow W_XHMicroLessonSystemWindow = null;
268
+
269
+        /// <summary>
270
+        /// 创建微课页面
271
+        /// </summary>
272
+        public static CreateAMicroLessonWindow W_CreateAMicroLessonWindow = null;
273
+
274
+        /// <summary>
275
+        /// 开始录像
276
+        /// </summary>
277
+        public static CountdownWindow W_CountdownWindow = null;
278
+
279
+        /// <summary>
280
+        /// 录像工具栏
281
+        /// </summary>
282
+        public static ScreenRecordingToolbarWindow W_ScreenRecordingToolbarWindow = null;
283
+
284
+        /// <summary>
285
+        /// 登录
286
+        /// </summary>
287
+        public static LoginWindow W_LoginWindow = null;
288
+
289
+        /// <summary>
290
+        /// 截图
291
+        /// </summary>
292
+        public static JieTuWindow W_JieTuWindow = null;
293
+
294
+        /// <summary>
295
+        /// 批注
296
+        /// </summary>
297
+        public static PracticeWindow W_PracticeWindow = null;
298
+
299
+        /// <summary>
300
+        /// 提示窗口
301
+        /// </summary>
302
+        public static PromptWindow W_PromptWindow = null;
303
+
304
+        /// <summary>
305
+        /// loding页面
306
+        /// </summary>
307
+        public static LoadDialog myloading;
308
+
309
+        /// <summary>
310
+        /// 上传页面
311
+        /// </summary>
312
+        public static UploadWindow W_UploadWindow = null;
313
+
314
+        /// <summary>
315
+        /// 最小化工具栏
316
+        /// </summary>
317
+        public static MinToolbar W_MinToolbar = null;
318
+
319
+        /// <summary>
320
+        /// 视频剪辑
321
+        /// </summary>
322
+        public static VideoClipWindow W_VideoClipWindow = null;
323
+
324
+        /// <summary>
325
+        /// 设备检测
326
+        /// </summary>
327
+        public static DeviceWindow W_DeviceWindow = null;
328
+
329
+        #endregion 页面
330
+
331
+        #endregion 全局变量
332
+        public APP()
333
+        {
334
+            Console.WriteLine("初始化APP");
335
+            myloading = new LoadDialog();
336
+            StopSameProcess();
337
+            Killffmpeg();
338
+
339
+            try
340
+            {
341
+                UserInfo = new Model_UserInfo();
342
+                WKDataList = new List<Model_WKData>();
343
+                VideoList = new List<Model_Video>();
344
+
345
+                #region 强制以管理员方式运行 修改人:赵耀 修改时间:2020年9月7日
346
+
347
+                WindowsIdentity identity = WindowsIdentity.GetCurrent();
348
+                WindowsPrincipal principal = new WindowsPrincipal(identity);
349
+
350
+                #endregion 强制以管理员方式运行 修改人:赵耀 修改时间:2020年9月7日
351
+
352
+                try
353
+                {
354
+                    if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "Temp"))//清除临时文件
355
+                    {
356
+                        Directory.Delete(AppDomain.CurrentDomain.BaseDirectory + "Temp", true);
357
+                    }
358
+                }
359
+                catch (Exception)
360
+                {
361
+                }
362
+
363
+                if (principal.IsInRole(WindowsBuiltInRole.Administrator))
364
+                {
365
+                    SkinConfig.InitSkin();
366
+                }
367
+                else
368
+                {
369
+                    //创建启动对象
370
+                    System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo
371
+                    {
372
+                        UseShellExecute = true,
373
+                        WorkingDirectory = Environment.CurrentDirectory,
374
+                        FileName = Assembly.GetExecutingAssembly().Location,
375
+                        //设置启动动作,确保以管理员身份运行
376
+                        Verb = "runas"
377
+                    };
378
+                    try
379
+                    {
380
+                        System.Diagnostics.Process.Start(startInfo);
381
+                    }
382
+                    catch
383
+                    {
384
+                        return;
385
+                    }
386
+                    //退出
387
+                    //Current.Shutdown();
388
+                    Environment.Exit(0);
389
+                }
390
+            }
391
+            catch (Exception ex)
392
+            {
393
+                string ErrMessage = "【进程】(Main):进程意外关闭。 " + ex.Message;
394
+                LogHelper.WriteErrLog(ErrMessage, ex);
395
+            }
396
+        }
397
+
398
+        #region 杀死已存在的进程
399
+
400
+        /// <summary>
401
+        /// 结束已运行的程序
402
+        /// </summary>
403
+        private static void StopSameProcess()
404
+        {
405
+            Process current = Process.GetCurrentProcess();
406
+            Process[] processList = Process.GetProcesses();
407
+            foreach (Process process in processList)
408
+            {
409
+                if (process.ProcessName.ToUpper() == "星火微课")
410
+                {
411
+                    if (process.Id != current.Id) //忽略当前进程
412
+                    {
413
+                        try
414
+                        {
415
+                            process.Kill(); //结束进程
416
+                        }
417
+                        catch (Exception)
418
+                        {
419
+                        }
420
+                    }
421
+                }
422
+            }
423
+        }
424
+
425
+        /// <summary>
426
+        /// 杀死正在运行的ffmpeg
427
+        /// </summary>
428
+        public static void Killffmpeg()
429
+        {
430
+            Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
431
+            foreach (Process KillProcess in KillProcessArray)
432
+            {
433
+                KillProcess.Kill();
434
+            }
435
+        }
436
+
437
+        #endregion 杀死已存在的进程
438
+
439
+        /// <summary>
440
+        /// 错误处理
441
+        /// </summary>
442
+        /// <param name="sender"></param>
443
+        /// <param name="e"></param>
444
+        private void MyApp_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
445
+        {
446
+            LogHelper.WriteErrLog("未标示错误:" + e.Exception.Message, e.Exception);
447
+            MessageWindow.Show("程序异常." + Environment.NewLine + e.Exception.Message);
448
+            e.Handled = true;
449
+        }
450
+
451
+        #region 数据保存和读取
452
+
453
+        /// <summary>
454
+        /// 保存微课信息
455
+        /// </summary>
456
+        public static void SaveWkData()
457
+        {
458
+            try
459
+            {
460
+                VideoList = VideoList.Where((x, i) => VideoList.FindIndex(z => z.FileGuid == x.FileGuid) == i).ToList();
461
+                WKData.VideoList = VideoList;
462
+                if (WKDataList != null)
463
+                {
464
+                    WKDataList.RemoveAll(x => x.WkPath == WKData.WkPath);
465
+                }
466
+                else
467
+                {
468
+                    WKDataList = new List<Model_WKData>();
469
+                }
470
+                WKDataList.Add(WKData);
471
+                //string WkDateXmlStr = XmlUtilHelper.Serializer(typeof(Model_WKData), WKData);
472
+                string WkDateXmlStr = XmlUtilHelper.XmlSerialize(WKDataList);
473
+                string SavePath = FileToolsCommon.GetFileAbsolutePath("/Data/");
474
+                FileToolsCommon.CreateDirectory(SavePath);
475
+                string SaveName = SavePath + "WkDate.d";
476
+                FileToolsCommon.DeleteFile(SaveName);
477
+                FileToolsCommon.WriteText(SaveName, WkDateXmlStr);
478
+            }
479
+            catch (Exception ex)
480
+            {
481
+                LogHelper.WriteErrLog("【微课数据保存】(SaveWkData)保存失败:" + ex.Message, ex);
482
+            }
483
+        }
484
+
485
+        /// <summary>
486
+        /// 读取微课信息
487
+        /// </summary>
488
+        public static void ReadWkData(string WkPath)
489
+        {
490
+            try
491
+            {
492
+                string SavePath = FileToolsCommon.GetFileAbsolutePath("/Data/");
493
+                FileToolsCommon.CreateDirectory(SavePath);
494
+                string SaveName = SavePath + "WkDate.d";
495
+                //文件若存在则读取
496
+                if (FileToolsCommon.IsExistFile(SaveName))
497
+                {
498
+                    string WkDateXmlStr = FileToolsCommon.FileToString(SaveName);
499
+                    WKDataList = XmlUtilHelper.DESerializer<List<Model_WKData>>(WkDateXmlStr);
500
+                    foreach (Model_WKData wklist in WKDataList)
501
+                    {
502
+                        //移除找不到视频的微课数据
503
+                        wklist.VideoList.RemoveAll(x => !FileToolsCommon.IsExistFile(x.VideoPath));
504
+                    }
505
+                    if (WKDataList.Exists(x => x.WkPath == WkPath))
506
+                    {
507
+                        WKData = WKDataList.Find(x => x.WkPath == WkPath);
508
+                        VideoList = new List<Model_Video>();
509
+                        WKData.VideoList = WKData.VideoList.Where((x, i) => WKData.VideoList.FindIndex(z => z.FileGuid == x.FileGuid) == i).ToList();
510
+                        VideoList = WKData.VideoList;
511
+                        //List<Model_Video> companyList = WKData.VideoList;
512
+                        //VideoList = companyList.Where((x, i) => companyList.FindIndex(z => z.FileGuid == x.FileGuid) == i).ToList();
513
+                        //VideoList = companyList.Distinct().ToList();
514
+                    }
515
+                }
516
+            }
517
+            catch (Exception ex)
518
+            {
519
+                LogHelper.WriteErrLog("【微课数据读取】(ReadWkData)读取失败:" + ex.Message, ex);
520
+            }
521
+        }
522
+
523
+        /// <summary>
524
+        /// 保存画板数据
525
+        /// </summary>
526
+        public static void SaveDraw()
527
+        {
528
+            try
529
+            {
530
+                if (PageDrawList == null)
531
+                {
532
+                    return;
533
+                }
534
+                if (PageDrawList.Count < 1)
535
+                {
536
+                    return;
537
+                }
538
+                FileToolsCommon.CreateDirectory(WKData.WkPath);
539
+                string SavePath = WKData.WkPath + "PageData.d";
540
+                FileToolsCommon.DeleteFile(SavePath);
541
+                string PageDataXmlStr = XmlUtilHelper.XmlSerialize(PageDrawList);
542
+                FileToolsCommon.WriteText(SavePath, PageDataXmlStr);
543
+            }
544
+            catch (Exception ex)
545
+            {
546
+                LogHelper.WriteErrLog("【画板数据保存】(SaveDraw)保存失败:" + ex.Message, ex);
547
+            }
548
+        }
549
+
550
+        /// <summary>
551
+        /// 读取文件
552
+        /// </summary>
553
+        public static void ReadDrawData()
554
+        {
555
+            try
556
+            {
557
+                PageDrawList = new List<Model_DrawData>();
558
+                string SavePath = WKData.WkPath + "PageData.d";
559
+                if (FileToolsCommon.IsExistFile(SavePath))
560
+                {
561
+                    string PageDataXmlStr = FileToolsCommon.FileToString(SavePath);
562
+                    PageDrawList = XmlUtilHelper.DESerializer<List<Model_DrawData>>(PageDataXmlStr);
563
+                }
564
+            }
565
+            catch (Exception ex)
566
+            {
567
+                LogHelper.WriteErrLog("【画板数据读取】(ReadDraw)读取失败:" + ex.Message, ex);
568
+            }
569
+        }
570
+
571
+        #endregion 数据保存和读取
572
+
573
+        #region 服务地址数据
574
+
575
+        /// <summary>
576
+        /// 服务地址存储到本地
577
+        /// </summary>
578
+        public static void SaveServiceAddressData()
579
+        {
580
+            try
581
+            {
582
+                if (ServiceAddress == null)
583
+                {
584
+                    return;
585
+                }
586
+                string DateXmlStr = XmlUtilHelper.XmlSerialize(ServiceAddress);
587
+                string SavePath = DataPath;
588
+                FileToolsCommon.CreateDirectory(SavePath);
589
+
590
+                string SaveName = SavePath + (isDebug ? "ServiceAddress_debug.xml" : "ServiceAddress_release.xml");
591
+
592
+                Console.WriteLine("保存路径为:");
593
+                FileToolsCommon.DeleteFile(SaveName);
594
+                FileToolsCommon.WriteText(SaveName, DateXmlStr);
595
+            }
596
+            catch (Exception ex)
597
+            {
598
+                LogHelper.WriteErrLog("【服务地址存储】(SaveServiceAddressData)保存失败:" + ex.Message, ex);
599
+            }
600
+        }
601
+
602
+        /// <summary>
603
+        /// 从本地读取服务地址
604
+        /// </summary>
605
+        public static void ReadServiceAddressData()
606
+        {
607
+            try
608
+            {
609
+                string SavePath = DataPath;
610
+                FileToolsCommon.CreateDirectory(SavePath);
611
+                string SaveName = SavePath + (isDebug ? "ServiceAddress_debug.xml" : "ServiceAddress_release.xml");
612
+                //文件若存在则读取
613
+                if (FileToolsCommon.IsExistFile(SaveName))
614
+                {
615
+                    string DateXmlStr = FileToolsCommon.FileToString(SaveName);
616
+                    ServiceAddress = XmlUtilHelper.DESerializer<Model_ServiceAddress>(DateXmlStr);
617
+                    SwitchAddress();
618
+                }
619
+            }
620
+            catch (Exception ex)
621
+            {
622
+                LogHelper.WriteErrLog("【服务地址读取】(ReadServiceAddressData)读取失败:" + ex.Message, ex);
623
+            }
624
+        }
625
+
626
+        /// <summary>
627
+        /// 切换校内外网
628
+        /// </summary>
629
+        public static void SwitchAddress()
630
+        {
631
+            try
632
+            {
633
+                apiUrl = IsOutsideSchool ? ServiceAddress.wapi : ServiceAddress.napi;
634
+                uploadUrl = (IsOutsideSchool ? ServiceAddress.wfile : ServiceAddress.nfile) + "/";
635
+                showImageUrl = (IsOutsideSchool ? ServiceAddress.wdown : ServiceAddress.ndown) + "/static/";
636
+            }
637
+            catch (Exception ex)
638
+            {
639
+                LogHelper.WriteErrLog("【服务地址切换】(SwitchAddress)服务复制切换失败,请求地址为空!", ex);
640
+            }
641
+        }
642
+
643
+        #endregion 服务地址数据
644
+
645
+ 
646
+        #region 内存处理 -创建人:赵耀 -创建时间:2020年8月12日
647
+
648
+        /// <summary>
649
+        /// 内存释放压缩
650
+        /// </summary>
651
+        /// <param name="e"></param>
652
+        protected override void OnStartup(StartupEventArgs e)
653
+        {
654
+            new Thread(o =>
655
+            {
656
+                while (true)
657
+                {
658
+                    try
659
+                    {
660
+                        //FreeMemoryHelper.SetDate();
661
+                        FreeMemoryHelper.ReallocateMemory();
662
+                        Thread.Sleep(20000);//暂定每20秒释放一次
663
+                    }
664
+                    catch (Exception ex)
665
+                    {
666
+                        LogHelper.WriteErrLog("【释放内存(MyApp)" + ex.Message, ex);
667
+                    }
668
+                }
669
+            }).Start();
670
+        }
671
+
672
+        #endregion 内存处理 -创建人:赵耀 -创建时间:2020年8月12日
16
     }
673
     }
17
-}
674
+}

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

125
                                     BorderBrush="{TemplateBinding Control.BorderBrush}"
125
                                     BorderBrush="{TemplateBinding Control.BorderBrush}"
126
                                     BorderThickness="0"
126
                                     BorderThickness="0"
127
                                     CornerRadius="21">
127
                                     CornerRadius="21">
128
-                                    <Border.Background>#2D8CF0</Border.Background>
128
+                                    <Border.Background>#3f6fff</Border.Background>
129
                                     <ContentPresenter
129
                                     <ContentPresenter
130
                                         HorizontalAlignment="Center"
130
                                         HorizontalAlignment="Center"
131
                                         VerticalAlignment="Center"
131
                                         VerticalAlignment="Center"
162
                             <ProgressBar
162
                             <ProgressBar
163
                                 x:Name="mprogress"
163
                                 x:Name="mprogress"
164
                                 BorderThickness="0"
164
                                 BorderThickness="0"
165
-                                Foreground="#2D8CF0"
165
+                                Foreground="#3f6fff"
166
                                 Maximum="100"
166
                                 Maximum="100"
167
                                 Minimum="0" />
167
                                 Minimum="0" />
168
                         </Views:ZJClippingBorder>
168
                         </Views:ZJClippingBorder>

+ 219
- 80
XHWK.WKTool/CreateAMicroLessonWindow.xaml View File

1
-<Window x:Class="XHWK.WKTool.CreateAMicroLessonWindow"
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="星火微课" Height="450" Width="800"   AllowsTransparency="True"
1
+<Window
2
+    x:Class="XHWK.WKTool.CreateAMicroLessonWindow"
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="星火微课"
9
+    Width="800"
10
+    Height="450"
11
+    Margin="0"
12
+    AllowsTransparency="True"
13
+    Loaded="Window_Loaded"
9
     WindowStartupLocation="CenterScreen"
14
     WindowStartupLocation="CenterScreen"
10
-    WindowStyle="None" Loaded="Window_Loaded" Margin="0"  BorderThickness="7">
11
-    <Window.Effect>
12
-        <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
13
-    </Window.Effect>
15
+    WindowStyle="None"
16
+    mc:Ignorable="d">
17
+
14
     <Window.Resources>
18
     <Window.Resources>
15
         <Style x:Key="Button_Menu" TargetType="{x:Type Button}">
19
         <Style x:Key="Button_Menu" TargetType="{x:Type Button}">
16
             <Setter Property="Width" Value="auto" />
20
             <Setter Property="Width" Value="auto" />
17
             <Setter Property="Height" Value="auto" />
21
             <Setter Property="Height" Value="auto" />
18
             <Setter Property="BorderThickness" Value="0" />
22
             <Setter Property="BorderThickness" Value="0" />
19
-            <Setter Property="Foreground" Value="Black"/>
23
+            <Setter Property="Foreground" Value="Black" />
20
             <Setter Property="Template">
24
             <Setter Property="Template">
21
                 <Setter.Value>
25
                 <Setter.Value>
22
                     <ControlTemplate TargetType="{x:Type Button}">
26
                     <ControlTemplate TargetType="{x:Type Button}">
23
                         <Border Background="#c3c3c3">
27
                         <Border Background="#c3c3c3">
24
-                            <Border x:Name="MyBackgroundElement" Background="#F7F7F7" BorderBrush="{DynamicResource ForgroundBrush}" BorderThickness="1">
25
-                                <ContentPresenter x:Name="ButtonContentPresenter" VerticalAlignment="Center" HorizontalAlignment="Center"/>
28
+                            <Border
29
+                                x:Name="MyBackgroundElement"
30
+                                Background="#F7F7F7"
31
+                                BorderBrush="{DynamicResource ForgroundBrush}"
32
+                                BorderThickness="1">
33
+                                <ContentPresenter
34
+                                    x:Name="ButtonContentPresenter"
35
+                                    HorizontalAlignment="Center"
36
+                                    VerticalAlignment="Center" />
26
                             </Border>
37
                             </Border>
27
                         </Border>
38
                         </Border>
28
                         <ControlTemplate.Triggers>
39
                         <ControlTemplate.Triggers>
29
                             <Trigger Property="IsMouseOver" Value="True">
40
                             <Trigger Property="IsMouseOver" Value="True">
30
-                                <Setter TargetName="MyBackgroundElement" Property="Background" Value="#EDF5FF"/>
31
-                                <Setter TargetName="MyBackgroundElement" Property="Opacity" Value="1"/>
41
+                                <Setter TargetName="MyBackgroundElement" Property="Background" Value="#EDF5FF" />
42
+                                <Setter TargetName="MyBackgroundElement" Property="Opacity" Value="1" />
32
                             </Trigger>
43
                             </Trigger>
33
                         </ControlTemplate.Triggers>
44
                         </ControlTemplate.Triggers>
34
                     </ControlTemplate>
45
                     </ControlTemplate>
39
     <Grid>
50
     <Grid>
40
         <Grid Background="#FF4B95FF" MouseLeftButtonDown="Window_MouseLeftButtonDown">
51
         <Grid Background="#FF4B95FF" MouseLeftButtonDown="Window_MouseLeftButtonDown">
41
             <Grid.ColumnDefinitions>
52
             <Grid.ColumnDefinitions>
42
-                <ColumnDefinition Width="520*"/>
43
-                <ColumnDefinition Width="280*"/>
53
+                <ColumnDefinition Width="520*" />
54
+                <ColumnDefinition Width="280*" />
44
             </Grid.ColumnDefinitions>
55
             </Grid.ColumnDefinitions>
45
-            <!--轮播图-->
56
+            <!--  轮播图  -->
46
             <Grid Grid.Column="0">
57
             <Grid Grid.Column="0">
47
                 <Grid.RowDefinitions>
58
                 <Grid.RowDefinitions>
48
-                    <RowDefinition Height="28*"/>
49
-                    <RowDefinition Height="380*"/>
50
-                    <RowDefinition Height="28*"/>
59
+                    <RowDefinition Height="28*" />
60
+                    <RowDefinition Height="380*" />
61
+                    <RowDefinition Height="28*" />
51
                 </Grid.RowDefinitions>
62
                 </Grid.RowDefinitions>
52
                 <Grid.ColumnDefinitions>
63
                 <Grid.ColumnDefinitions>
53
-                    <ColumnDefinition Width="15*"/>
54
-                    <ColumnDefinition Width="481*"/>
55
-                    <ColumnDefinition Width="15*"/>
64
+                    <ColumnDefinition Width="15*" />
65
+                    <ColumnDefinition Width="481*" />
66
+                    <ColumnDefinition Width="15*" />
56
                 </Grid.ColumnDefinitions>
67
                 </Grid.ColumnDefinitions>
57
                 <!--<MediaElement Grid.Row="1" Grid.Column="1" Source="/SkinImages/ImgCarousel/CM_Carousel.gif" Width="500" Height="389" HorizontalAlignment="Center" VerticalAlignment="Center">
68
                 <!--<MediaElement Grid.Row="1" Grid.Column="1" Source="/SkinImages/ImgCarousel/CM_Carousel.gif" Width="500" Height="389" HorizontalAlignment="Center" VerticalAlignment="Center">
58
-                    --><!--<MediaElement.Effect>
69
+                -->
70
+                <!--<MediaElement.Effect>
59
                         <DropShadowEffect Color="#FFD3D3D3" Direction="-50" ShadowDepth="4" Opacity="0.9" />
71
                         <DropShadowEffect Color="#FFD3D3D3" Direction="-50" ShadowDepth="4" Opacity="0.9" />
60
-                    </MediaElement.Effect>--><!--
72
+                    </MediaElement.Effect>-->
73
+                <!--
61
                 </MediaElement >-->
74
                 </MediaElement >-->
62
-                <Grid Grid.Row="1" Grid.Column="1" ClipToBounds="True">
63
-                    <StackPanel x:Name="SplCarouse" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0" >
64
-                        <Image x:Name="ImgCarouse1" Source="/SkinImages/ImgCarousel/CM_Carousel_1.png"/>
65
-                        <Image Source="/SkinImages/ImgCarousel/CM_Carousel_2.png"/>
66
-                        <Image Source="/SkinImages/ImgCarousel/CM_Carousel_3.png"/>
67
-                        <Image Source="/SkinImages/ImgCarousel/CM_Carousel_1.png"/>
75
+                <Grid
76
+                    Grid.Row="1"
77
+                    Grid.Column="1"
78
+                    ClipToBounds="True">
79
+                    <StackPanel
80
+                        x:Name="SplCarouse"
81
+                        Margin="0"
82
+                        HorizontalAlignment="Left"
83
+                        Orientation="Horizontal">
84
+                        <Image x:Name="ImgCarouse1" Source="/SkinImages/ImgCarousel/CM_Carousel_1.png" />
85
+                        <Image Source="/SkinImages/ImgCarousel/CM_Carousel_2.png" />
86
+                        <Image Source="/SkinImages/ImgCarousel/CM_Carousel_3.png" />
87
+                        <Image Source="/SkinImages/ImgCarousel/CM_Carousel_1.png" />
68
                     </StackPanel>
88
                     </StackPanel>
69
                 </Grid>
89
                 </Grid>
70
-                <Grid Grid.Row="1" Grid.Column="0" Background="#FF4B95FF"></Grid>
71
-                <Grid Grid.Row="1" Grid.Column="2" Background="#FF4B95FF"></Grid>
90
+                <Grid
91
+                    Grid.Row="1"
92
+                    Grid.Column="0"
93
+                    Background="#FF4B95FF" />
94
+                <Grid
95
+                    Grid.Row="1"
96
+                    Grid.Column="2"
97
+                    Background="#FF4B95FF" />
72
             </Grid>
98
             </Grid>
73
-            <!--创建-->
99
+            <!--  创建  -->
74
             <Grid Grid.Column="1">
100
             <Grid Grid.Column="1">
75
-                <Border Background="White" Margin="10,31,30,30"  CornerRadius="15" >
101
+                <Border
102
+                    Margin="10,31,30,30"
103
+                    Background="White"
104
+                    CornerRadius="15">
76
                     <Grid>
105
                     <Grid>
77
-                        <Image Source="/SkinImages/ImgCarousel/CM_RightDown.png" HorizontalAlignment="Right" VerticalAlignment="Top" Width="65" />
78
-                        <!--创建内页 375-->
106
+                        <Image
107
+                            Width="65"
108
+                            HorizontalAlignment="Right"
109
+                            VerticalAlignment="Top"
110
+                            Source="/SkinImages/ImgCarousel/CM_RightDown.png" />
111
+                        <!--  创建内页 375  -->
79
                         <Grid Margin="20,0">
112
                         <Grid Margin="20,0">
80
                             <Grid.RowDefinitions>
113
                             <Grid.RowDefinitions>
81
-                                <RowDefinition Height="100*"/>
82
-                                <RowDefinition Height="80*"/>
83
-                                <RowDefinition Height="80*"/>
84
-                                <RowDefinition Height="115*"/>
114
+                                <RowDefinition Height="100*" />
115
+                                <RowDefinition Height="80*" />
116
+                                <RowDefinition Height="80*" />
117
+                                <RowDefinition Height="115*" />
85
                             </Grid.RowDefinitions>
118
                             </Grid.RowDefinitions>
86
                             <Grid Grid.Row="0">
119
                             <Grid Grid.Row="0">
87
-                                <Label Content="创建" FontSize="21" Foreground="#FF4B62EA" VerticalAlignment="Top" HorizontalAlignment="Left"  Margin="0,42,0,0"/>
120
+                                <Label
121
+                                    Margin="0,42,0,0"
122
+                                    HorizontalAlignment="Left"
123
+                                    VerticalAlignment="Top"
124
+                                    Content="创建"
125
+                                    FontSize="21"
126
+                                    Foreground="#FF4B62EA" />
88
                             </Grid>
127
                             </Grid>
89
-                            <!--讲解名称-->
128
+                            <!--  讲解名称  -->
90
                             <Grid Grid.Row="1">
129
                             <Grid Grid.Row="1">
91
                                 <StackPanel VerticalAlignment="Center">
130
                                 <StackPanel VerticalAlignment="Center">
92
-                                    <Label Content="讲解名称:" FontSize="12" Foreground="#FF666666"/>
93
-                                    <TextBox x:Name="txbExplainName" Text="微课1" FontSize="14" Foreground="#FF999999" BorderBrush="{x:Null}" BorderThickness="0" Margin="5,5"/>
94
-                                    <Label Background="#FF317EEC" Height="1.5"/>
131
+                                    <Label
132
+                                        Content="讲解名称:"
133
+                                        FontSize="12"
134
+                                        Foreground="#FF666666" />
135
+                                    <TextBox
136
+                                        x:Name="txbExplainName"
137
+                                        Margin="5,5"
138
+                                        BorderBrush="{x:Null}"
139
+                                        BorderThickness="0"
140
+                                        FontSize="14"
141
+                                        Foreground="#FF999999"
142
+                                        Text="微课1" />
143
+                                    <Label Height="1.5" Background="#FF317EEC" />
95
                                 </StackPanel>
144
                                 </StackPanel>
96
                             </Grid>
145
                             </Grid>
97
-                            <!--存放路径-->
146
+                            <!--  存放路径  -->
98
                             <Grid Grid.Row="2">
147
                             <Grid Grid.Row="2">
99
 
148
 
100
                                 <StackPanel VerticalAlignment="Center">
149
                                 <StackPanel VerticalAlignment="Center">
101
-                                    <Label Content="存放路径:" FontSize="12" Foreground="#FF666666"/>
150
+                                    <Label
151
+                                        Content="存放路径:"
152
+                                        FontSize="12"
153
+                                        Foreground="#FF666666" />
102
                                     <Grid>
154
                                     <Grid>
103
                                         <Grid.ColumnDefinitions>
155
                                         <Grid.ColumnDefinitions>
104
-                                            <ColumnDefinition Width="150"/>
105
-                                            <ColumnDefinition Width="45"/>
156
+                                            <ColumnDefinition Width="150" />
157
+                                            <ColumnDefinition Width="45" />
106
                                         </Grid.ColumnDefinitions>
158
                                         </Grid.ColumnDefinitions>
107
-                                        <TextBox Grid.Column="0" x:Name="txbStoragePath" Text="D:\" FontSize="14" Foreground="#FF999999" BorderBrush="{x:Null}" BorderThickness="0" Margin="5,5"/>
108
-                                        <Button Grid.Column="1" Cursor="Hand" x:Name="btnBrowse" FontSize="14" BorderBrush="#cccccc" BorderThickness="1" Click="BtnBrowse_Click" Content="浏览" Style="{StaticResource Button_Menu}" Background="#F7F7F7" Margin="0,5,0,0"/>
159
+                                        <TextBox
160
+                                            x:Name="txbStoragePath"
161
+                                            Grid.Column="0"
162
+                                            Margin="5,5"
163
+                                            BorderBrush="{x:Null}"
164
+                                            BorderThickness="0"
165
+                                            FontSize="14"
166
+                                            Foreground="#FF999999"
167
+                                            Text="D:\" />
168
+                                        <Button
169
+                                            x:Name="btnBrowse"
170
+                                            Grid.Column="1"
171
+                                            Margin="0,5,0,0"
172
+                                            Background="#F7F7F7"
173
+                                            BorderBrush="#cccccc"
174
+                                            BorderThickness="1"
175
+                                            Click="BtnBrowse_Click"
176
+                                            Content="浏览"
177
+                                            Cursor="Hand"
178
+                                            FontSize="14"
179
+                                            Style="{StaticResource Button_Menu}" />
109
                                     </Grid>
180
                                     </Grid>
110
-                                    <Label Background="#FF317EEC" Height="1.5"/>
181
+                                    <Label Height="1.5" Background="#FF317EEC" />
111
                                 </StackPanel>
182
                                 </StackPanel>
112
                                 <!--<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="30,0,30,1" Grid.ColumnSpan="2">
183
                                 <!--<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="30,0,30,1" Grid.ColumnSpan="2">
113
                                 <Label Content="*" FontSize="18" Padding="0,27,0,0" Foreground="#FF0000"/>
184
                                 <Label Content="*" FontSize="18" Padding="0,27,0,0" Foreground="#FF0000"/>
114
                                 <TextBlock Text="存放路径" FontSize="18" Padding="2,23,10,0"/>
185
                                 <TextBlock Text="存放路径" FontSize="18" Padding="2,23,10,0"/>
115
                                 -->
186
                                 -->
116
-                                <!--输入框-->
187
+                                <!--  输入框  -->
117
                                 <!--
188
                                 <!--
118
                                 <Border Background="#CDD6E0" Width="200" Height="43" CornerRadius="3">
189
                                 <Border Background="#CDD6E0" Width="200" Height="43" CornerRadius="3">
119
                                     <TextBox x:Name="txbStoragePath" Text="D:\" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="198" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
190
                                     <TextBox x:Name="txbStoragePath" Text="D:\" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="198" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
120
                                 </Border>
191
                                 </Border>
121
                                 -->
192
                                 -->
122
-                                <!--浏览按钮-->
193
+                                <!--  浏览按钮  -->
123
                                 <!--
194
                                 <!--
124
                                 <Button Cursor="Hand" x:Name="btnBrowse" FontSize="18" Width="80" Height="43" BorderBrush="#cccccc" BorderThickness="1" Click="BtnBrowse_Click" Content="浏览" Style="{StaticResource Button_Menu}"
195
                                 <Button Cursor="Hand" x:Name="btnBrowse" FontSize="18" Width="80" Height="43" BorderBrush="#cccccc" BorderThickness="1" Click="BtnBrowse_Click" Content="浏览" Style="{StaticResource Button_Menu}"
125
                                 Background="#F7F7F7" Margin="11,0,0,0"/>
196
                                 Background="#F7F7F7" Margin="11,0,0,0"/>
126
                             </StackPanel>-->
197
                             </StackPanel>-->
127
                             </Grid>
198
                             </Grid>
128
-                            <!--按钮-->
199
+                            <!--  按钮  -->
129
                             <Grid Grid.Row="3">
200
                             <Grid Grid.Row="3">
130
-                                <Label x:Name="LblCreate" Content="创建微课中..." FontSize="12" Foreground="#FF999999" HorizontalAlignment="Right" Visibility="Hidden"/>
131
-                                <Button  Cursor="Hand" Grid.Row="3" x:Name="BtnStart" IsDefault="True" Content="开始" FontSize="18" FontWeight="Bold" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,0,30" Click="BtnStart_Click" Grid.ColumnSpan="2" Width="195" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center" Height="33">
201
+                                <Label
202
+                                    x:Name="LblCreate"
203
+                                    HorizontalAlignment="Right"
204
+                                    Content="创建微课中..."
205
+                                    FontSize="12"
206
+                                    Foreground="#FF999999"
207
+                                    Visibility="Hidden" />
208
+                                <Button
209
+                                    x:Name="BtnStart"
210
+                                    Grid.Row="3"
211
+                                    Grid.ColumnSpan="2"
212
+                                    Width="195"
213
+                                    Height="40"
214
+                                    Margin="0,0,0,30"
215
+                                    HorizontalAlignment="Center"
216
+                                    VerticalAlignment="Center"
217
+                                    HorizontalContentAlignment="Center"
218
+                                    Click="BtnStart_Click"
219
+                                    Content="开始"
220
+                                    Cursor="Hand"
221
+                                    FontSize="18"
222
+                                    FontWeight="Bold"
223
+                                    Foreground="#FFFFFF"
224
+                                    IsDefault="True"
225
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
132
                                     <Button.Template>
226
                                     <Button.Template>
133
                                         <ControlTemplate TargetType="{x:Type Button}">
227
                                         <ControlTemplate TargetType="{x:Type Button}">
134
-                                            <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="20">
228
+                                            <Border
229
+                                                BorderBrush="{TemplateBinding Control.BorderBrush}"
230
+                                                BorderThickness="1"
231
+                                                CornerRadius="20">
135
                                                 <Border.Background>#FF1D64DA</Border.Background>
232
                                                 <Border.Background>#FF1D64DA</Border.Background>
136
                                                 <ContentPresenter
233
                                                 <ContentPresenter
137
-                                    HorizontalAlignment="Center"
138
-                                    VerticalAlignment="Center"
139
-                                    Content="{TemplateBinding ContentControl.Content}" />
234
+                                                    HorizontalAlignment="Center"
235
+                                                    VerticalAlignment="Center"
236
+                                                    Content="{TemplateBinding ContentControl.Content}" />
140
                                             </Border>
237
                                             </Border>
141
                                         </ControlTemplate>
238
                                         </ControlTemplate>
142
                                     </Button.Template>
239
                                     </Button.Template>
146
                     </Grid>
243
                     </Grid>
147
                 </Border>
244
                 </Border>
148
             </Grid>
245
             </Grid>
149
-            <Button Grid.Column="1" Cursor="Hand" x:Name="btnDown" Content="×" VerticalAlignment="Top" Foreground="#FFFFFF" FontSize="25" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click" Padding="5,0"/>
150
-        </Grid>        
246
+            <Button
247
+                x:Name="btnDown"
248
+                Grid.Column="1"
249
+                Padding="5,0"
250
+                HorizontalAlignment="Right"
251
+                VerticalAlignment="Top"
252
+                Click="BtnDown_Click"
253
+                Content="×"
254
+                Cursor="Hand"
255
+                FontSize="25"
256
+                Foreground="#FFFFFF"
257
+                Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
258
+        </Grid>
151
         <Grid Visibility="Collapsed">
259
         <Grid Visibility="Collapsed">
152
-            <!--分4行-->
260
+            <!--  分4行  -->
153
             <Grid.RowDefinitions>
261
             <Grid.RowDefinitions>
154
-                <RowDefinition Height="45"/>
155
-                <RowDefinition Height="110"/>
156
-                <RowDefinition Height="70"/>
157
-                <RowDefinition Height="*"/>
262
+                <RowDefinition Height="45" />
263
+                <RowDefinition Height="110" />
264
+                <RowDefinition Height="70" />
265
+                <RowDefinition Height="*" />
158
             </Grid.RowDefinitions>
266
             </Grid.RowDefinitions>
159
-            <!--第一行 标题 FFE9E9E9  FF2D8CF0-->
160
-            <Grid x:Name="GridTitle" Visibility="Visible" Margin="-1,0" Grid.Row="0" Background="#FF38ADFF" MouseLeftButtonDown="Window_MouseLeftButtonDown">
161
-                <TextBlock Text="创建微课" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
267
+            <!--  第一行 标题 FFE9E9E9  FF2D8CF0  -->
268
+            <Grid
269
+                x:Name="GridTitle"
270
+                Grid.Row="0"
271
+                Margin="-1,0"
272
+                Background="#FF38ADFF"
273
+                MouseLeftButtonDown="Window_MouseLeftButtonDown"
274
+                Visibility="Visible">
275
+                <TextBlock
276
+                    Padding="10,13,0,0"
277
+                    FontSize="16"
278
+                    Foreground="#FFFFFF"
279
+                    Text="创建微课" />
162
                 <!--<Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" VerticalAlignment="Top" Foreground="#FFFFFF" FontSize="30" Padding="10,2,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>-->
280
                 <!--<Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" VerticalAlignment="Top" Foreground="#FFFFFF" FontSize="30" Padding="10,2,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>-->
163
             </Grid>
281
             </Grid>
164
-            <Grid x:Name="GridTitle_Black" Visibility="Collapsed" Margin="0,0" Grid.Row="0" Background="#FFE9E9E9" MouseLeftButtonDown="Window_MouseLeftButtonDown">
165
-                <TextBlock Text="创建微课" Foreground="#FF333333" FontSize="16" Padding="10,13,0,0"/>
166
-                <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown_Black" Content="×" VerticalAlignment="Top" Foreground="#FF333333" FontSize="30" Padding="10,2,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>
282
+            <Grid
283
+                x:Name="GridTitle_Black"
284
+                Grid.Row="0"
285
+                Margin="0,0"
286
+                Background="#FFE9E9E9"
287
+                MouseLeftButtonDown="Window_MouseLeftButtonDown"
288
+                Visibility="Collapsed">
289
+                <TextBlock
290
+                    Padding="10,13,0,0"
291
+                    FontSize="16"
292
+                    Foreground="#FF333333"
293
+                    Text="创建微课" />
294
+                <Button
295
+                    x:Name="btnDown_Black"
296
+                    Grid.Row="0"
297
+                    Padding="10,2,10,0"
298
+                    HorizontalAlignment="Right"
299
+                    VerticalAlignment="Top"
300
+                    Click="BtnDown_Click"
301
+                    Content="×"
302
+                    Cursor="Hand"
303
+                    FontSize="30"
304
+                    Foreground="#FF333333"
305
+                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
167
             </Grid>
306
             </Grid>
168
-            <!--第二行 讲解名称-->
169
-            <!--第三行 存放路径-->
307
+            <!--  第二行 讲解名称  -->
308
+            <!--  第三行 存放路径  -->
170
         </Grid>
309
         </Grid>
171
     </Grid>
310
     </Grid>
172
 </Window>
311
 </Window>

+ 3
- 0
XHWK.WKTool/DAL/Interface.cs View File

123
         /// <returns></returns>
123
         /// <returns></returns>
124
         public int Login(string loginname, string loginpwd)
124
         public int Login(string loginname, string loginpwd)
125
         {
125
         {
126
+            Console.WriteLine(APP.isDebug);
127
+            Console.WriteLine(APP.apiUrl);
128
+            Console.WriteLine(FileToolsCommon.GetConfigValue("APIRequestAddress"));
126
             string url = APP.apiUrl + "/user/login";//地址
129
             string url = APP.apiUrl + "/user/login";//地址
127
 
130
 
128
             //1.193.37.200
131
             //1.193.37.200

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

147
             x:Name="GridTitle_Black"
147
             x:Name="GridTitle_Black"
148
             Grid.Row="0"
148
             Grid.Row="0"
149
             Margin="0,0"
149
             Margin="0,0"
150
-            Background="#FFF1F2F8"
150
+            Background="#3f6fff"
151
             MouseLeftButtonDown="Window_MouseLeftButtonDown">
151
             MouseLeftButtonDown="Window_MouseLeftButtonDown">
152
             <TextBlock
152
             <TextBlock
153
                 Grid.RowSpan="2"
153
                 Grid.RowSpan="2"
154
                 Padding="10,13,0,0"
154
                 Padding="10,13,0,0"
155
                 FontSize="16"
155
                 FontSize="16"
156
-                Foreground="#FF333333"
156
+                Foreground="White"
157
                 Text="设备检测" />
157
                 Text="设备检测" />
158
             <Button
158
             <Button
159
                 x:Name="btnDown_Black"
159
                 x:Name="btnDown_Black"
165
                 Content="×"
165
                 Content="×"
166
                 Cursor="Hand"
166
                 Cursor="Hand"
167
                 FontSize="30"
167
                 FontSize="30"
168
-                Foreground="#FF333333"
168
+                Foreground="White"
169
                 Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
169
                 Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
170
         </Grid>
170
         </Grid>
171
         <Grid Grid.Row="1">
171
         <Grid Grid.Row="1">
379
                                     BorderThickness="1"
379
                                     BorderThickness="1"
380
                                     CornerRadius="23">
380
                                     CornerRadius="23">
381
                                     <Border.Background>
381
                                     <Border.Background>
382
-                                        <Brush>#2E8CF0</Brush>
382
+                                        <Brush>#3f6fff</Brush>
383
                                     </Border.Background>
383
                                     </Border.Background>
384
                                     <ContentPresenter
384
                                     <ContentPresenter
385
                                         HorizontalAlignment="Center"
385
                                         HorizontalAlignment="Center"
474
                                     BorderThickness="1"
474
                                     BorderThickness="1"
475
                                     CornerRadius="7">
475
                                     CornerRadius="7">
476
                                     <Border.Background>
476
                                     <Border.Background>
477
-                                        <Brush>#2E8CF0</Brush>
477
+                                        <Brush>#3f6fff</Brush>
478
                                     </Border.Background>
478
                                     </Border.Background>
479
                                     <ContentPresenter
479
                                     <ContentPresenter
480
                                         HorizontalAlignment="Center"
480
                                         HorizontalAlignment="Center"
536
                                     BorderThickness="1"
536
                                     BorderThickness="1"
537
                                     CornerRadius="7">
537
                                     CornerRadius="7">
538
                                     <Border.Background>
538
                                     <Border.Background>
539
-                                        <Brush>#2E8CF0</Brush>
539
+                                        <Brush>#3f6fff</Brush>
540
                                     </Border.Background>
540
                                     </Border.Background>
541
                                     <ContentPresenter
541
                                     <ContentPresenter
542
                                         HorizontalAlignment="Center"
542
                                         HorizontalAlignment="Center"
585
                                         BorderThickness="1"
585
                                         BorderThickness="1"
586
                                         CornerRadius="7">
586
                                         CornerRadius="7">
587
                                         <Border.Background>
587
                                         <Border.Background>
588
-                                            <Brush>#2E8CF0</Brush>
588
+                                            <Brush>#3f6fff</Brush>
589
                                         </Border.Background>
589
                                         </Border.Background>
590
                                         <ContentPresenter
590
                                         <ContentPresenter
591
                                             HorizontalAlignment="Center"
591
                                             HorizontalAlignment="Center"
706
                                     BorderThickness="1"
706
                                     BorderThickness="1"
707
                                     CornerRadius="7">
707
                                     CornerRadius="7">
708
                                     <Border.Background>
708
                                     <Border.Background>
709
-                                        <Brush>#2E8CF0</Brush>
709
+                                        <Brush>#3f6fff</Brush>
710
                                     </Border.Background>
710
                                     </Border.Background>
711
                                     <ContentPresenter
711
                                     <ContentPresenter
712
                                         HorizontalAlignment="Center"
712
                                         HorizontalAlignment="Center"
744
                                     BorderThickness="1"
744
                                     BorderThickness="1"
745
                                     CornerRadius="7">
745
                                     CornerRadius="7">
746
                                     <Border.Background>
746
                                     <Border.Background>
747
-                                        <Brush>#2E8CF0</Brush>
747
+                                        <Brush>#3f6fff</Brush>
748
                                     </Border.Background>
748
                                     </Border.Background>
749
                                     <ContentPresenter
749
                                     <ContentPresenter
750
                                         HorizontalAlignment="Center"
750
                                         HorizontalAlignment="Center"
776
                                     BorderThickness="1"
776
                                     BorderThickness="1"
777
                                     CornerRadius="7">
777
                                     CornerRadius="7">
778
                                     <Border.Background>
778
                                     <Border.Background>
779
-                                        <Brush>#2E8CF0</Brush>
779
+                                        <Brush>#3f6fff</Brush>
780
                                     </Border.Background>
780
                                     </Border.Background>
781
                                     <ContentPresenter
781
                                     <ContentPresenter
782
                                         HorizontalAlignment="Center"
782
                                         HorizontalAlignment="Center"

BIN
XHWK.WKTool/Extension/星火微课点阵码打印及印刷指导手册.docx View File


+ 0
- 240
XHWK.WKTool/FileDirectoryWindow.xaml View File

1
-<Window x:Class="XHWK.WKTool.FileDirectoryWindow"
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="FileDirectoryWindow" Height="729" Width="1030" AllowsTransparency="True" 
9
-    ShowInTaskbar="False" MouseLeftButtonDown="Window_MouseLeftButtonDown_1" MouseLeftButtonUp="Window_MouseLeftButtonUp"
10
-    WindowStartupLocation="CenterOwner" 
11
-    WindowStyle="None">
12
-    <Window.Resources>
13
-        <!--  ListBox容器样式  -->
14
-        <Style x:Key="ListBoxItemContainerStyle" TargetType="{x:Type ListBoxItem}">
15
-            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
16
-            <Setter Property="HorizontalAlignment" Value="Stretch" />
17
-            <Setter Property="Template">
18
-                <Setter.Value>
19
-                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
20
-                        <Border
21
-                            x:Name="itemBox"
22
-                            Background="Transparent"
23
-                            BorderBrush="Transparent"
24
-                            BorderThickness="0">
25
-                            <ContentPresenter />
26
-                        </Border>
27
-                        <ControlTemplate.Triggers />
28
-                    </ControlTemplate>
29
-                </Setter.Value>
30
-            </Setter>
31
-        </Style>
32
-        <DataTemplate x:Key="TongjiItem">
33
-            <UniformGrid
34
-                Height="50"
35
-                Margin="0,0,0,0"
36
-                Background="{Binding Colour}"
37
-                Columns="5"
38
-                Rows="1">
39
-                <!--题号-->
40
-                <TextBlock 
41
-                    HorizontalAlignment="Center"
42
-                    VerticalAlignment="Center"
43
-                    FontSize="16"
44
-                    Text="{Binding SerialNumber}" />
45
-                <Grid>
46
-                    <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center"
47
-                    VerticalAlignment="Center">
48
-                        <TextBox IsEnabled="{Binding IsEnabled}"
49
-                    HorizontalAlignment="Center"
50
-                    VerticalAlignment="Center"
51
-                    FontSize="16" Height="30" Padding="0,5,0,0"
52
-                    Text="{Binding VideoName,Mode=TwoWay}" Width="150"/>
53
-                        <Button x:Name="btnModify" Background="Transparent"
54
-                                Cursor="Hand"
55
-                        BorderThickness="0" Click="BtnModify_Click">
56
-                            <Grid>
57
-                                <Image Source="./Images/fileDirectory3.png" Margin="6,6,6,6" Height="20" Visibility="{Binding vis}"/>
58
-                                <Image Source="./Images/fileDirectory4.png" Margin="6,6,6,6" Height="20" Visibility="{Binding cos}"/>
59
-                            </Grid>
60
-                        </Button>
61
-                    </StackPanel>
62
-                </Grid>
63
-          
64
-           
65
-                <!--分值--><!--
66
-                <TextBlock
67
-                    HorizontalAlignment="Center"
68
-                    VerticalAlignment="Center"
69
-                    FontSize="15"
70
-                    Text="{Binding VideoDuration}" />-->
71
-
72
-                <!--平均时长-->
73
-                <TextBlock
74
-                    HorizontalAlignment="Center"
75
-                    VerticalAlignment="Center"
76
-                    FontSize="16"
77
-                    Text="{Binding VideoSize}" />
78
-                <!--最短时长-->
79
-                <TextBlock
80
-                    HorizontalAlignment="Center"
81
-                    VerticalAlignment="Center"
82
-                    FontSize="16"
83
-                    Text="{Binding VideoTime}" />
84
-
85
-                <Grid>
86
-                    <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center"
87
-                    VerticalAlignment="Center">
88
-                        <Button x:Name="btnPlay" Background="Transparent" 
89
-                                Cursor="Hand"
90
-                        BorderThickness="0" Click="BtnPlay_Click">
91
-                            <Grid>
92
-                                <Image Source="./Images/fileDirectory1.png" Margin="10" Height="20" Visibility="{Binding vis}"/>
93
-                                <Image Source="./Images/fileDirectory2.png" Margin="10" Visibility="{Binding cos}"/>
94
-                            </Grid>
95
-                        </Button>
96
-                        <Button x:Name="btnUpload" Background="Transparent"
97
-                                Cursor="Hand"
98
-                        BorderThickness="0" Click="BtnUpload_Click">
99
-                            <Grid>
100
-                                <Image Source="./Images/fileDirectory7.png" Margin="6,6,6,6" Height="20" Visibility="{Binding vis}"/>
101
-                                <Image Source="./Images/fileDirectory8.png" Margin="6,6,6,6" Height="20" Visibility="{Binding cos}"/>
102
-                            </Grid>
103
-                        </Button>
104
-                        <Button x:Name="btnDelete" Background="Transparent"
105
-                                Cursor="Hand"
106
-                        BorderThickness="0" Click="BtnDelete_Click">
107
-                            <Grid>
108
-                                <Image Source="./Images/fileDirectory5.png" Margin="6,6,6,6" Height="20" Visibility="{Binding vis}"/>
109
-                                <Image Source="./Images/fileDirectory6.png" Margin="6,6,6,6" Height="20" Visibility="{Binding cos}"/>
110
-                            </Grid>
111
-                        </Button>
112
-                    </StackPanel>
113
-                </Grid>
114
-                
115
-           
116
-            </UniformGrid>
117
-        </DataTemplate>
118
-    </Window.Resources>
119
-    <Viewbox>
120
-        <Border Background="#fefefe" Height="729" Width="1030">
121
-            <Border Background="#fdfdfd" Height="727" Width="1028">
122
-                <Border Background="#fcfcfc" Height="725" Width="1026">
123
-                    <Border Background="#fafafa" Height="723" Width="1024">
124
-                        <Border Background="#f9f9f9" Height="721" Width="1022">
125
-                            <Border Background="#f6f6f6" Height="719" Width="1020">
126
-                                <Border Background="#f3f3f3" Height="717" Width="1018">
127
-                                    <Border Background="#eeeeee" Height="715" Width="1016">
128
-                                        <Border Background="#e9e9e9" Height="713" Width="1014">
129
-                                            <Border Background="#e2e2e2" Height="711" Width="1012">
130
-                                                <Border Background="#dcdcdc" Height="709" Width="1010">
131
-                                                    <Border Background="#d3d3d3" Height="707" Width="1008">
132
-                                                        <Border Background="#cccccc" Height="705" Width="1006">
133
-                                                            <Border Background="#bfbfbf" Height="703" Width="1004">
134
-                                                                <Border Background="#aeaeae" Height="701" Width="1002">
135
-                                                                    <Border Background="#bababa" Height="699" Width="1000">
136
-                                                                        <Border Background="#e4e4e4" Height="697" Width="998">
137
-                                                                            <Grid Height="695" Width="998" Background="#FFFFFF" Margin="0,-1,0,0">
138
-                                                                                <!--分4行-->
139
-                                                                                <Grid.RowDefinitions>
140
-                                                                                    <RowDefinition Height="45"/>
141
-                                                                                    <RowDefinition Height="*"/>
142
-                                                                                    <RowDefinition Height="30"/>
143
-                                                                                </Grid.RowDefinitions>
144
-                                                                                <!--第一行 标题-->
145
-                                                                                <Border Grid.Row="0" Background="#2D8CF0">
146
-                                                                                    <Grid  MouseLeftButtonDown="Window_MouseLeftButtonDown">
147
-                                                                                        <TextBlock Text="文件目录" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
148
-                                                                                        <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="btnDown_Click"/>
149
-                                                                                    </Grid>
150
-                                                                                </Border>
151
-                                                                                <!--第二行 内容-->
152
-                                                                                <Grid Grid.Row="1" Margin="0,15,0,0">
153
-                                                                                    <Grid.RowDefinitions>
154
-                                                                                        <RowDefinition Height="45"/>
155
-                                                                                        <RowDefinition Height="*"/>
156
-                                                                                    </Grid.RowDefinitions>
157
-                                                                                    <UniformGrid x:Name="uniStatisticsByTitle"
158
-                Grid.Row="0"
159
-                Margin="10,0,10,0"
160
-                Background="#2D8CF0"
161
-                Columns="5"
162
-                Rows="1">
163
-                                                                                        <TextBlock
164
-                    HorizontalAlignment="Center"
165
-                    VerticalAlignment="Center"
166
-                    FontSize="16"
167
-                    Text="序号" Foreground="White" />
168
-                                                                                        <TextBlock
169
-                    HorizontalAlignment="Center"
170
-                    VerticalAlignment="Center"
171
-                    FontSize="16"
172
-                    Text="视频名称" Foreground="White" />
173
-                                                                                        <!--<TextBlock
174
-                    HorizontalAlignment="Center"
175
-                    VerticalAlignment="Center"
176
-                    FontSize="15"
177
-                    Text="视频时长" Foreground="White" />-->
178
-                                                                                        <TextBlock
179
-                    HorizontalAlignment="Center"
180
-                    VerticalAlignment="Center"
181
-                    FontSize="16"
182
-                    Text="视频大小" Foreground="White" />
183
-                                                                                        <TextBlock
184
-                    HorizontalAlignment="Center"
185
-                    VerticalAlignment="Center"
186
-                    FontSize="16"
187
-                    Text="日期" Foreground="White" />
188
-                                                                                        <TextBlock
189
-                    HorizontalAlignment="Center"
190
-                    VerticalAlignment="Center"
191
-                    FontSize="16"
192
-                    Text="操作" Foreground="White" />
193
-                                                                                    </UniformGrid>
194
-                                                                                    <ListBox Grid.Row="1"
195
-                    x:Name="listView1"
196
-                    BorderThickness="0"
197
-                    FontSize="20"
198
-                    ItemContainerStyle="{StaticResource ListBoxItemContainerStyle}"
199
-                    ItemTemplate="{StaticResource TongjiItem}"
200
-                    ItemsSource="{Binding menuList}" 
201
-                           ScrollViewer.HorizontalScrollBarVisibility="Disabled"
202
-                                ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
203
-                                                                                </Grid>
204
-                                                                                <!--第三行 删除 上传 按钮-->
205
-                                                                                <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Height="32">
206
-                                                                                    <TextBlock Text="共" FontSize="20" Padding="0,5,0,0"/>
207
-                                                                                    <TextBlock x:Name="txbSum" Text="0" FontSize="20" Padding="0,5,0,0"/>
208
-                                                                                    <TextBlock Text="条" FontSize="20" Padding="0,5,0,0"/>
209
-                                                                                    <Button Background="Transparent"
210
-                                Cursor="Hand"
211
-                        BorderThickness="0" Content="上一页" FontSize="20" Margin="10,0,0,0" >
212
-                                                                                        <!--<Image Source="./Images/class_p1.png"/>-->
213
-                                                                                    </Button>
214
-                                                                                    <Button Background="Transparent"
215
-                                Cursor="Hand"
216
-                        BorderThickness="0" Content="下一页" FontSize="20" Margin="10,0,0,0" >
217
-                                                                                        <!--<Image Source="./Images/class_p2.png"/>-->
218
-                                                                                    </Button>
219
-                                                                                </StackPanel>
220
-
221
-                                                                            </Grid>
222
-                                                                        </Border>
223
-                                                                    </Border>
224
-                                                                </Border>
225
-                                                            </Border>
226
-                                                        </Border>
227
-                                                    </Border>
228
-                                                </Border>
229
-                                            </Border>
230
-                                        </Border>
231
-                                    </Border>
232
-                                </Border>
233
-                            </Border>
234
-                        </Border>
235
-                    </Border>
236
-                </Border>
237
-            </Border>
238
-        </Border>
239
-    </Viewbox>
240
-</Window>

+ 0
- 464
XHWK.WKTool/FileDirectoryWindow.xaml.cs View File

1
-using Common.system;
2
-
3
-using System;
4
-using System.Collections.Generic;
5
-using System.Collections.ObjectModel;
6
-using System.Diagnostics;
7
-using System.Windows;
8
-using System.Windows.Controls;
9
-using System.Windows.Input;
10
-using System.Windows.Media;
11
-
12
-using XHWK.Model;
13
-using XHWK.WKTool.DAL;
14
-using XHWK.WKTool.Models;
15
-
16
-namespace XHWK.WKTool
17
-{
18
-    /// <summary>
19
-    /// 文件目录
20
-    /// </summary>
21
-    public partial class FileDirectoryWindow : Window
22
-    {
23
-        /// <summary>
24
-        /// 视频模型
25
-        /// </summary>
26
-        private List<Model_Video> model_VideoList = null;
27
-
28
-        /// <summary>
29
-        /// 数据列表
30
-        /// </summary>
31
-        internal FileDirectoryData pageData = new FileDirectoryData();
32
-
33
-        /// <summary>
34
-        /// 下标
35
-        /// </summary>
36
-        private int Subscript = 0;
37
-
38
-        /// <summary>
39
-        /// 是否是修改状态
40
-        /// </summary>
41
-        private bool IsModify = false;
42
-
43
-        /// <summary>
44
-        /// 文件目录
45
-        /// </summary>
46
-        public FileDirectoryWindow()
47
-        {
48
-            InitializeComponent();
49
-            Initialize();
50
-        }
51
-
52
-        /// <summary>
53
-        /// 初始化
54
-        /// </summary>
55
-        public void Initialize()
56
-        {
57
-            APP.myloading.Show();
58
-            //MouseNumber = 0;
59
-            IsModify = false;
60
-            //加载视频列表
61
-            LoadingVideoList();
62
-            int i = 1;
63
-            bool isColour = true;
64
-            pageData.menuList.Clear();
65
-            //显示视频
66
-            foreach (Model_Video videoinfo in model_VideoList)
67
-            {
68
-                //是否已上传
69
-                //videoinfo.IsUpload;
70
-                //录制时间
71
-                //videoinfo.RSTime;
72
-                //文件大小
73
-                //videoinfo.VideoSize;
74
-                //文件缩略图路径
75
-                //videoinfo.ThumbnailPath;
76
-                //文件唯一标示 上传事件筛选需要上传的视频
77
-                //videoinfo.FileGuid;
78
-                //文件存储路径
79
-                //videoinfo.VidePath;
80
-
81
-                string colour = "#FFFFFF";
82
-                if (isColour == true)
83
-                {
84
-                    colour = "#FFFFFF";
85
-                    isColour = false;
86
-                }
87
-                else
88
-                {
89
-                    colour = "#E6F1FF";
90
-                    isColour = true;
91
-                }
92
-                string vis = "Visible";
93
-                string cos = "Collapsed";
94
-                if (!videoinfo.IsUpload)
95
-                {
96
-                    vis = "Collapsed";
97
-                    cos = "Visible";
98
-                }
99
-                if (i <= 16)
100
-                {
101
-                    pageData.menuList.Add(new FileDirectoryModel()
102
-                    {
103
-                        SerialNumber = i,
104
-                        VideoName = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
105
-                        Name = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
106
-                        FilePath = videoinfo.VideoPath.Replace(FileToolsCommon.GetIOFileName(videoinfo.VideoPath), "").Trim(),
107
-                        VideoDuration = 0,
108
-                        VideoSize = videoinfo.VideoSize,
109
-                        VideoTime = videoinfo.RSTime,
110
-                        IsEnabled = false,
111
-                        Path = videoinfo.VideoPath,
112
-                        Colour = colour,
113
-                        Visi = vis,
114
-                        Coll = cos,
115
-                        FileGuid = videoinfo.FileGuid,
116
-                        VideoType = videoinfo.VideoType.ToString()
117
-                    }); ;
118
-                }
119
-
120
-                i++;
121
-            }
122
-            txbSum.Text = pageData.menuList.Count.ToString();
123
-            APP.myloading.Hide();
124
-            DataContext = pageData;
125
-        }
126
-
127
-        /// <summary>
128
-        /// 加载视频列表
129
-        /// </summary>
130
-        public void LoadingVideoList()
131
-        {
132
-            try
133
-            {
134
-                model_VideoList = new List<Model_Video>();
135
-                foreach (Model_WKData Vdata in APP.WKDataList)
136
-                {
137
-                    if (Vdata.VideoList == null)
138
-                    {
139
-                        continue;
140
-                    }
141
-
142
-                    foreach (Model_Video videoinfo in Vdata.VideoList)
143
-                    {
144
-                        try
145
-                        {
146
-                            if (string.IsNullOrWhiteSpace(videoinfo.VideoPath))
147
-                            {
148
-                                continue;
149
-                            }
150
-                            if (string.IsNullOrWhiteSpace(videoinfo.VideoSize) || videoinfo.VideoSize == "0 MB")
151
-                            {
152
-                                videoinfo.VideoSize = FileToolsCommon.GetFileSizeByMB(videoinfo.VideoPath).ToString() + " MB";
153
-                                videoinfo.VideoSizebyte = FileToolsCommon.GetFileSize(videoinfo.VideoPath);
154
-                            }
155
-                            model_VideoList.Add(videoinfo);
156
-                        }
157
-                        catch (Exception ex)
158
-                        {
159
-                            LogHelper.WriteErrLog("【加载视频列表】(LoadingVideoList)" + ex.Message, ex);
160
-                        }
161
-                    }
162
-                }
163
-            }
164
-            catch (Exception ex)
165
-            {
166
-                LogHelper.WriteErrLog("【加载视频列表】(LoadingVideoList)" + ex.Message, ex);
167
-            }
168
-        }
169
-
170
-        /// <summary>
171
-        /// 关闭
172
-        /// </summary>
173
-        /// <param name="sender"></param>
174
-        /// <param name="e"></param>
175
-        private void btnDown_Click(object sender, RoutedEventArgs e)
176
-        {
177
-            APP.SaveWkData();
178
-            Hide();
179
-        }
180
-
181
-        /// <summary>
182
-        /// 窗口移动
183
-        /// </summary>
184
-        /// <param name="sender"></param>
185
-        /// <param name="e"></param>
186
-        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
187
-        {
188
-            DragMove();
189
-        }
190
-
191
-        /// <summary>
192
-        /// 上传
193
-        /// </summary>
194
-        /// <param name="sender"></param>
195
-        /// <param name="e"></param>
196
-        private void BtnUpload_Click(object sender, RoutedEventArgs e)
197
-        {
198
-            pageData.menuList[Subscript].IsEnabled = false;
199
-            List<Button> buttons = FindChilds<Button>(listView1, "btnUpload");
200
-            for (int i = 0; i < buttons.Count; i++)
201
-            {
202
-                if (buttons[i] == sender)
203
-                {
204
-                    DAL_Upload dAL_Upload = new DAL_Upload();
205
-
206
-                    if (dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid, out string ErrMessage))
207
-                    {
208
-                        pageData.menuList[i].Visi = "Visible";
209
-                        pageData.menuList[i].Coll = "Collapsed";
210
-
211
-                        DataContext = pageData;
212
-
213
-                        MessageWindow.Show("视频上传成功!");
214
-                    }
215
-                    else
216
-                    {
217
-                        MessageWindow.Show(ErrMessage);
218
-                    }
219
-                }
220
-            }
221
-        }
222
-
223
-        /// <summary>
224
-        /// 删除
225
-        /// </summary>
226
-        /// <param name="sender"></param>
227
-        /// <param name="e"></param>
228
-        private void BtnDelete_Click(object sender, RoutedEventArgs e)
229
-        {
230
-            pageData.menuList[Subscript].IsEnabled = false;
231
-            List<Button> buttons = FindChilds<Button>(listView1, "btnDelete");
232
-            for (int i = 0; i < buttons.Count; i++)
233
-            {
234
-                if (buttons[i] == sender)
235
-                {
236
-                    //if (APP.W_PromptWindow == null)
237
-                    //{
238
-                    //    APP.W_PromptWindow = new PromptWindow();
239
-                    //    APP.W_PromptWindow.Owner = this;
240
-                    //}
241
-                    //APP.W_PromptWindow.Initialize(pageData.menuList[i].VideoName);
242
-                    //APP.W_PromptWindow.ShowDialog();
243
-
244
-                    foreach (Model_WKData wKData in APP.WKDataList)
245
-                    {
246
-                        if (wKData.VideoList == null)
247
-                        {
248
-                            continue;
249
-                        }
250
-
251
-                        if (wKData.VideoList.Exists(x => x.FileGuid == pageData.menuList[i].FileGuid))
252
-                        {
253
-                            try
254
-                            {
255
-                                FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid).VideoPath);
256
-                                FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid).ThumbnailPath);
257
-                                wKData.VideoList.Remove(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid));
258
-                                Initialize();
259
-                                return;
260
-                            }
261
-                            catch (Exception ex)
262
-                            {
263
-                                MessageWindow.Show("无法删除视频!" + ex.Message);
264
-                                return;
265
-                            }
266
-                        }
267
-                    }
268
-                }
269
-            }
270
-        }
271
-
272
-        /// <summary>
273
-        /// 播放
274
-        /// </summary>
275
-        /// <param name="sender"></param>
276
-        /// <param name="e"></param>
277
-        private void BtnPlay_Click(object sender, RoutedEventArgs e)
278
-        {
279
-            pageData.menuList[Subscript].IsEnabled = false;
280
-            List<Button> buttons = FindChilds<Button>(listView1, "btnPlay");
281
-            for (int i = 0; i < buttons.Count; i++)
282
-            {
283
-                if (buttons[i] == sender)
284
-                {
285
-                    try
286
-                    {
287
-                        ProcessStartInfo psi = new ProcessStartInfo(pageData.menuList[i].Path);
288
-                        Process pro = new Process
289
-                        {
290
-                            StartInfo = psi
291
-                        };
292
-                        pro.Start();
293
-                    }
294
-                    catch (Exception ex)
295
-                    {
296
-                        LogHelper.WriteErrLog("FileDirectoryWindow【BtnPlay_Click】" + ex.Message, ex);
297
-                        MessageWindow.Show(ex.Message);
298
-                        return;
299
-                    }
300
-                }
301
-            }
302
-        }
303
-
304
-        public static List<T> FindChilds<T>(DependencyObject parent, string childName)
305
-  where T : DependencyObject
306
-        {
307
-            List<T> list = new List<T>();
308
-            if (parent == null)
309
-            {
310
-                return list;
311
-            }
312
-
313
-            int childrenCount = VisualTreeHelper.GetChildrenCount(parent);
314
-            for (int i = 0; i < childrenCount; i++)
315
-            {
316
-                DependencyObject child = VisualTreeHelper.GetChild(parent, i);
317
-                // 如果子控件不是需查找的控件类型
318
-                var childType = child as T;
319
-                if (childType == null)
320
-                {
321
-                    // 在下一级控件中递归查找
322
-                    List<T> findChildList = FindChilds<T>(child, childName);
323
-                    for (int j = 0; j < findChildList.Count; j++)
324
-                    {
325
-                    }
326
-                    list.AddRange(FindChilds<T>(child, childName));
327
-                }
328
-                else if (!string.IsNullOrEmpty(childName))
329
-                {
330
-                    FrameworkElement frameworkElement = child as FrameworkElement;
331
-                    // 如果控件名称符合参数条件
332
-                    if (frameworkElement != null && frameworkElement.Name == childName)
333
-                    {
334
-                        list.Add((T)child);
335
-                    }
336
-                }
337
-                else
338
-                {
339
-                    // 查找到了控件
340
-                    list.Add((T)child);
341
-                }
342
-            }
343
-
344
-            return list;
345
-        }
346
-
347
-        /// <summary>
348
-        /// 修改
349
-        /// </summary>
350
-        /// <param name="sender"></param>
351
-        /// <param name="e"></param>
352
-        private void BtnModify_Click(object sender, RoutedEventArgs e)
353
-        {
354
-            if (IsModify)
355
-            {
356
-                pageData.menuList[Subscript].IsEnabled = false;
357
-            }
358
-            List<Button> buttons = FindChilds<Button>(listView1, "btnModify");
359
-            for (int i = 0; i < buttons.Count; i++)
360
-            {
361
-                if (buttons[i] == sender)
362
-                {
363
-                    pageData.menuList[i].IsEnabled = true;
364
-                    Subscript = i;
365
-                    IsModify = true;
366
-                }
367
-            }
368
-        }
369
-
370
-        //private int MouseNumber = 0;
371
-        /// <summary>
372
-        /// 鼠标按下
373
-        /// </summary>
374
-        /// <param name="sender"></param>
375
-        /// <param name="e"></param>
376
-        private void Window_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
377
-        {
378
-            //if (IsModify)
379
-            //{
380
-            //    if (MouseNumber > 0 && pageData.menuList.Count > Subscript)
381
-            //    {
382
-            //        pageData.menuList[Subscript].IsEnabled = false;
383
-            //        try
384
-            //        {
385
-            //            if (!pageData.menuList[Subscript].Name.Equals(pageData.menuList[Subscript].VideoName))
386
-            //            {
387
-            //                string tempPath = pageData.menuList[Subscript].VideoName + pageData.menuList[Subscript].VideoType;
388
-            //                tempPath = pageData.menuList[Subscript].Path.Replace(tempPath, "").Trim();
389
-            //                tempPath = tempPath + pageData.menuList[Subscript].Name;
390
-            //                FileToolsCommon.MoveDirectory(pageData.menuList[Subscript].Path, tempPath, out string Message);
391
-            //            }
392
-            //        }
393
-            //        catch (Exception ex)
394
-            //        {
395
-            //            MessageWindow.Show("无法修改视频名称!" + ex.Message);
396
-            //            return;
397
-            //        }
398
-            //    }
399
-            //    MouseNumber++;
400
-            //}
401
-        }
402
-
403
-        private void Window_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
404
-        {
405
-            // if (IsModify) { if (MouseNumber > 0 && pageData.menuList.Count > Subscript) {
406
-            // MouseNumber = 0; pageData.menuList[Subscript].IsEnabled = false; try { if
407
-            // (!pageData.menuList[Subscript].Name.Equals(pageData.menuList[Subscript].VideoName)) {
408
-            // MouseNumber = 0; string tempPath = pageData.menuList[Subscript].FilePath +
409
-            // pageData.menuList[Subscript].VideoName + "." +
410
-            // pageData.menuList[Subscript].VideoType; if (FileToolsCommon.IsExistFile(tempPath)) {
411
-            // MessageWindow.Show("文件名已存在!"); return; } foreach (Model_WKData wKData in
412
-            // APP.WKDataList) { if (wKData.VideoList == null) continue; if
413
-            // (wKData.VideoList.Exists(x => x.FileGuid == pageData.menuList[Subscript].FileGuid)) {
414
-            // try { //FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid ==
415
-            // pageData.menuList[Subscript].FileGuid).VideoPath);
416
-            // //FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid ==
417
-            // pageData.menuList[Subscript].FileGuid).ThumbnailPath);
418
-            // //wKData.VideoList.Remove(wKData.VideoList.Find(x => x.FileGuid ==
419
-            // pageData.menuList[Subscript].FileGuid)); //Initialize(); //return; } catch (Exception
420
-            // ex) { MessageWindow.Show("无法删除视频!" + ex.Message); return; } } }
421
-            // FileToolsCommon.Copy(pageData.menuList[Subscript].Path, tempPath); } } catch
422
-            // (Exception ex) { MessageWindow.Show("无法修改视频名称!" + ex.Message); return; } }
423
-            // MouseNumber++; }
424
-        }
425
-
426
-        /// <summary>
427
-        /// 修改文件名
428
-        /// </summary>
429
-        /// <param name="Guid">唯一编号</param>
430
-        /// <param name="NewName">新文件名带后缀 不带路径</param>
431
-        /// <param name="Errmessage">错误信息</param>
432
-        /// <returns></returns>
433
-        private bool ModifyPathName(string FileGuid, string NewName, out string Errmessage)
434
-        {
435
-            Errmessage = "";
436
-            Model_Video model_Video = APP.VideoList.Find(x => x.FileGuid == FileGuid);
437
-            string filePathName = model_Video.VideoPath;
438
-            string filePath = FileToolsCommon.GetDirectoryName(filePathName);
439
-            string newFilePathName = filePath + NewName;
440
-            //缩略图
441
-            string ThumbnailPath = filePath + "ThumbnailPath/";
442
-            FileToolsCommon.CreateDirectory(ThumbnailPath);
443
-            //缩略图存储位置
444
-            string ThumbnailPathName = ThumbnailPath + NewName.Replace(".", "") + ".JPG";
445
-            if (FileToolsCommon.IsExistFile(newFilePathName))
446
-            {
447
-                Errmessage = "文件已存在,请重新修改文件名!";
448
-                return false;
449
-            }
450
-            else
451
-            {
452
-                //修改文件名
453
-                FileToolsCommon.Copy(filePathName, newFilePathName);
454
-                model_Video.VideoPath = newFilePathName;
455
-                //修改缩略图名
456
-                FileToolsCommon.DeleteFile(ThumbnailPathName);
457
-                FileToolsCommon.Copy(model_Video.ThumbnailPath, ThumbnailPathName);
458
-                model_Video.ThumbnailPath = ThumbnailPathName;
459
-                APP.SaveWkData();
460
-                return true;
461
-            }
462
-        }
463
-    }
464
-}

+ 2
- 0
XHWK.WKTool/KeyVerification.xaml.cs View File

26
             InitializeComponent();
26
             InitializeComponent();
27
             Topmost = true;
27
             Topmost = true;
28
             WindowStartupLocation = WindowStartupLocation.CenterScreen;
28
             WindowStartupLocation = WindowStartupLocation.CenterScreen;
29
+
30
+            Console.WriteLine("初始化KeyVerification");
29
         }
31
         }
30
 
32
 
31
 
33
 

+ 1
- 10
XHWK.WKTool/LoginWindow.xaml.cs View File

27
         {
27
         {
28
             InitializeComponent();
28
             InitializeComponent();
29
 
29
 
30
-            #region 获取服务接口地址 --2021年7月9日赵耀
31
-
32
-            if (APP.ServiceAddress == null)
33
-            {
34
-                MessageWindow.Show("首次使用需设置服务地址。");
35
-                BtnServiceAddress_Click(null, null);
36
-            }
37
-
38
-            #endregion 获取服务接口地址 --2021年7月9日赵耀
39
-
40
             Initialize();
30
             Initialize();
41
         }
31
         }
42
 
32
 
120
                 accountNumber = txbAccountNumber.Text.Replace(" ", "").Trim();
110
                 accountNumber = txbAccountNumber.Text.Replace(" ", "").Trim();
121
                 password = pobPassword.Password.Replace(" ", "").Trim();
111
                 password = pobPassword.Password.Replace(" ", "").Trim();
122
             }));
112
             }));
113
+
123
             int code = @interface.Login(accountNumber, password);
114
             int code = @interface.Login(accountNumber, password);
124
             if (code == 0)
115
             if (code == 0)
125
             {
116
             {

+ 92
- 34
XHWK.WKTool/MessageWindow.xaml View File

1
-<Window x:Class="XHWK.WKTool.MessageWindow"
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="星火微课" WindowStartupLocation="CenterScreen"
9
-    WindowStyle="None" AllowsTransparency="True"    WindowState="Normal"
10
-    ShowInTaskbar="False"  Topmost="True" ResizeMode="NoResize" 
11
-        d:DesignHeight="250" Width="600" Height="220"  MouseMove="Window_MouseMove"  BorderThickness="7">
12
-    <Window.Effect>
13
-        <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
14
-    </Window.Effect>
15
-    <Grid>
16
-        <Grid.RowDefinitions>
17
-            <RowDefinition Height="50"/>
18
-            <RowDefinition Height="100*"/>
19
-            <RowDefinition Height="70"/>
20
-        </Grid.RowDefinitions>
21
-        <Grid Grid.Row="0">
22
-            <Label x:Name="lblTitle" Content="提示" HorizontalAlignment="Left" Margin="14,10,0,0" VerticalAlignment="Top" Foreground="#FF333333" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" FontSize="20" FontWeight="Bold"/>
23
-        </Grid>
24
-        <Grid Grid.Row="1">
25
-            <TextBlock x:Name="tbkContent" Margin="20,0,20,0" TextWrapping="Wrap" VerticalAlignment="Center" FontSize="20" Foreground="#FF919191" Grid.Row="1" HorizontalAlignment="Center" Text=""/>
26
-        </Grid>
27
-        <Grid Grid.Row="2" Margin="0,0,0,0">
28
-            <Border x:Name="borOk" Background="#2D8CF0" CornerRadius="6" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,30,20">
29
-                <Button x:Name="BtnOK" Width="104" Height="42" Content="确定" FontSize="20"  Background="#00000000"  BorderBrush="{x:Null}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Foreground="White"  Cursor="Hand" Click="BtnOK_Click" IsDefault="True"/>
30
-            </Border>
31
-            <Border x:Name="borCancel" Background="#E5E5E5" CornerRadius="6"  HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,150,20">
32
-                <Button x:Name="BtnCancel" Width="104" Height="42" Content="取消" FontSize="20" Background="#00000000" BorderBrush="{x:Null}"  Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"  Cursor="Hand" Click="BtnCancel_Click"/>
33
-            </Border>
1
+<Window
2
+    x:Class="XHWK.WKTool.MessageWindow"
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="星火微课"
9
+    Width="446"
10
+    Height="188"
11
+    d:DesignHeight="250"
12
+    AllowsTransparency="True"
13
+    MouseMove="Window_MouseMove"
14
+    ResizeMode="NoResize"
15
+    ShowInTaskbar="False"
16
+    Topmost="True"
17
+    WindowStartupLocation="CenterScreen"
18
+    WindowState="Normal"
19
+    WindowStyle="None"
20
+    mc:Ignorable="d">
21
+
22
+    <Border BorderBrush="#eeeeee" BorderThickness="1">
23
+        <Grid>
24
+            <Grid.RowDefinitions>
25
+                <RowDefinition Height="42" />
26
+                <RowDefinition Height="*" />
27
+                <RowDefinition Height="60" />
28
+            </Grid.RowDefinitions>
29
+            <Grid Grid.Row="0" Background="#3f6fff">
30
+                <Label
31
+                    x:Name="lblTitle"
32
+                    Margin="14,0,0,0"
33
+                    HorizontalAlignment="Left"
34
+                    VerticalAlignment="Center"
35
+                    HorizontalContentAlignment="Stretch"
36
+                    VerticalContentAlignment="Stretch"
37
+                    Content="提示"
38
+                    FontSize="16"
39
+                    Foreground="White" />
40
+
41
+                <Button
42
+                    x:Name="borCancel"
43
+                    Grid.Row="0"
44
+                    Width="46"
45
+                    HorizontalAlignment="Right"
46
+                    VerticalAlignment="Stretch"
47
+                    Click="BtnCancel_Click"
48
+                    Content="×"
49
+                    Cursor="Hand"
50
+                    FontSize="30"
51
+                    Foreground="White" />
52
+            </Grid>
53
+            <Grid Grid.Row="1">
54
+                <TextBlock
55
+                    x:Name="tbkContent"
56
+                    Grid.Row="1"
57
+                    Margin="20,0,20,0"
58
+                    HorizontalAlignment="Center"
59
+                    VerticalAlignment="Center"
60
+                    FontSize="16"
61
+                    Foreground="#333333"
62
+                    Text=""
63
+                    TextWrapping="Wrap" />
64
+            </Grid>
65
+            <Grid Grid.Row="2" Margin="0,0,0,0">
66
+
67
+                <Border
68
+                    x:Name="borOk"
69
+                    Margin="0,0,10,0"
70
+                    HorizontalAlignment="Right"
71
+                    VerticalAlignment="Center"
72
+                    Background="#3f6fff"
73
+                    CornerRadius="6">
74
+                    <Button
75
+                        x:Name="BtnOK"
76
+                        Width="76"
77
+                        Height="30"
78
+                        Background="#00000000"
79
+                        BorderBrush="{x:Null}"
80
+                        Click="BtnOK_Click"
81
+                        Content="确定"
82
+                        Cursor="Hand"
83
+                        FontSize="14"
84
+                        Foreground="White"
85
+                        IsDefault="True" />
86
+                </Border>
87
+
88
+            </Grid>
89
+
34
         </Grid>
90
         </Grid>
35
 
91
 
36
-    </Grid>
92
+    </Border>
93
+
94
+
37
 </Window>
95
 </Window>

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

38
             Height = ThisHeight;
38
             Height = ThisHeight;
39
             //if (ColorType == 0)//Blue
39
             //if (ColorType == 0)//Blue
40
             //{
40
             //{
41
-            //    BorderBlack.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#2D8CF0"));
41
+            //    BorderBlack.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3f6fff"));
42
             //}
42
             //}
43
             //else if (ColorType == 1)//Black
43
             //else if (ColorType == 1)//Black
44
             //{
44
             //{
46
             //}
46
             //}
47
             //else
47
             //else
48
             //{
48
             //{
49
-            //    BorderBlack.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#2D8CF0"));
49
+            //    BorderBlack.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3f6fff"));
50
             //}
50
             //}
51
             // + 330;
51
             // + 330;
52
             //Console.WriteLine(this.Top + "min");
52
             //Console.WriteLine(this.Top + "min");

+ 0
- 181
XHWK.WKTool/PrintWindow.xaml View File

1
-<Window x:Class="XHWK.WKTool.PrintWindow"
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" xmlns:Views="clr-namespace:XHWK.WKTool.Helpers"
7
-        mc:Ignorable="d"
8
-        Title="PrintWindow" AllowsTransparency="True"
9
-    ShowInTaskbar="False"
10
-    WindowStartupLocation="CenterOwner"
11
-    WindowStyle="None"  BorderThickness="7" Width="914" Height="614">
12
-    <Window.Effect>
13
-        <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
14
-    </Window.Effect>
15
-    <Window.Resources>
16
-        <Style x:Key="NoMouseOverButtonStyle" TargetType="{x:Type Button}">
17
-            <Setter Property="BorderThickness" Value="1"/>
18
-            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
19
-            <Setter Property="HorizontalContentAlignment" Value="Center"/>
20
-            <Setter Property="VerticalContentAlignment" Value="Center"/>
21
-            <Setter Property="Padding" Value="1"/>
22
-            <Setter Property="Template">
23
-                <Setter.Value>
24
-                    <ControlTemplate TargetType="{x:Type Button}">
25
-                        <Border x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
26
-                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
27
-                        </Border>
28
-                    </ControlTemplate>
29
-                </Setter.Value>
30
-            </Setter>
31
-        </Style>
32
-    </Window.Resources>
33
-
34
-    <Viewbox>
35
-        <Grid x:Name="GridContent" Width="900" Height="600">
36
-            <Grid.RowDefinitions>
37
-                <RowDefinition Height="120"/>
38
-                <RowDefinition Height="*"/>
39
-                <RowDefinition Height="80"/>
40
-            </Grid.RowDefinitions>
41
-            <Grid Grid.Row="0" Background="#E6EAF0" MouseLeftButtonDown="Window_MouseLeftButtonDown">
42
-                <Grid.RowDefinitions>
43
-                    <RowDefinition Height="50"/>
44
-                    <RowDefinition Height="50"/>
45
-                    <RowDefinition Height="*"/>
46
-                </Grid.RowDefinitions>
47
-                <Button Cursor="Hand" Grid.Row="0" x:Name="btnClose" Background="#CC4848" Foreground="#FFFFFF" Content="×" FontSize="20" Width="30" Height="30" HorizontalAlignment="Right" Margin="0,0,10,0" Click="BtnClose_Click" Style="{StaticResource NoMouseOverButtonStyle}">
48
-
49
-                </Button>
50
-                <StackPanel Grid.Row="1" HorizontalAlignment="Left" Orientation="Horizontal" Margin="10,2,0,0" Height="40">
51
-                    <TextBlock  Text="打印机:"  FontSize="20" Padding="0,5,0,0"/>
52
-                    <ComboBox Cursor="Hand" Width="210"
53
-                                x:Name="cmbClass"
54
-                                Padding="30,0,10,0"
55
-                                VerticalContentAlignment="Center"
56
-                                BorderThickness="0"
57
-                                DisplayMemberPath="Value"
58
-                                FontSize="14"
59
-                                SelectedValuePath="Key"
60
-                                />
61
-                    <TextBlock Text="份数:" FontSize="20" Margin="50,0,0,0" Padding="0,5,0,0" HorizontalAlignment="Right"/>
62
-                    <TextBlock x:Name="txbNumberOfCopies" Width="100" Text="1" FontSize="16" Padding="50,10,0,0" Background="White"/>
63
-                    <Grid>
64
-                        <Grid.RowDefinitions>
65
-                            <RowDefinition Height="auto"/>
66
-                            <RowDefinition Height="auto"/>
67
-                        </Grid.RowDefinitions>
68
-                        <Button Cursor="Hand" Grid.Row="0" x:Name="btnAdd"  Content="+" Click="BtnAdd_Click"/>
69
-                        <Button Cursor="Hand" Grid.Row="1" x:Name="btnLess"  Content="-" Click="BtnLess_Click"/>
70
-                    </Grid>
71
-
72
-                    <TextBlock  Text="DPI:"  FontSize="20" Padding="50,5,0,0"/>
73
-                    <ComboBox Cursor="Hand" Width="210"
74
-                                x:Name="CbxDpi"
75
-                                Padding="30,0,10,0"
76
-                                VerticalContentAlignment="Center"
77
-                                BorderThickness="0"
78
-                                DisplayMemberPath="Value"
79
-                                FontSize="14"
80
-                                SelectedValuePath="Key"
81
-                                />
82
-                    <!--<TextBlock Text="点型:" FontSize="20"  Margin="120,10,0,0"/>
83
-                <RadioButton x:Name="rbnSquarePoint" Content="方点" FontSize="16"  Margin="0,15,0,0" IsChecked="True"/>
84
-                <RadioButton x:Name="rbnDots" Content="圆点" FontSize="16"  Margin="0,15,0,0"/>-->
85
-                </StackPanel>
86
-                <TextBlock  Text="类型:"  FontSize="20" Padding="50,5,0,0" Margin="523,0,273,10" Visibility="Hidden" />
87
-                <ComboBox Cursor="Hand"
88
-                    x:Name="CbxType"
89
-                    Padding="30,0,10,0"
90
-                    VerticalContentAlignment="Center"
91
-                    BorderThickness="0"
92
-                    DisplayMemberPath="Value"
93
-                    FontSize="14"
94
-                    SelectedValuePath="Key"
95
-                                Margin="626,0,64,10" Visibility="Hidden"
96
-                                />
97
-            </Grid>
98
-
99
-            <Views:ZJClippingBorder Grid.Row="0" x:Name="tip_outer" Margin="0" Background="#FFE6EAF0" CornerRadius="4" Visibility="Collapsed">
100
-                <Grid>
101
-                    <Label Content="打印中..." HorizontalAlignment="Center" Margin="0,20,0,0" Height="35" VerticalAlignment="Top" FontSize="20"></Label>
102
-                    <ProgressBar BorderBrush="#4597FF"
103
-                             Foreground="#4597FF"
104
-                    Grid.Row="0"
105
-                    x:Name="pgbProcess"
106
-                    Height="20"
107
-                    Margin="50,20,50,0"
108
-                    Visibility="Visible" />
109
-                    <Label Grid.Row="0"
110
-                    HorizontalAlignment="Center" Width="60"
111
-                    x:Name="lbProcess"
112
-                    Height="30"
113
-                    Margin="0,20,0,0"
114
-                       FontSize="16"
115
-                    Content=""
116
-                       Foreground="White"
117
-                    Visibility="Visible" />
118
-                </Grid>
119
-            </Views:ZJClippingBorder>
120
-            <Grid Grid.Row="1">
121
-                <Image x:Name="imgPri"/>
122
-            </Grid>
123
-
124
-            <Button
125
-                    x:Name="btnPrint"
126
-                    Grid.Row="2"
127
-                    Width="115"
128
-                    Height="46"
129
-                    Click="BtnPrint_Click"
130
-                    Content="打印"
131
-            Foreground="White"
132
-                    FontSize="17"
133
-                    IsDefault="True"
134
-                    Cursor="Hand"
135
-                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,150,0">
136
-                <Button.Template>
137
-                    <ControlTemplate TargetType="{x:Type Button}">
138
-                        <Border
139
-                                BorderBrush="{TemplateBinding Control.BorderBrush}"
140
-                                BorderThickness="1"
141
-                                CornerRadius="7">
142
-                            <Border.Background>#2E8CF0</Border.Background>
143
-                            <ContentPresenter
144
-                                    HorizontalAlignment="Center"
145
-                                    VerticalAlignment="Center"
146
-                                    Content="{TemplateBinding ContentControl.Content}" />
147
-                        </Border>
148
-                    </ControlTemplate>
149
-                </Button.Template>
150
-            </Button>
151
-            <Button
152
-                x:Name="btnPrintExplain"
153
-                Grid.Row="2"
154
-                Width="116"
155
-                Height="46"
156
-                Content="打印说明"
157
-                Foreground="White"
158
-                FontSize="17"
159
-                IsDefault="True"
160
-                Cursor="Hand"
161
-                Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="150,0,0,0" HorizontalAlignment="Center" Click="btnPrintExplain_Click">
162
-                <Button.Template>
163
-                    <ControlTemplate TargetType="{x:Type Button}">
164
-                        <Border
165
-                            BorderBrush="{TemplateBinding BorderBrush}"
166
-                            BorderThickness="1"
167
-                            CornerRadius="7">
168
-                            <Border.Background>
169
-                                <Brush>#2E8CF0</Brush>
170
-                            </Border.Background>
171
-                            <ContentPresenter
172
-                                HorizontalAlignment="Center"
173
-                                VerticalAlignment="Center"
174
-                                Content="{TemplateBinding Content}" />
175
-                        </Border>
176
-                    </ControlTemplate>
177
-                </Button.Template>
178
-            </Button>
179
-        </Grid>
180
-    </Viewbox>
181
-</Window>

+ 0
- 709
XHWK.WKTool/PrintWindow.xaml.cs View File

1
-using Common.system;
2
-
3
-using Spire.Pdf;
4
-
5
-using System;
6
-using System.Collections.Generic;
7
-using System.Data;
8
-using System.Drawing;
9
-using System.Drawing.Printing;
10
-using System.IO;
11
-using System.Threading;
12
-using System.Windows;
13
-using System.Windows.Input;
14
-using System.Windows.Media.Imaging;
15
-using System.Windows.Threading;
16
-
17
-using TmatrixLibrary;
18
-
19
-namespace XHWK.WKTool
20
-{
21
-    /// <summary>
22
-    /// 打印
23
-    /// </summary>
24
-    public partial class PrintWindow : Window
25
-    {
26
-        /// <summary>
27
-        /// 下拉框数据源
28
-        /// </summary>
29
-        public DataTable data = new DataTable();
30
-        private DataTable dtComponentsUniqueNo;
31
-
32
-        private System.Timers.Timer times;
33
-        public PrintWindow()
34
-        {
35
-            InitializeComponent();
36
-            double proportion = 1036.0 / 1290.0;
37
-            double Widths = (PrimaryScreen.ScaleWorkingAreaSize.Height) / proportion - (BorderThickness.Left + BorderThickness.Right);
38
-            double Heights = PrimaryScreen.ScaleWorkingAreaSize.Height - (BorderThickness.Top + BorderThickness.Bottom);
39
-            Width = Widths / 1.42;
40
-            Height = Heights / 1.71;
41
-            GridContent.Width = Width + 5;
42
-            GridContent.Height = Height;
43
-            ResizeMode = ResizeMode.NoResize;
44
-            List<string> defaList = LatticeFileHelper.GetPrinterList(out string defa);
45
-            if (defaList.Count > 0)
46
-            {
47
-                data.Columns.Add("Value");
48
-                data.Columns.Add("Key");
49
-                for (int i = 0; i < defaList.Count; i++)
50
-                {
51
-                    //创建一行
52
-                    DataRow row = data.NewRow();
53
-                    //将此行添加到table中
54
-                    data.Rows.Add(row);
55
-                    data.Rows[i]["Value"] = defaList[i];
56
-                    data.Rows[i]["Key"] = i.ToString();
57
-                }
58
-                dtComponentsUniqueNo = data.DefaultView.ToTable();
59
-                cmbClass.ItemsSource = dtComponentsUniqueNo.DefaultView;
60
-                cmbClass.SelectedIndex = 0;
61
-            }
62
-
63
-            Dictionary<int, int> dicItem = new Dictionary<int, int>();
64
-            dicItem.Add(0, 600);
65
-            dicItem.Add(1, 1200);
66
-            CbxDpi.ItemsSource = dicItem;
67
-            CbxDpi.SelectedIndex = 0;
68
-
69
-            Dictionary<int, string> dictypeItem = new Dictionary<int, string>();
70
-            dictypeItem.Add(0, "2x2");
71
-            dictypeItem.Add(1, "3x3");
72
-            dictypeItem.Add(2, "4x4");
73
-            CbxType.ItemsSource = dictypeItem;
74
-            CbxType.SelectedIndex = 0;
75
-        }
76
-
77
-        private double wit = 0;
78
-        private double hei = 0;
79
-        public void Initialize(string _imgPath, double _wit, double _hei)
80
-        {
81
-            wit = _wit;
82
-            hei = _hei;
83
-            if (!string.IsNullOrWhiteSpace(_imgPath))
84
-            {
85
-                imgPri.Source = new BitmapImage(new Uri(_imgPath));
86
-            }
87
-            else
88
-            {
89
-                imgPri.Source = null;
90
-            }
91
-            tip_outer.Visibility = Visibility.Collapsed;
92
-            TQLInit();
93
-        }
94
-
95
-        #region TQL打印
96
-        /// <summary>
97
-        /// 授权文件位置
98
-        /// </summary>
99
-        string TQLAuthorizationPath;
100
-        /// <summary>
101
-        /// 授权码
102
-        /// </summary>
103
-        string gKeyStr;
104
-        TmatrixClass TMC = new TmatrixClass();
105
-        public static string gPrintFileName;
106
-        //string gDirectory = Application.StartupPath;
107
-        //string gFileName = "";
108
-        bool gbInitDone = false;
109
-        //string gUserName = "";
110
-        //string gPassword = "";
111
-        private string gEKeyStr;
112
-
113
-
114
-        iTextSharp.text.Document document;
115
-
116
-        enum TMATRIX_POINT_TYPE
117
-        {
118
-            TmatrixPointType_2x2 = 0,	// 2x2 Point Type
119
-            TmatrixPointType_3x3 = 1,	// 3x3 Point Type
120
-        };
121
-        enum TMATRIX_OBJECT_TYPE
122
-        {
123
-            TMATRIX_OT_ElementCode = 0,	// 此类型对象的Index范围是:75497472~83886079(十六进制为:0x04800000~0x04ffffff)
124
-            TMATRIX_OT_PositionCode,		// 此类型对象没有Index
125
-        };
126
-        /// <summary>
127
-        /// 初始化打印
128
-        /// </summary>
129
-        void TQLInit()
130
-        {
131
-            ///初始化
132
-            if (TMC.TmatrixInitialize() == false)
133
-            {
134
-                //MessageBox.Show(this, "点阵码初始化失败!", "生成点阵码", MessageBoxButtons.OK, MessageBoxIcon.Error);
135
-                //Close();
136
-            }
137
-            else
138
-            {
139
-                gbInitDone = true;
140
-            }
141
-            document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 0, 0, 0, 0);
142
-            try
143
-            {
144
-                TQLAuthorizationPath = FileToolsCommon.GetFileAbsolutePath("/LatticeXML/S0_O000_B0000_P000-255.tmx");
145
-
146
-                StreamReader gsr = new StreamReader(TQLAuthorizationPath);
147
-                gKeyStr = gsr.ReadLine();
148
-                gsr.Close();
149
-                string KeyCheckResult = TMC.TmatrixKeyCheck_OID4(gKeyStr);
150
-
151
-                if (KeyCheckResult.Substring(0, 1) == "1")
152
-                {
153
-                    MessageWindow.Show("打印服务授权过期,请联系厂家更换授权!");
154
-                    LogHelper.WriteErrLog("打印服务授权过期:" + KeyCheckResult, null);
155
-                    gbInitDone = false;
156
-                }
157
-                else if (KeyCheckResult.Substring(0, 1) == "0")
158
-                {
159
-                }
160
-            }
161
-            catch (Exception ex)
162
-            {
163
-                LogHelper.WriteErrLog("打印服务授权失败:" + ex.Message, ex);
164
-                MessageWindow.Show("打印服务授权失败,请联系厂家!");
165
-                gbInitDone = false;
166
-            }
167
-        }
168
-
169
-        /// <summary>
170
-        /// 铺码
171
-        /// </summary>
172
-        private bool GenerateCode(string PDFPath)
173
-        {
174
-            try
175
-            {
176
-                if (gbInitDone == false)
177
-                {
178
-                    MessageWindow.Show("打印功能无法使用,无效授权。");
179
-                    return false;
180
-                }
181
-                try
182
-                {
183
-                    string directoryPath = FileToolsCommon.GetDirectoryName(PDFPath);
184
-                    FileToolsCommon.DeleteDirectory(directoryPath + "Bg with Images/");
185
-                    FileToolsCommon.DeleteDirectory(directoryPath + "Bg with Vector Images/");
186
-                    FileToolsCommon.DeleteDirectory(directoryPath + "Bg without Vector Images/");
187
-                    FileToolsCommon.DeleteDirectory(directoryPath + "Vector Images/");
188
-                }
189
-                catch (Exception)
190
-                {
191
-                }
192
-                int i;
193
-                for (i = 0; i < 4; i++)
194
-                {
195
-                    int DPIValue = 0;
196
-                    int TypeValue = 0;
197
-                    try
198
-                    {
199
-                        DPIValue = CbxDpi.SelectedIndex;
200
-                        //TypeValue = CbxType.SelectedIndex;
201
-
202
-                    }
203
-                    catch (Exception)
204
-                    {
205
-                    }
206
-                    APP.gPointType[i] = TypeValue;
207
-                    APP.gPointDPI[i] = DPIValue;
208
-                }
209
-
210
-                APP.gbGenerateBGWithVImage = false;
211
-                APP.gbGenerateVImage = false;
212
-                APP.gbGenerateBGWithoutVImage = false;
213
-                APP.gbGenerateBGWithImage = true;
214
-
215
-                //初始页
216
-                int SPID = 0;
217
-                //int PointType = (int)(TMATRIX_POINT_TYPE.TmatrixPointType_3x3);
218
-                //string sGenerateResult = TMC.GenerateTmatrixCode(gKeyStr, PDFFileName, SPID, PointType, GlobalClass.gbGenerateBGWithVImage, GlobalClass.gbGenerateVImage, GlobalClass.gbGenerateBGWithoutVImage, GlobalClass.gbGenerateBGWithImage);
219
-                bool[] bPublishImageType = new bool[4];
220
-                bPublishImageType[0] = APP.gbGenerateBGWithVImage;
221
-                bPublishImageType[1] = APP.gbGenerateVImage;
222
-                bPublishImageType[2] = APP.gbGenerateBGWithoutVImage;
223
-                bPublishImageType[3] = APP.gbGenerateBGWithImage;
224
-                PDFPath = PDFPath.Replace("/", "\\");
225
-                string sGenerateResult = TMC.GenerateTmatrixCode_OID4(gKeyStr, PDFPath, SPID, APP.gPointType, bPublishImageType, APP.gPointDPI);
226
-                if (sGenerateResult.Substring(0, 1) == "1")
227
-                {
228
-                    Dispatcher.Invoke(() =>
229
-                    {
230
-                        MessageWindow.Show("打印功能无法使用,无效授权。");
231
-                    });
232
-
233
-                    return false;
234
-                }
235
-                else if (sGenerateResult.Substring(0, 1) == "0")
236
-                {
237
-                    //生成成功
238
-                    //打印
239
-                    //Dispatcher.Invoke(() =>
240
-                    //{
241
-                    //});
242
-                }
243
-                return true;
244
-
245
-            }
246
-            catch (Exception ex)
247
-            {
248
-                Dispatcher.Invoke(() =>
249
-                {
250
-                    MessageWindow.Show("打印失败:" + ex.Message);
251
-                });
252
-                return false;
253
-            }
254
-        }
255
-        #endregion
256
-
257
-        /// <summary>
258
-        /// 打印
259
-        /// </summary>
260
-        /// <param name="sender"></param>
261
-        /// <param name="e"></param>
262
-        private void BtnPrint_Click(object sender, RoutedEventArgs e)
263
-        {
264
-            if (string.IsNullOrWhiteSpace(cmbClass.Text))
265
-            {
266
-                MessageWindow.Show("请设置打印机!");
267
-                return;
268
-            }
269
-            btnClose.IsEnabled = false;
270
-            btnPrint.IsEnabled = false;
271
-            Thread myThread = new Thread(StartPrint);
272
-            List<string> StrList = new List<string>();
273
-
274
-            int ipdf = 102;
275
-            string imgPath = FileToolsCommon.GetFileAbsolutePath("temp/");
276
-            string tempImgPath = imgPath;
277
-            imgPath += "101.pdf";
278
-            while (File.Exists(imgPath))
279
-            {
280
-                imgPath = tempImgPath + ipdf.ToString() + ".pdf";
281
-                ipdf++;
282
-            }
283
-            StrList.Add(imgPath);
284
-            //打印数量
285
-            int PrinterNum = Convert.ToInt32(txbNumberOfCopies.Text);
286
-            StrList.Add(PrinterNum.ToString());
287
-            //打印机名称
288
-            string PrinterName = cmbClass.Text;
289
-            StrList.Add(PrinterName);
290
-
291
-            num = 0;
292
-            tip_outer.Visibility = Visibility.Visible;
293
-            myThread.Start(StrList);
294
-            times = new System.Timers.Timer(100);
295
-            times.Elapsed += Times_ElapsedClick;
296
-            times.Start();
297
-        }
298
-
299
-        private int num = 0;
300
-        /// <summary>
301
-        /// 计时器
302
-        /// </summary>
303
-        /// <param name="sender"></param>
304
-        /// <param name="e"></param>
305
-        private void Times_ElapsedClick(object sender, System.Timers.ElapsedEventArgs e)
306
-        {
307
-            Dispatcher.Invoke(() =>
308
-            {
309
-                pgbProcess.Value = num;
310
-                lbProcess.Content = num.ToString() + "%";
311
-                if (num < 99)
312
-                {
313
-                    num++;
314
-                    times.Interval += (num / 2);
315
-                }
316
-                else
317
-                {
318
-                    times.Stop();
319
-                }
320
-            });
321
-        }
322
-
323
-        /// <summary>
324
-        /// 开始打印
325
-        /// </summary>
326
-        private void StartPrint(object obj)
327
-        {
328
-            try
329
-            {
330
-                document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 0f, 0f, 0f, 0f);
331
-
332
-                //iTextSharp.text.Rectangle page = new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.A4., 250f);//cs
333
-                ////设置纸张横向
334
-                //document.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
335
-
336
-                List<string> objStr1 = (List<string>)obj;
337
-                string SourcePath1 = objStr1[0];
338
-                try
339
-                {
340
-                    SourcePath1 = SourcePath1.Replace("/", "\\");
341
-                    FileStream fs = new FileStream(SourcePath1, FileMode.Create, FileAccess.ReadWrite);
342
-                    document.AddAuthor("星火微课");//作者
343
-                    document.AddCreationDate();//创建时候
344
-                    document.AddCreator("星火微课");//创建者
345
-                    document.AddSubject("点阵文件");//主题
346
-                    document.AddTitle("PrintTmatrixCode");//标题
347
-                    document.AddKeywords("Print");
348
-
349
-                    document.AddHeader("TmatrixCode", "0");
350
-                    Thread.Sleep(300);
351
-                    //iTextSharp.text.pdf.PdfDocument pdfDocument = new iTextSharp.text.pdf.PdfDocument();
352
-
353
-                    //document.AddDocListener(pdfDocument);
354
-                    //iTextSharp.text.pdf.PdfWriter pdfWriter = new iTextSharp.text.pdf.PdfWriter(pdfDocument, fs);
355
-                    //pdfDocument.AddWriter(pdfWriter);
356
-
357
-                    iTextSharp.text.pdf.PdfWriter.GetInstance(document, fs);
358
-                }
359
-                catch (Exception)
360
-                {
361
-
362
-                }
363
-                document.Open();
364
-                iTextSharp.text.Image image;
365
-                for (int i = 0; i < APP.PageDrawList.Count; i++)
366
-                {
367
-                    long ii = Timestamp();
368
-                    string directoryPath = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
369
-                    string filePathOutPut = Path.Combine(directoryPath, string.Format("print{0}{1}.jpg", ii, i));
370
-                    RectangleF rectangleFs = new RectangleF();
371
-                    MergerImg("", filePathOutPut, rectangleFs, out string errmsg);
372
-                    image = iTextSharp.text.Image.GetInstance(filePathOutPut);
373
-                    if (string.IsNullOrEmpty(APP.PageDrawList[i].PageImagePath))//没有图片
374
-                    {
375
-
376
-                    }
377
-                    else if (APP.PageDrawList[i].ImgDocumentation == true && !APP.PageDrawList[i].Type.Equals("ppt"))
378
-                    {
379
-                        image = iTextSharp.text.Image.GetInstance(APP.PageDrawList[i].PageImagePath);
380
-                    }
381
-                    else
382
-                    {
383
-                        RectangleF rectangleF = new RectangleF(0, 0, 0, 0);
384
-                        Dispatcher.Invoke(() =>
385
-                        {
386
-                            rectangleF = new RectangleF
387
-                            {
388
-                                Width = (float)APP.PageDrawList[i].ImageSizes.CenterX,
389
-                                Height = (float)APP.PageDrawList[i].ImageSizes.CenterY,
390
-                                X = (float)APP.PageDrawList[i].ImageLocation.X,
391
-                                Y = (float)APP.PageDrawList[i].ImageLocation.Y
392
-                            };
393
-                        });
394
-                        string msgs = string.Empty;
395
-
396
-                        bool isImg = MergerImg(APP.PageDrawList[i].PageImagePath, filePathOutPut, rectangleF, out msgs);
397
-                        if (isImg)
398
-                        {
399
-                            image = iTextSharp.text.Image.GetInstance(filePathOutPut);
400
-                        }
401
-                        else
402
-                        {
403
-                            image = iTextSharp.text.Image.GetInstance(APP.PageDrawList[i].PageImagePath);
404
-                        }
405
-
406
-
407
-                    }
408
-                    if (image.Height > iTextSharp.text.PageSize.A4.Height)
409
-                    {
410
-                        image.ScaleToFit(iTextSharp.text.PageSize.A4.Width, iTextSharp.text.PageSize.A4.Height);
411
-                    }
412
-                    else if (image.Width > iTextSharp.text.PageSize.A4.Width)
413
-                    {
414
-                        image.ScaleToFit(iTextSharp.text.PageSize.A4.Width, iTextSharp.text.PageSize.A4.Height);
415
-                    }
416
-                    image.Alignment = iTextSharp.text.Image.ALIGN_MIDDLE;
417
-                    document.NewPage();
418
-                    document.Add(image);
419
-                    //iTextSharp.text.Chunk c1 = new iTextSharp.text.Chunk("Hello World");
420
-                    //iTextSharp.text.Phrase p1 = new iTextSharp.text.Phrase();
421
-                    //p1.Leading = 150;      //行间距
422
-                    //document.Add(p1);
423
-                }
424
-                //Console.WriteLine("转换成功!");
425
-                document.Close();
426
-            }
427
-            catch (Exception ex)
428
-            {
429
-                Dispatcher.Invoke(() =>
430
-                {
431
-                    btnClose.IsEnabled = true;
432
-                    btnPrint.IsEnabled = true;
433
-                    times.Stop();
434
-                    tip_outer.Visibility = Visibility.Collapsed;
435
-                    MessageWindow.Show(ex.Message);
436
-                    return;
437
-                });
438
-                LogHelper.WriteErrLog("打印转换PDF失败,原因:" + ex.Message, ex);
439
-            }
440
-
441
-
442
-
443
-            List<string> objStr = (List<string>)obj;
444
-            //PDF位置
445
-            string SourcePath = objStr[0];
446
-            int PrinterNum = int.Parse(objStr[1]);
447
-            string PrinterName = objStr[2];
448
-
449
-            Thread.Sleep(500);
450
-            //腾千里生成点阵文件
451
-            if (GenerateCode(SourcePath))
452
-            {
453
-                //打印机名称
454
-                string directoryPath = FileToolsCommon.GetDirectoryName(SourcePath) + "Bg with Images/";
455
-                string[] strs = FileToolsCommon.GetFileNames(directoryPath);
456
-
457
-                try
458
-                {
459
-                    foreach (string fileName in strs)
460
-                    {
461
-                        Print(fileName, PrinterName, (short)PrinterNum);
462
-                    }
463
-                }
464
-                catch (Exception ex)
465
-                {
466
-                    Dispatcher.Invoke(() =>
467
-                    {
468
-                        MessageWindow.Show("打印失败:" + ex.Message);
469
-                        btnClose.IsEnabled = true;
470
-                        btnPrint.IsEnabled = true;
471
-                        times.Stop();
472
-                        tip_outer.Visibility = Visibility.Collapsed;
473
-                        return;
474
-                    });
475
-                }
476
-                Dispatcher.Invoke(() =>
477
-                {
478
-                    btnClose.IsEnabled = true;
479
-                    btnPrint.IsEnabled = true;
480
-                    num = 99;
481
-                    times.Stop();
482
-                    pgbProcess.Value = 100;
483
-                    lbProcess.Content = "100%";
484
-                    tip_outer.Visibility = Visibility.Collapsed;
485
-                    MessageWindow.Show("已加入打印机队列,打印中。");
486
-
487
-
488
-                    ////打印机名称
489
-                    //string directoryPath = FileToolsCommon.GetDirectoryName(SourcePath) + "Bg with Images/";
490
-                    //string[] strs = FileToolsCommon.GetFileNames(directoryPath);
491
-                    //foreach (string fileName in strs)
492
-                    //{
493
-                    //    pdfPrint(directoryPath, PrinterName);
494
-                    //}
495
-                    //MessageWindow.Show("生成点阵文件成功!");
496
-                    //string TPFPath = FileToolsCommon.GetFileAbsolutePath("temp/");
497
-                    //FileToolsCommon.CreateDirectory(TPFPath);
498
-                });
499
-            }
500
-            else
501
-            {
502
-                Dispatcher.Invoke(() =>
503
-                {
504
-                    btnClose.IsEnabled = true;
505
-                    btnPrint.IsEnabled = true;
506
-                    times.Stop();
507
-                    tip_outer.Visibility = Visibility.Collapsed;
508
-                    return;
509
-                });
510
-            }
511
-
512
-            #region 拓思德生成点阵文件
513
-            ////TPF文件位置
514
-            //string TPFPath = FileToolsCommon.GetFileAbsolutePath("temp/");
515
-            //FileToolsCommon.CreateDirectory(TPFPath);
516
-            //TPFPath += "101.TPF";
517
-            ////生成点阵文件
518
-            //LatticeFileHelper.GeneratingPDF(SourcePath, TPFPath, out int pr, out string msg, out string outPut/*, pyte*/);
519
-            //while (!FileToolsCommon.IsExistFile(TPFPath))
520
-            //{
521
-            //    Thread.Sleep(100);
522
-            //}
523
-            //while (string.IsNullOrWhiteSpace(pr.ToString()))
524
-            //{
525
-            //    Thread.Sleep(100);
526
-            //}
527
-            //Thread.Sleep(1000);
528
-            #endregion
529
-
530
-            #region 拓思德打印
531
-            ////打印
532
-            //LatticeFileHelper.PrinterTPFFile(TPFPath, PrinterNum, PrinterName, out int printResult, out string standardError, out string standardOutput);
533
-            //if (printResult == 0)
534
-            //{
535
-            //    Dispatcher.Invoke(() =>
536
-            //    {
537
-            //        btnClose.IsEnabled = true;
538
-            //        btnPrint.IsEnabled = true;
539
-            //        num = 99;
540
-            //        times.Stop();
541
-            //        pgbProcess.Value = 100;
542
-            //        lbProcess.Content = "100%";
543
-            //        MessageWindow.Show("打印成功!");
544
-            //        tip_outer.Visibility = Visibility.Collapsed;
545
-            //    });
546
-            //}
547
-            //else
548
-            //{
549
-            //    Dispatcher.Invoke(() =>
550
-            //    {
551
-            //        btnClose.IsEnabled = true;
552
-            //        btnPrint.IsEnabled = true;
553
-            //        times.Stop();
554
-            //        tip_outer.Visibility = Visibility.Collapsed;
555
-            //        MessageWindow.Show(standardError);
556
-            //    });
557
-            //}
558
-            #endregion
559
-        }
560
-        /// <summary>
561
-        /// 调用打印机打印
562
-        /// </summary>
563
-        /// <param name="PDFPath">PDF文件路径</param>
564
-        /// <param name="PrinterName">打印机名称</param>
565
-        void Print(string PDFPath, string PrinterName, short PrinterNum = 1)
566
-        {
567
-            //加载PDF文档
568
-            PdfDocument doc = new PdfDocument();
569
-            doc.LoadFromFile(PDFPath);
570
-
571
-            //指定打印机
572
-            doc.PrintSettings.PrinterName = PrinterName;
573
-
574
-            //静默打印PDF文档
575
-            doc.PrintSettings.PrintController = new StandardPrintController();
576
-
577
-            ////设置文档打印页码范围
578
-            //doc.PrintSettings.SelectPageRange(1, 5);
579
-
580
-            //打印不连续的页面
581
-            //doc.PrintSettings.SelectSomePages(new int[] { 1, 3, 5, 7 });
582
-
583
-            //设置打印份数为2份
584
-            doc.PrintSettings.Copies = PrinterNum;
585
-            //打印PDF文档
586
-            doc.Print();
587
-        }
588
-        /// <summary>
589
-        /// 返回一个时间戳到毫秒
590
-        /// </summary>
591
-        /// <returns></returns>
592
-        public static long Timestamp()
593
-        {
594
-            TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
595
-            long timestr = Convert.ToInt64(ts.TotalMilliseconds);
596
-            return timestr;
597
-        }
598
-        /// <summary>
599
-        /// 生成图片
600
-        /// </summary>
601
-        /// <param name="_path">图片地址</param>
602
-        /// <param name="_saveimg">保存位置</param>
603
-        /// <param name="_rectangle">图片位置</param>
604
-        /// <param name="errmsg">错误消息</param>
605
-        /// <returns></returns>
606
-        private bool MergerImg(string _path, string _saveimg, RectangleF _rectangle, out string errmsg)
607
-        {
608
-            errmsg = null;
609
-            try
610
-            {
611
-                Bitmap bitmap = null;
612
-
613
-                //创建要显示的图片对象,根据参数的个数设置宽度
614
-                Bitmap backgroudImg = new Bitmap((int)/*gridM.ActualWidth*/wit, (int)/*gridM.ActualHeight*/hei);
615
-                Graphics g = Graphics.FromImage(backgroudImg);
616
-                //清除画布,背景设置为白色
617
-                g.Clear(System.Drawing.Color.White);
618
-
619
-                if (!string.IsNullOrWhiteSpace(_path))
620
-                {
621
-                    bitmap = ImageHelper.ReadBitmapFile(_path);
622
-                    g.DrawImage(bitmap, _rectangle);
623
-                }
624
-                #region 添加箭头
625
-                string Str = "↑";
626
-                SolidBrush mybrush = new SolidBrush(Color.Black);  //设置默认画刷颜色
627
-                Font myfont = new Font("黑体", 14);         //设置默认字体格式
628
-                g.DrawString(Str, myfont, mybrush, new Rectangle((int)wit - 50, 20, 50, 50));
629
-
630
-                #endregion
631
-                backgroudImg.Save(_saveimg);
632
-
633
-                g.Dispose();
634
-                backgroudImg.Dispose();
635
-                if (bitmap != null)
636
-                {
637
-                    bitmap.Dispose();
638
-                }
639
-
640
-                GC.Collect();
641
-                return true;
642
-            }
643
-            catch (Exception ex)
644
-            {
645
-                errmsg = ex.Message;
646
-                LogHelper.WriteErrLog("【截图合成】(MergerImg)图片合成失败:" + ex.Message, ex);
647
-                return false;
648
-            }
649
-
650
-        }
651
-
652
-        /// <summary>
653
-        /// 窗口移动
654
-        /// </summary>
655
-        /// <param name="sender"></param>
656
-        /// <param name="e"></param>
657
-        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
658
-        {
659
-            DragMove();
660
-        }
661
-        /// <summary>
662
-        /// 关闭
663
-        /// </summary>
664
-        /// <param name="sender"></param>
665
-        /// <param name="e"></param>
666
-        private void BtnClose_Click(object sender, RoutedEventArgs e)
667
-        {
668
-            Hide();
669
-            TMC.TmatrixUninitialize();
670
-        }
671
-        /// <summary>
672
-        /// 减
673
-        /// </summary>
674
-        /// <param name="sender"></param>
675
-        /// <param name="e"></param>
676
-        private void BtnLess_Click(object sender, RoutedEventArgs e)
677
-        {
678
-            int num = Convert.ToInt32(txbNumberOfCopies.Text);
679
-            if (num > 1)
680
-            {
681
-                num--;
682
-                txbNumberOfCopies.Text = num.ToString();
683
-            }
684
-        }
685
-        /// <summary>
686
-        /// 新增
687
-        /// </summary>
688
-        /// <param name="sender"></param>
689
-        /// <param name="e"></param>
690
-        private void BtnAdd_Click(object sender, RoutedEventArgs e)
691
-        {
692
-            int num = Convert.ToInt32(txbNumberOfCopies.Text);
693
-            if (num > 0)
694
-            {
695
-                num++;
696
-                txbNumberOfCopies.Text = num.ToString();
697
-            }
698
-        }
699
-        /// <summary>
700
-        /// 打印说明
701
-        /// </summary>
702
-        /// <param name="sender"></param>
703
-        /// <param name="e"></param>
704
-        private void btnPrintExplain_Click(object sender, RoutedEventArgs e)
705
-        {
706
-            System.Diagnostics.Process.Start(FileToolsCommon.GetFileAbsolutePath("/星火微课点阵码打印及印刷指导手册.docx"));
707
-        }
708
-    }
709
-}

+ 0
- 128
XHWK.WKTool/PrintWindowTStudy.xaml View File

1
-<Window x:Class="XHWK.WKTool.PrintWindowTStudy"
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" xmlns:Views="clr-namespace:XHWK.WKTool.Helpers"
7
-        mc:Ignorable="d"
8
-        Title="PrintWindowTStudy" Height="600" Width="900" AllowsTransparency="True"
9
-    ShowInTaskbar="False"
10
-    WindowStartupLocation="CenterOwner"
11
-    WindowStyle="None"  BorderThickness="7">
12
-    <Window.Effect>
13
-        <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
14
-    </Window.Effect>
15
-    <Window.Resources>
16
-        <Style x:Key="NoMouseOverButtonStyle" TargetType="{x:Type Button}">
17
-            <Setter Property="BorderThickness" Value="1"/>
18
-            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
19
-            <Setter Property="HorizontalContentAlignment" Value="Center"/>
20
-            <Setter Property="VerticalContentAlignment" Value="Center"/>
21
-            <Setter Property="Padding" Value="1"/>
22
-            <Setter Property="Template">
23
-                <Setter.Value>
24
-                    <ControlTemplate TargetType="{x:Type Button}">
25
-                        <Border x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
26
-                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
27
-                        </Border>
28
-                    </ControlTemplate>
29
-                </Setter.Value>
30
-            </Setter>
31
-        </Style>
32
-    </Window.Resources>
33
-    <Grid x:Name="GridContent" Height="600">
34
-        <Grid.RowDefinitions>
35
-            <RowDefinition Height="120"/>
36
-            <RowDefinition Height="*"/>
37
-            <RowDefinition Height="80"/>
38
-        </Grid.RowDefinitions>
39
-        <Grid Grid.Row="0" Background="#E6EAF0" MouseLeftButtonDown="Window_MouseLeftButtonDown">
40
-            <Grid.RowDefinitions>
41
-                <RowDefinition Height="50"/>
42
-                <RowDefinition Height="50"/>
43
-                <RowDefinition Height="*"/>
44
-            </Grid.RowDefinitions>
45
-            <Button Cursor="Hand" Grid.Row="0" x:Name="btnClose" Background="#CC4848" Foreground="#FFFFFF" Content="×" FontSize="20" Width="30" Height="30" HorizontalAlignment="Right" Margin="0,0,10,0" Click="BtnClose_Click" Style="{StaticResource NoMouseOverButtonStyle}">
46
-
47
-            </Button>
48
-            <StackPanel Grid.Row="1" HorizontalAlignment="Left" Orientation="Horizontal" Margin="10,2,0,0" Height="40">
49
-                <TextBlock  Text="打印机:"  FontSize="20" Padding="0,5,0,0"/>
50
-                <ComboBox Cursor="Hand" Width="210"
51
-                                x:Name="cmbClass"
52
-                                Padding="30,0,10,0"
53
-                                VerticalContentAlignment="Center"
54
-                                BorderThickness="0"
55
-                                DisplayMemberPath="Value"
56
-                                FontSize="14"
57
-                                SelectedValuePath="Key"
58
-                                />
59
-                <TextBlock Text="份数:" FontSize="20" Margin="80,0,0,0" Padding="0,5,0,0" HorizontalAlignment="Right"/>
60
-                <TextBlock x:Name="txbNumberOfCopies" Width="100" Text="1" FontSize="16" Padding="50,10,0,0" Background="White"/>
61
-                <Grid>
62
-                    <Grid.RowDefinitions>
63
-                        <RowDefinition Height="auto"/>
64
-                        <RowDefinition Height="auto"/>
65
-                    </Grid.RowDefinitions>
66
-                    <Button Cursor="Hand" Grid.Row="0" x:Name="btnAdd"  Content="+" Click="BtnAdd_Click"/>
67
-                    <Button Cursor="Hand" Grid.Row="1" x:Name="btnLess"  Content="-" Click="BtnLess_Click"/>
68
-                </Grid>
69
-                <!--<TextBlock Text="点型:" FontSize="20"  Margin="120,10,0,0"/>
70
-                <RadioButton x:Name="rbnSquarePoint" Content="方点" FontSize="16"  Margin="0,15,0,0" IsChecked="True"/>
71
-                <RadioButton x:Name="rbnDots" Content="圆点" FontSize="16"  Margin="0,15,0,0"/>-->
72
-            </StackPanel>
73
-        </Grid>
74
-
75
-        <Views:ZJClippingBorder Grid.Row="0" x:Name="tip_outer" Margin="0" Background="#FFE6EAF0" CornerRadius="4" Visibility="Collapsed">
76
-            <Grid>
77
-                <Label Content="打印中..." HorizontalAlignment="Center" Margin="0,20,0,0" Height="35" VerticalAlignment="Top" FontSize="20"></Label>
78
-                <ProgressBar BorderBrush="#4597FF"
79
-                             Foreground="#4597FF"
80
-                    Grid.Row="0"
81
-                    x:Name="pgbProcess"
82
-                    Height="20"
83
-                    Margin="50,20,50,0"
84
-                    Visibility="Visible" />
85
-                <Label Grid.Row="0"
86
-                    HorizontalAlignment="Center" Width="60"
87
-                    x:Name="lbProcess"
88
-                    Height="30"
89
-                    Margin="0,20,0,0"
90
-                       FontSize="16"
91
-                    Content=""
92
-                       Foreground="White"
93
-                    Visibility="Visible" />
94
-            </Grid>
95
-        </Views:ZJClippingBorder>
96
-        <Grid Grid.Row="1">
97
-            <Image x:Name="imgPri"/>
98
-        </Grid>
99
-
100
-        <Button
101
-                    x:Name="btnPrint"
102
-                    Grid.Row="2"
103
-                    Width="115"
104
-                    Height="46"
105
-                    Click="BtnPrint_Click"
106
-                    Content="打印"
107
-            Foreground="White"
108
-                    FontSize="17"
109
-                    IsDefault="True"
110
-                    Cursor="Hand"
111
-                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
112
-            <Button.Template>
113
-                <ControlTemplate TargetType="{x:Type Button}">
114
-                    <Border
115
-                                BorderBrush="{TemplateBinding Control.BorderBrush}"
116
-                                BorderThickness="1"
117
-                                CornerRadius="7">
118
-                        <Border.Background>#2E8CF0</Border.Background>
119
-                        <ContentPresenter
120
-                                    HorizontalAlignment="Center"
121
-                                    VerticalAlignment="Center"
122
-                                    Content="{TemplateBinding ContentControl.Content}" />
123
-                    </Border>
124
-                </ControlTemplate>
125
-            </Button.Template>
126
-        </Button>
127
-    </Grid>
128
-</Window>

+ 0
- 630
XHWK.WKTool/PrintWindowTStudy.xaml.cs View File

1
-using Common.system;
2
-
3
-using System;
4
-using System.Collections.Generic;
5
-using System.Data;
6
-using System.Drawing;
7
-using System.IO;
8
-using System.Threading;
9
-using System.Windows;
10
-using System.Windows.Input;
11
-using System.Windows.Media.Imaging;
12
-using System.Windows.Threading;
13
-
14
-namespace XHWK.WKTool
15
-{
16
-    /// <summary>
17
-    /// 打印
18
-    /// </summary>
19
-    public partial class PrintWindowTStudy : Window
20
-    {
21
-        /// <summary>
22
-        /// 下拉框数据源
23
-        /// </summary>
24
-        public DataTable data = new DataTable();
25
-        private DataTable dtComponentsUniqueNo;
26
-
27
-        private System.Timers.Timer times;
28
-        public PrintWindowTStudy()
29
-        {
30
-            InitializeComponent();
31
-            double proportion = 1036.0 / 1290.0;
32
-            double Widths = (PrimaryScreen.ScaleWorkingAreaSize.Height) / proportion - (BorderThickness.Left + BorderThickness.Right);
33
-            double Heights = PrimaryScreen.ScaleWorkingAreaSize.Height - (BorderThickness.Top + BorderThickness.Bottom);
34
-            Width = Widths / 1.42;
35
-            Height = Heights / 1.71;
36
-            GridContent.Width = Width + 5;
37
-            GridContent.Height = Height;
38
-            ResizeMode = ResizeMode.NoResize;
39
-            string defa = string.Empty;
40
-            List<string> defaList = LatticeFileHelper.GetPrinterList(out defa);
41
-            if (defaList.Count > 0)
42
-            {
43
-                data.Columns.Add("Value");
44
-                data.Columns.Add("Key");
45
-                for (int i = 0; i < defaList.Count; i++)
46
-                {
47
-                    //创建一行
48
-                    DataRow row = data.NewRow();
49
-                    //将此行添加到table中
50
-                    data.Rows.Add(row);
51
-                    data.Rows[i]["Value"] = defaList[i];
52
-                    data.Rows[i]["Key"] = i.ToString();
53
-                }
54
-                dtComponentsUniqueNo = data.DefaultView.ToTable();
55
-                cmbClass.ItemsSource = dtComponentsUniqueNo.DefaultView;
56
-                cmbClass.SelectedIndex = 0;
57
-            }
58
-        }
59
-
60
-        private double wit = 0;
61
-        private double hei = 0;
62
-        public void Initialize(string _imgPath, double _wit, double _hei)
63
-        {
64
-            wit = _wit;
65
-            hei = _hei;
66
-            if (!string.IsNullOrWhiteSpace(_imgPath))
67
-            {
68
-                imgPri.Source = new BitmapImage(new Uri(_imgPath));
69
-            }
70
-            else
71
-            {
72
-                imgPri.Source = null;
73
-            }
74
-            I = 0;
75
-            tip_outer.Visibility = Visibility.Collapsed;
76
-        }
77
-
78
-        /// <summary>
79
-        /// 打印
80
-        /// </summary>
81
-        /// <param name="sender"></param>
82
-        /// <param name="e"></param>
83
-        private void BtnPrint_Click(object sender, RoutedEventArgs e)
84
-        {
85
-            if (string.IsNullOrWhiteSpace(cmbClass.Text))
86
-            {
87
-                //MessageWindow.Show("打印机不能为空!");
88
-                MessageWindow.Show("请设置打印机!");
89
-                return;
90
-            }
91
-            //APP.myloading.Show();
92
-            btnClose.IsEnabled = false;
93
-            btnPrint.IsEnabled = false;
94
-            //APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeServering, InvokeServerCompate);
95
-            Thread myThread = new Thread(StartPrint);
96
-            List<string> StrList = new List<string>();
97
-
98
-            //string imgPath = 
99
-            //FileToolsCommon.CreateFile(imgPath);
100
-            //string pdf = imgPath + "\\101.pdf";
101
-            //PDF位置
102
-            //string SourcePath = FileToolsCommon.GetFileAbsolutePath("/temp/101.pdf");
103
-            //StrList.Add(SourcePath);
104
-            int ipdf = 102;
105
-            string imgPath = FileToolsCommon.GetFileAbsolutePath("temp/");
106
-            string tempImgPath = imgPath;
107
-            imgPath += "101.pdf";
108
-            while (File.Exists(imgPath))
109
-            {
110
-                imgPath = tempImgPath + ipdf.ToString() + ".pdf";
111
-                ipdf++;
112
-            }
113
-            StrList.Add(imgPath);
114
-            //打印数量
115
-            int PrinterNum = Convert.ToInt32(txbNumberOfCopies.Text);
116
-            StrList.Add(PrinterNum.ToString());
117
-            //打印机名称
118
-            string PrinterName = cmbClass.Text;
119
-            StrList.Add(PrinterName);
120
-
121
-            num = 0;
122
-            tip_outer.Visibility = Visibility.Visible;
123
-            myThread.Start(StrList);
124
-            times = new System.Timers.Timer(100);
125
-            times.Elapsed += Times_ElapsedClick;
126
-            times.Start();
127
-        }
128
-
129
-        private int num = 0;
130
-        /// <summary>
131
-        /// 计时器
132
-        /// </summary>
133
-        /// <param name="sender"></param>
134
-        /// <param name="e"></param>
135
-        private void Times_ElapsedClick(object sender, System.Timers.ElapsedEventArgs e)
136
-        {
137
-            Dispatcher.Invoke(() =>
138
-            {
139
-                pgbProcess.Value = num;
140
-                lbProcess.Content = num.ToString() + "%";
141
-                if (num < 99)
142
-                {
143
-                    num++;
144
-                    times.Interval += (num / 2);
145
-                }
146
-                else
147
-                {
148
-                    times.Stop();
149
-                }
150
-            });
151
-        }
152
-
153
-        /// <summary>
154
-        /// 开始打印
155
-        /// </summary>
156
-        private void StartPrint(object obj)
157
-        {
158
-            try
159
-            {
160
-                iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 0, 0, 0, 0);
161
-                //iTextSharp.text.Rectangle page = new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.A4., 250f);//cs
162
-                ////设置纸张横向
163
-                //document.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
164
-
165
-                List<string> objStr1 = (List<string>)obj;
166
-                string SourcePath1 = objStr1[0];
167
-                iTextSharp.text.pdf.PdfWriter.GetInstance(document, new FileStream(SourcePath1, FileMode.Create, FileAccess.ReadWrite));
168
-                document.Open();
169
-                iTextSharp.text.Image image;
170
-                for (int i = 0; i < APP.PageDrawList.Count; i++)
171
-                {
172
-                    long ii = Timestamp();
173
-                    string directoryPath = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
174
-                    string filePathOutPut = Path.Combine(directoryPath, string.Format("print{0}{1}.jpg", ii, i));
175
-                    RectangleF rectangleFs = new RectangleF();
176
-                    MergerImg("", filePathOutPut, rectangleFs, out string errmsg);
177
-                    image = iTextSharp.text.Image.GetInstance(filePathOutPut);
178
-                    if (string.IsNullOrEmpty(APP.PageDrawList[i].PageImagePath))//没有图片
179
-                    {
180
-
181
-                    }
182
-                    else if (APP.PageDrawList[i].ImgDocumentation == true && !APP.PageDrawList[i].Type.Equals("ppt"))
183
-                    {
184
-                        image = iTextSharp.text.Image.GetInstance(APP.PageDrawList[i].PageImagePath);
185
-                    }
186
-                    else
187
-                    {
188
-                        RectangleF rectangleF = new RectangleF(0, 0, 0, 0);
189
-                        Dispatcher.Invoke(() =>
190
-                        {
191
-                            rectangleF = new RectangleF
192
-                            {
193
-                                Width = (float)APP.PageDrawList[i].ImageSizes.CenterX,
194
-                                Height = (float)APP.PageDrawList[i].ImageSizes.CenterY,
195
-                                X = (float)APP.PageDrawList[i].ImageLocation.X,
196
-                                Y = (float)APP.PageDrawList[i].ImageLocation.Y
197
-                            };
198
-                        });
199
-
200
-
201
-
202
-                        string msgs = string.Empty;
203
-
204
-
205
-                        bool isImg = MergerImg(APP.PageDrawList[i].PageImagePath, filePathOutPut, rectangleF, out msgs);
206
-                        if (isImg)
207
-                        {
208
-                            image = iTextSharp.text.Image.GetInstance(filePathOutPut);
209
-                        }
210
-                        else
211
-                        {
212
-                            image = iTextSharp.text.Image.GetInstance(APP.PageDrawList[i].PageImagePath);
213
-                        }
214
-
215
-
216
-                    }
217
-                    if (image.Height > iTextSharp.text.PageSize.A4.Height)
218
-                    {
219
-                        image.ScaleToFit(iTextSharp.text.PageSize.A4.Width, iTextSharp.text.PageSize.A4.Height);
220
-                    }
221
-                    else if (image.Width > iTextSharp.text.PageSize.A4.Width)
222
-                    {
223
-                        image.ScaleToFit(iTextSharp.text.PageSize.A4.Width, iTextSharp.text.PageSize.A4.Height);
224
-                    }
225
-                    image.Alignment = iTextSharp.text.Image.ALIGN_MIDDLE;
226
-                    document.NewPage();
227
-                    document.Add(image);
228
-                    //iTextSharp.text.Chunk c1 = new iTextSharp.text.Chunk("Hello World");
229
-                    //iTextSharp.text.Phrase p1 = new iTextSharp.text.Phrase();
230
-                    //p1.Leading = 150;      //行间距
231
-                    //document.Add(p1);
232
-                }
233
-                Console.WriteLine("转换成功!");
234
-                document.Close();
235
-            }
236
-            catch (Exception ex)
237
-            {
238
-                Dispatcher.Invoke(() =>
239
-                {
240
-                    btnClose.IsEnabled = true;
241
-                    btnPrint.IsEnabled = true;
242
-                    times.Stop();
243
-                    tip_outer.Visibility = Visibility.Collapsed;
244
-                    MessageWindow.Show(ex.Message);
245
-                    return;
246
-                });
247
-                LogHelper.WriteErrLog("打印转换PDF失败,原因:" + ex.Message, ex);
248
-            }
249
-
250
-
251
-
252
-            List<string> objStr = (List<string>)obj;
253
-            string SourcePath = objStr[0];
254
-            int PrinterNum = int.Parse(objStr[1]);
255
-            string PrinterName = objStr[2];
256
-            //TPF文件位置
257
-            string TPFPath = FileToolsCommon.GetFileAbsolutePath("temp/");
258
-            FileToolsCommon.CreateDirectory(TPFPath);
259
-            TPFPath += "101.TPF";
260
-
261
-            #region 腾千里服务打印
262
-            //if (APP.dAL_TmatrixCode == null)
263
-            //{
264
-            //    APP.dAL_TmatrixCode = new DAL.DAL_TmatrixCode();
265
-            //}
266
-            //string ErrMessage;
267
-            //if(APP.dAL_TmatrixCode.TQLUserLogin(out ErrMessage))
268
-            //{
269
-            //    if(APP.dAL_TmatrixCode.TQLStartTmatrix(TPFPath, "101.TPF", out ErrMessage))
270
-            //    {
271
-            //        while(true)
272
-            //        {
273
-            //            //-1失败 0:未铺码 1:正在铺码 2:铺码完成,3:未查到。
274
-            //            int TmatrixType = APP.dAL_TmatrixCode.TQLSchedulequery(out ErrMessage);
275
-            //            if(TmatrixType==0)
276
-            //            {
277
-            //                //未铺码
278
-            //                Thread.Sleep(3000);
279
-            //            }
280
-            //            else if(TmatrixType==1)
281
-            //            {
282
-            //                //正在铺码
283
-            //                Thread.Sleep(1000);
284
-            //            }
285
-            //            else if (TmatrixType == 2)
286
-            //            {
287
-            //                //铺码完成
288
-            //                Dispatcher.Invoke(() =>
289
-            //                {
290
-            //                    btnClose.IsEnabled = true;
291
-            //                    btnPrint.IsEnabled = true;
292
-            //                    num = 99;
293
-            //                    times.Stop();
294
-            //                    pgbProcess.Value = 100;
295
-            //                    lbProcess.Content = "100%";
296
-            //                    MessageWindow.Show("打印成功!");
297
-            //                    tip_outer.Visibility = Visibility.Collapsed;
298
-            //                });
299
-
300
-            //            }
301
-            //            else if (TmatrixType == 3)
302
-            //            {
303
-            //                //未查到
304
-            //                Dispatcher.Invoke(() =>
305
-            //                {
306
-            //                    btnClose.IsEnabled = true;
307
-            //                    btnPrint.IsEnabled = true;
308
-            //                    times.Stop();
309
-            //                    tip_outer.Visibility = Visibility.Collapsed;
310
-            //                    MessageWindow.Show("文件铺码失败," + ErrMessage);
311
-            //                });
312
-            //                break;
313
-            //            }
314
-            //            else //if (TmatrixType == -1)
315
-            //            {
316
-            //                Dispatcher.Invoke(() =>
317
-            //                {
318
-            //                    btnClose.IsEnabled = true;
319
-            //                    btnPrint.IsEnabled = true;
320
-            //                    times.Stop();
321
-            //                    tip_outer.Visibility = Visibility.Collapsed;
322
-            //                    MessageWindow.Show("文件铺码失败," + ErrMessage);
323
-            //                });
324
-            //                break;
325
-            //            }
326
-            //        }
327
-            //    }
328
-            //    else
329
-            //    {
330
-            //        Dispatcher.Invoke(() =>
331
-            //        {
332
-            //            btnClose.IsEnabled = true;
333
-            //            btnPrint.IsEnabled = true;
334
-            //            times.Stop();
335
-            //            tip_outer.Visibility = Visibility.Collapsed;
336
-            //            MessageWindow.Show("文件铺码失败,"+ErrMessage);
337
-            //        });
338
-            //    }
339
-            //}
340
-            //else
341
-            //{
342
-            //    Dispatcher.Invoke(() =>
343
-            //    {
344
-            //        btnClose.IsEnabled = true;
345
-            //        btnPrint.IsEnabled = true;
346
-            //        times.Stop();
347
-            //        tip_outer.Visibility = Visibility.Collapsed;
348
-            //        MessageWindow.Show("登录铺码服务器失败,"+ErrMessage);
349
-            //    });
350
-            //}
351
-            #endregion
352
-
353
-            #region 拓思德生成点阵文件
354
-            //生成点阵文件
355
-            LatticeFileHelper.GeneratingPDF(SourcePath, TPFPath, out int pr, out string msg, out string outPut/*, pyte*/);
356
-            while (!FileToolsCommon.IsExistFile(TPFPath))
357
-            {
358
-                Thread.Sleep(100);
359
-            }
360
-            while (string.IsNullOrWhiteSpace(pr.ToString()))
361
-            {
362
-                Thread.Sleep(100);
363
-            }
364
-            Thread.Sleep(1000);
365
-            #endregion
366
-
367
-            #region 拓思德打印
368
-            //打印
369
-            LatticeFileHelper.PrinterTPFFile(TPFPath, PrinterNum, PrinterName, out int printResult, out string standardError, out string standardOutput);
370
-            if (printResult == 0)
371
-            {
372
-                Dispatcher.Invoke(() =>
373
-                {
374
-                    btnClose.IsEnabled = true;
375
-                    btnPrint.IsEnabled = true;
376
-                    num = 99;
377
-                    times.Stop();
378
-                    pgbProcess.Value = 100;
379
-                    lbProcess.Content = "100%";
380
-                    MessageWindow.Show("打印成功!");
381
-                    tip_outer.Visibility = Visibility.Collapsed;
382
-                });
383
-            }
384
-            else
385
-            {
386
-                Dispatcher.Invoke(() =>
387
-                {
388
-                    btnClose.IsEnabled = true;
389
-                    btnPrint.IsEnabled = true;
390
-                    times.Stop();
391
-                    tip_outer.Visibility = Visibility.Collapsed;
392
-                    MessageWindow.Show(standardError);
393
-                });
394
-            }
395
-            #endregion
396
-        }
397
-        /// <summary>
398
-        /// 返回一个时间戳到毫秒
399
-        /// </summary>
400
-        /// <returns></returns>
401
-        public static long Timestamp()
402
-        {
403
-            TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
404
-            long timestr = Convert.ToInt64(ts.TotalMilliseconds);
405
-            return timestr;
406
-        }
407
-        /// <summary>
408
-        /// 生成图片
409
-        /// </summary>
410
-        /// <param name="_path">图片地址</param>
411
-        /// <param name="_saveimg">保存位置</param>
412
-        /// <param name="_rectangle">图片位置</param>
413
-        /// <param name="errmsg">错误消息</param>
414
-        /// <returns></returns>
415
-        private bool MergerImg(string _path, string _saveimg, RectangleF _rectangle, out string errmsg)
416
-        {
417
-            errmsg = null;
418
-            try
419
-            {
420
-                Bitmap bitmap = null;
421
-
422
-                //创建要显示的图片对象,根据参数的个数设置宽度
423
-                Bitmap backgroudImg = new Bitmap((int)/*gridM.ActualWidth*/wit, (int)/*gridM.ActualHeight*/hei);
424
-                Graphics g = Graphics.FromImage(backgroudImg);
425
-                //清除画布,背景设置为白色
426
-                g.Clear(System.Drawing.Color.White);
427
-
428
-                if (!string.IsNullOrWhiteSpace(_path))
429
-                {
430
-                    bitmap = ImageHelper.ReadBitmapFile(_path);
431
-                    g.DrawImage(bitmap, _rectangle);
432
-                }
433
-                #region 添加箭头
434
-                string Str = "↑";
435
-                SolidBrush mybrush = new SolidBrush(Color.Black);  //设置默认画刷颜色
436
-                Font myfont = new Font("黑体", 14);         //设置默认字体格式
437
-                g.DrawString(Str, myfont, mybrush, new Rectangle((int)wit - 50, 20, 50, 50));
438
-
439
-                #endregion
440
-                backgroudImg.Save(_saveimg);
441
-
442
-                g.Dispose();
443
-                backgroudImg.Dispose();
444
-                if (bitmap != null)
445
-                {
446
-                    bitmap.Dispose();
447
-                }
448
-
449
-                GC.Collect();
450
-                return true;
451
-            }
452
-            catch (Exception ex)
453
-            {
454
-                errmsg = ex.Message;
455
-                LogHelper.WriteErrLog("【截图合成】(MergerImg)图片合成失败:" + ex.Message, ex);
456
-                return false;
457
-            }
458
-
459
-        }
460
-        /// <summary>
461
-        /// 打印-开始
462
-        /// </summary>
463
-        /// <returns></returns>
464
-        private object InvokeServering()
465
-        {
466
-            Dispatcher.Invoke(() =>
467
-             {
468
-                 I = 1;
469
-                 pgbProcess.Value = I * 100 / 100;
470
-                 lbProcess.Content = I.ToString() + "%";
471
-                 tip_outer.Visibility = Visibility.Visible;
472
-                 //I = 0;
473
-             });
474
-            Thread.Sleep(2000);
475
-
476
-            string imgPath = FileToolsCommon.GetFileAbsolutePath("temp");
477
-            FileToolsCommon.CreateFile(imgPath);
478
-            string pdf = imgPath + "\\101.pdf";
479
-            string tpf = imgPath + "\\102.TPF";
480
-            string msg = string.Empty;
481
-            string outPut = string.Empty;
482
-            //if(rbnSquarePoint.IsChecked==false)
483
-            //{
484
-            //    pyte = 1;
485
-            //}
486
-            LatticeFileHelper.GeneratingPDF(pdf, tpf, out int pr, out msg, out outPut/*, pyte*/);
487
-            if (pr == 0)
488
-            {
489
-                //outPut = outPut.Replace("[", "").Replace("]", "").Replace("\"", "").Trim();
490
-                //APP.OutPut = outPut.Split(',');
491
-                //string []page= outPut.Split(',');
492
-                //for(int i=0;i<page.Length;i++) //增加页码编号
493
-                //{
494
-                //    APP.PageDrawList[i].PageCode = page[i];
495
-                //}
496
-
497
-                //string defa = string.Empty;
498
-                //List<string> defaList = LatticeFileHelper.GetPrinterList(out defa);
499
-
500
-                string standardError = string.Empty;
501
-                string standardOutput = string.Empty;
502
-                int frequency = 1;
503
-                //Dispatcher.Invoke(() =>
504
-                //{
505
-                frequency = Convert.ToInt32(txbNumberOfCopies.Text);
506
-                LatticeFileHelper.PrinterTPFFile(tpf, frequency, cmbClass.Text, out int printResult, out standardError, out standardOutput);
507
-                if (printResult == 0)// 0为成功
508
-                {
509
-                    new Thread(new ThreadStart(new Action(() =>
510
-                    {
511
-                        Dispatcher.Invoke(() =>
512
-                        {
513
-                            I = 100;
514
-                            pgbProcess.Value = I * 100 / 100;
515
-                            lbProcess.Content = I.ToString() + "%";
516
-                            APP.myloading.Hide();
517
-                            I = 0;
518
-                        });
519
-                        Thread.Sleep(3000);
520
-                        Dispatcher.Invoke(() =>
521
-                        {
522
-                            tip_outer.Visibility = Visibility.Collapsed;
523
-                            //tip_outer.Visibility = Visibility.Collapsed;
524
-                            MessageWindow.Show("打印成功");
525
-                        });
526
-                    }))).Start();
527
-                }
528
-                else
529
-                {
530
-                    Dispatcher.Invoke(() =>
531
-                    {
532
-                        APP.myloading.Hide();
533
-                        MessageWindow.Show(standardError);
534
-                    });
535
-                }
536
-                //});
537
-
538
-            }
539
-            else
540
-            {
541
-                APP.myloading.Hide();
542
-                MessageWindow.Show(msg);
543
-            }
544
-            return "";
545
-        }
546
-        /// <summary>
547
-        /// 打印-结束
548
-        /// </summary>
549
-        /// <returns></returns>
550
-        public void InvokeServerCompate(object obj)
551
-        {
552
-            try
553
-            {
554
-                GC.Collect();
555
-                APP.myloading.Hide();
556
-            }
557
-            catch (Exception)
558
-            {
559
-            }
560
-        }
561
-
562
-        private int I = 0;
563
-        private void Times_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
564
-        {
565
-            Dispatcher.Invoke(() =>
566
-            {
567
-                if (I <= 90)
568
-                {
569
-                    try
570
-                    {
571
-                        pgbProcess.Value = I * 100 / 100;
572
-                        lbProcess.Content = I.ToString() + "%";
573
-                        I++;
574
-                    }
575
-                    catch (Exception ex)
576
-                    {
577
-                        LogHelper.WriteErrLog("【摄像】(Times_Elapsed)生成图片错误:" + ex.Message, ex);
578
-                    }
579
-                }
580
-            });
581
-        }
582
-        /// <summary>
583
-        /// 窗口移动
584
-        /// </summary>
585
-        /// <param name="sender"></param>
586
-        /// <param name="e"></param>
587
-        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
588
-        {
589
-            DragMove();
590
-        }
591
-        /// <summary>
592
-        /// 关闭
593
-        /// </summary>
594
-        /// <param name="sender"></param>
595
-        /// <param name="e"></param>
596
-        private void BtnClose_Click(object sender, RoutedEventArgs e)
597
-        {
598
-            Hide();
599
-        }
600
-        /// <summary>
601
-        /// 减
602
-        /// </summary>
603
-        /// <param name="sender"></param>
604
-        /// <param name="e"></param>
605
-        private void BtnLess_Click(object sender, RoutedEventArgs e)
606
-        {
607
-            int num = Convert.ToInt32(txbNumberOfCopies.Text);
608
-            if (num > 1)
609
-            {
610
-                num = num - 1;
611
-                txbNumberOfCopies.Text = num.ToString();
612
-            }
613
-        }
614
-        /// <summary>
615
-        /// 新增
616
-        /// </summary>
617
-        /// <param name="sender"></param>
618
-        /// <param name="e"></param>
619
-        private void BtnAdd_Click(object sender, RoutedEventArgs e)
620
-        {
621
-            int num = Convert.ToInt32(txbNumberOfCopies.Text);
622
-            if (num > 0)
623
-            {
624
-                num = num + 1;
625
-                txbNumberOfCopies.Text = num.ToString();
626
-            }
627
-        }
628
-
629
-    }
630
-}

+ 12
- 0
XHWK.WKTool/Resources/OverwrideDefaultControlStyles.xaml View File

1
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2
+
3
+    <ResourceDictionary.MergedDictionaries>
4
+        <ResourceDictionary Source="pack://application:,,,/Resources/StyleScrolllview.xaml" />
5
+        <ResourceDictionary Source="pack://application:,,,/Resources/StyleButton.xaml" />
6
+    </ResourceDictionary.MergedDictionaries>
7
+
8
+    <Style BasedOn="{StaticResource for_scrollbar}" TargetType="ScrollBar" />
9
+    <Style BasedOn="{StaticResource for_scrollviewer}" TargetType="ScrollViewer" />
10
+
11
+    <Style BasedOn="{StaticResource MyButton}" TargetType="Button" />
12
+</ResourceDictionary>

+ 25
- 0
XHWK.WKTool/Resources/StyleButton.xaml View File

1
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2
+    <Style x:Key="MyButton" TargetType="{x:Type Button}">
3
+        <Setter Property="OverridesDefaultStyle" Value="True" />
4
+        <Setter Property="Cursor" Value="Hand" />
5
+        <Setter Property="Template">
6
+            <Setter.Value>
7
+                <ControlTemplate TargetType="Button">
8
+                    <Border
9
+                        Name="border"
10
+                        Padding="{TemplateBinding Padding}"
11
+                        Background="{TemplateBinding Background}"
12
+                        BorderThickness="0"
13
+                        CornerRadius="6">
14
+                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
15
+                    </Border>
16
+                    <ControlTemplate.Triggers>
17
+                        <Trigger Property="IsMouseOver" Value="True">
18
+                            <Setter Property="Opacity" Value="0.6" />
19
+                        </Trigger>
20
+                    </ControlTemplate.Triggers>
21
+                </ControlTemplate>
22
+            </Setter.Value>
23
+        </Setter>
24
+    </Style>
25
+</ResourceDictionary>

+ 259
- 0
XHWK.WKTool/Resources/StyleScrolllview.xaml View File

1
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2
+    <!--  ScrollViewer 滚动条  -->
3
+    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
4
+        <Setter Property="OverridesDefaultStyle" Value="true" />
5
+        <Setter Property="IsTabStop" Value="false" />
6
+        <Setter Property="Template">
7
+            <Setter.Value>
8
+                <ControlTemplate TargetType="{x:Type Thumb}">
9
+                    <Grid>
10
+                        <!--  滚动条颜色  -->
11
+                        <Border Background="#646465" CornerRadius="3" />
12
+                    </Grid>
13
+                </ControlTemplate>
14
+            </Setter.Value>
15
+        </Setter>
16
+    </Style>
17
+    <Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
18
+        <Setter Property="OverridesDefaultStyle" Value="true" />
19
+        <Setter Property="Background" Value="Transparent" />
20
+        <Setter Property="Focusable" Value="false" />
21
+        <Setter Property="IsTabStop" Value="false" />
22
+        <Setter Property="Opacity" Value="0.2" />
23
+        <Setter Property="Template">
24
+            <Setter.Value>
25
+                <ControlTemplate TargetType="{x:Type RepeatButton}">
26
+                    <Rectangle
27
+                        Width="{TemplateBinding Width}"
28
+                        Height="{TemplateBinding Height}"
29
+                        Fill="{TemplateBinding Background}" />
30
+                </ControlTemplate>
31
+            </Setter.Value>
32
+        </Setter>
33
+    </Style>
34
+    <Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
35
+        <Setter Property="OverridesDefaultStyle" Value="true" />
36
+        <Setter Property="Background" Value="Transparent" />
37
+        <Setter Property="Focusable" Value="false" />
38
+        <Setter Property="IsTabStop" Value="false" />
39
+        <Setter Property="Opacity" Value="0.2" />
40
+        <Setter Property="Template">
41
+            <Setter.Value>
42
+                <ControlTemplate TargetType="{x:Type RepeatButton}">
43
+                    <Rectangle
44
+                        Width="{TemplateBinding Width}"
45
+                        Height="{TemplateBinding Height}"
46
+                        Fill="{TemplateBinding Background}" />
47
+                </ControlTemplate>
48
+            </Setter.Value>
49
+        </Setter>
50
+    </Style>
51
+
52
+    <!--  滚动条上下按钮  -->
53
+    <Style x:Key="VerticalScrollBarPageButton2" TargetType="{x:Type RepeatButton}">
54
+        <Setter Property="OverridesDefaultStyle" Value="true" />
55
+        <Setter Property="Background" Value="Transparent" />
56
+        <Setter Property="Focusable" Value="false" />
57
+        <Setter Property="IsTabStop" Value="false" />
58
+        <Setter Property="Opacity" Value="0" />
59
+        <Setter Property="Template">
60
+            <Setter.Value>
61
+                <ControlTemplate TargetType="{x:Type RepeatButton}">
62
+                    <Rectangle
63
+                        Width="0"
64
+                        Height="0"
65
+                        Fill="#90000000" />
66
+                </ControlTemplate>
67
+            </Setter.Value>
68
+        </Setter>
69
+    </Style>
70
+    <Style x:Key="for_scrollbar" TargetType="{x:Type ScrollBar}">
71
+        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
72
+        <Setter Property="Stylus.IsFlicksEnabled" Value="false" />
73
+        <Setter Property="Background" Value="Transparent" />
74
+        <Setter Property="Margin" Value="0,1,1,6" />
75
+        <Setter Property="Width" Value="10" />
76
+        <Setter Property="MinWidth" Value="5" />
77
+        <Setter Property="Opacity" Value="0.2" />
78
+        <Setter Property="Template">
79
+            <Setter.Value>
80
+                <ControlTemplate TargetType="{x:Type ScrollBar}">
81
+                    <Grid x:Name="Bg" SnapsToDevicePixels="true">
82
+                        <Grid.RowDefinitions>
83
+                            <RowDefinition Height="auto" />
84
+                            <RowDefinition Height="*" />
85
+                            <RowDefinition Height="auto" />
86
+                        </Grid.RowDefinitions>
87
+                        <RepeatButton
88
+                            Grid.Row="0"
89
+                            Command="{x:Static ScrollBar.PageUpCommand}"
90
+                            Style="{StaticResource VerticalScrollBarPageButton2}" />
91
+                        <Track
92
+                            x:Name="PART_Track"
93
+                            Grid.Row="1"
94
+                            IsDirectionReversed="true"
95
+                            IsEnabled="{TemplateBinding IsMouseOver}">
96
+                            <Track.DecreaseRepeatButton>
97
+                                <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}" />
98
+                            </Track.DecreaseRepeatButton>
99
+                            <Track.IncreaseRepeatButton>
100
+                                <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}" />
101
+                            </Track.IncreaseRepeatButton>
102
+                            <Track.Thumb>
103
+                                <Thumb Style="{StaticResource ScrollBarThumb}" />
104
+                            </Track.Thumb>
105
+                        </Track>
106
+                        <RepeatButton
107
+                            Grid.Row="2"
108
+                            Command="{x:Static ScrollBar.PageDownCommand}"
109
+                            Style="{StaticResource VerticalScrollBarPageButton2}" />
110
+                    </Grid>
111
+                </ControlTemplate>
112
+            </Setter.Value>
113
+        </Setter>
114
+        <Style.Triggers>
115
+            <Trigger Property="Orientation" Value="Horizontal">
116
+                <Setter Property="Background" Value="Transparent" />
117
+                <Setter Property="Margin" Value="1,0,6,1" />
118
+                <Setter Property="Height" Value="5" />
119
+                <Setter Property="MinHeight" Value="5" />
120
+                <Setter Property="Width" Value="Auto" />
121
+                <Setter Property="Opacity" Value="0.2" />
122
+                <Setter Property="Template">
123
+                    <Setter.Value>
124
+                        <ControlTemplate TargetType="{x:Type ScrollBar}">
125
+                            <Grid x:Name="Bg" SnapsToDevicePixels="true">
126
+                                <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}">
127
+                                    <Track.DecreaseRepeatButton>
128
+                                        <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}" />
129
+                                    </Track.DecreaseRepeatButton>
130
+                                    <Track.IncreaseRepeatButton>
131
+                                        <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}" />
132
+                                    </Track.IncreaseRepeatButton>
133
+                                    <Track.Thumb>
134
+                                        <Thumb Style="{StaticResource ScrollBarThumb}" />
135
+                                    </Track.Thumb>
136
+                                </Track>
137
+                            </Grid>
138
+                        </ControlTemplate>
139
+                    </Setter.Value>
140
+                </Setter>
141
+            </Trigger>
142
+        </Style.Triggers>
143
+    </Style>
144
+    <Style x:Key="for_scrollviewer" TargetType="{x:Type ScrollViewer}">
145
+        <Setter Property="BorderBrush" Value="LightGray" />
146
+        <Setter Property="BorderThickness" Value="0" />
147
+        <Setter Property="Template">
148
+            <Setter.Value>
149
+                <ControlTemplate TargetType="{x:Type ScrollViewer}">
150
+                    <Border
151
+                        BorderBrush="{TemplateBinding BorderBrush}"
152
+                        BorderThickness="{TemplateBinding BorderThickness}"
153
+                        SnapsToDevicePixels="True">
154
+                        <Grid Background="{TemplateBinding Background}">
155
+                            <ScrollContentPresenter
156
+                                MinHeight="{TemplateBinding Height}"
157
+                                Margin="{TemplateBinding Padding}"
158
+                                VerticalAlignment="Center"
159
+                                ContentTemplate="{TemplateBinding ContentTemplate}"
160
+                                Cursor="{TemplateBinding Cursor}" />
161
+                            <ScrollBar
162
+                                x:Name="PART_VerticalScrollBar"
163
+                                HorizontalAlignment="Right"
164
+                                Maximum="{TemplateBinding ScrollableHeight}"
165
+                                Orientation="Vertical"
166
+                                Style="{StaticResource for_scrollbar}"
167
+                                ViewportSize="{TemplateBinding ViewportHeight}"
168
+                                Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
169
+                                Value="{TemplateBinding VerticalOffset}" />
170
+                            <ScrollBar
171
+                                x:Name="PART_HorizontalScrollBar"
172
+                                VerticalAlignment="Bottom"
173
+                                Maximum="{TemplateBinding ScrollableWidth}"
174
+                                Orientation="Horizontal"
175
+                                Style="{StaticResource for_scrollbar}"
176
+                                ViewportSize="{TemplateBinding ViewportWidth}"
177
+                                Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
178
+                                Value="{TemplateBinding HorizontalOffset}" />
179
+                        </Grid>
180
+                    </Border>
181
+                    <ControlTemplate.Triggers>
182
+                        <EventTrigger RoutedEvent="ScrollChanged">
183
+                            <BeginStoryboard>
184
+                                <Storyboard>
185
+                                    <DoubleAnimation
186
+                                        Storyboard.TargetName="PART_VerticalScrollBar"
187
+                                        Storyboard.TargetProperty="Opacity"
188
+                                        To="0.8"
189
+                                        Duration="0:0:1" />
190
+                                    <DoubleAnimation
191
+                                        BeginTime="0:0:1"
192
+                                        Storyboard.TargetName="PART_VerticalScrollBar"
193
+                                        Storyboard.TargetProperty="Opacity"
194
+                                        To="0.2"
195
+                                        Duration="0:0:1" />
196
+                                    <DoubleAnimation
197
+                                        Storyboard.TargetName="PART_HorizontalScrollBar"
198
+                                        Storyboard.TargetProperty="Opacity"
199
+                                        To="0.8"
200
+                                        Duration="0:0:1" />
201
+                                    <DoubleAnimation
202
+                                        BeginTime="0:0:1"
203
+                                        Storyboard.TargetName="PART_HorizontalScrollBar"
204
+                                        Storyboard.TargetProperty="Opacity"
205
+                                        To="0.2"
206
+                                        Duration="0:0:1" />
207
+                                </Storyboard>
208
+                            </BeginStoryboard>
209
+                        </EventTrigger>
210
+                        <EventTrigger RoutedEvent="MouseEnter" SourceName="PART_VerticalScrollBar">
211
+                            <BeginStoryboard>
212
+                                <Storyboard>
213
+                                    <DoubleAnimation
214
+                                        Storyboard.TargetName="PART_VerticalScrollBar"
215
+                                        Storyboard.TargetProperty="Opacity"
216
+                                        To="0.8"
217
+                                        Duration="0:0:0.7" />
218
+                                </Storyboard>
219
+                            </BeginStoryboard>
220
+                        </EventTrigger>
221
+                        <EventTrigger RoutedEvent="MouseLeave" SourceName="PART_VerticalScrollBar">
222
+                            <BeginStoryboard>
223
+                                <Storyboard>
224
+                                    <DoubleAnimation
225
+                                        Storyboard.TargetName="PART_VerticalScrollBar"
226
+                                        Storyboard.TargetProperty="Opacity"
227
+                                        To="0.2"
228
+                                        Duration="0:0:0.7" />
229
+                                </Storyboard>
230
+                            </BeginStoryboard>
231
+                        </EventTrigger>
232
+                        <EventTrigger RoutedEvent="MouseEnter" SourceName="PART_HorizontalScrollBar">
233
+                            <BeginStoryboard>
234
+                                <Storyboard>
235
+                                    <DoubleAnimation
236
+                                        Storyboard.TargetName="PART_HorizontalScrollBar"
237
+                                        Storyboard.TargetProperty="Opacity"
238
+                                        To="0.8"
239
+                                        Duration="0:0:0.7" />
240
+                                </Storyboard>
241
+                            </BeginStoryboard>
242
+                        </EventTrigger>
243
+                        <EventTrigger RoutedEvent="MouseLeave" SourceName="PART_HorizontalScrollBar">
244
+                            <BeginStoryboard>
245
+                                <Storyboard>
246
+                                    <DoubleAnimation
247
+                                        Storyboard.TargetName="PART_HorizontalScrollBar"
248
+                                        Storyboard.TargetProperty="Opacity"
249
+                                        To="0.2"
250
+                                        Duration="0:0:0.7" />
251
+                                </Storyboard>
252
+                            </BeginStoryboard>
253
+                        </EventTrigger>
254
+                    </ControlTemplate.Triggers>
255
+                </ControlTemplate>
256
+            </Setter.Value>
257
+        </Setter>
258
+    </Style>
259
+</ResourceDictionary>

+ 334
- 120
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml View File

1
-<Window x:Class="XHWK.WKTool.ScreenRecordingToolbarWindow"
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="ScreenRecordingToolbarWindow" Height="58" Width="423" AllowsTransparency="True" 
9
-        Topmost="True"
1
+<Window
2
+    x:Class="XHWK.WKTool.ScreenRecordingToolbarWindow"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7
+    Title="ScreenRecordingToolbarWindow"
8
+    Width="423"
9
+    Height="58"
10
+    Margin="0"
11
+    AllowsTransparency="True"
12
+    Left="0"
10
     ShowInTaskbar="False"
13
     ShowInTaskbar="False"
11
-    WindowStartupLocation="CenterOwner"
12
-    WindowStyle="None" Margin="0" Left="0" Top="0">
14
+    Top="0"
15
+    Topmost="True"
16
+    WindowStyle="None"
17
+    mc:Ignorable="d">
13
     <Window.Background>
18
     <Window.Background>
14
         <SolidColorBrush Opacity="0" Color="#292C2E" />
19
         <SolidColorBrush Opacity="0" Color="#292C2E" />
15
     </Window.Background>
20
     </Window.Background>
16
     <Grid>
21
     <Grid>
17
-        <Grid x:Name="GridSrToobar" Visibility="Visible" MouseLeftButtonDown="Grid_MouseLeftButtonDown"  MouseLeave="gridToobarTwo_MouseLeave">
22
+        <Grid
23
+            x:Name="GridSrToobar"
24
+            MouseLeave="gridToobarTwo_MouseLeave"
25
+            Visibility="Visible">
18
             <Grid.ColumnDefinitions>
26
             <Grid.ColumnDefinitions>
19
-                <ColumnDefinition Width="56*"/>
20
-                <ColumnDefinition Width="361*"/>
27
+                <ColumnDefinition Width="56*" />
28
+                <ColumnDefinition Width="361*" />
21
             </Grid.ColumnDefinitions>
29
             </Grid.ColumnDefinitions>
22
-            <Border Grid.ColumnSpan="2"  Background="White" BorderBrush="#FF638AFF"  BorderThickness="3" CornerRadius="29"/>
23
-            <!--开始暂停-->
30
+            <Border
31
+                Grid.ColumnSpan="2"
32
+                Background="White"
33
+                BorderBrush="#FF638AFF"
34
+                BorderThickness="3"
35
+                CornerRadius="29" />
36
+            <!--  开始暂停  -->
24
             <Grid Grid.Column="0">
37
             <Grid Grid.Column="0">
25
-                <Button Visibility="Visible" x:Name="BtnRecordingScreen" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" ToolTip="开始" Click="BtnRecordingScreen_Click">
38
+                <Button
39
+                    x:Name="BtnRecordingScreen"
40
+                    Click="BtnRecordingScreen_Click"
41
+                    Cursor="Hand"
42
+                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
43
+                    ToolTip="开始"
44
+                    Visibility="Visible">
26
                     <Button.Template>
45
                     <Button.Template>
27
                         <ControlTemplate TargetType="{x:Type Button}">
46
                         <ControlTemplate TargetType="{x:Type Button}">
28
-                            <Image x:Name="BtnImages"  Source="/SkinImages/SR/SR_Start.png" />
47
+                            <Image x:Name="BtnImages" Source="/SkinImages/SR/SR_Start.png" />
29
                             <ControlTemplate.Triggers>
48
                             <ControlTemplate.Triggers>
30
                                 <Trigger Property="IsMouseOver" Value="True">
49
                                 <Trigger Property="IsMouseOver" Value="True">
31
-                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Start_MI.png"/>
50
+                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Start_MI.png" />
32
                                 </Trigger>
51
                                 </Trigger>
33
                                 <Trigger Property="IsPressed" Value="True">
52
                                 <Trigger Property="IsPressed" Value="True">
34
-                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Start.png"/>
53
+                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Start.png" />
35
                                 </Trigger>
54
                                 </Trigger>
36
                                 <Trigger Property="IsEnabled" Value="False">
55
                                 <Trigger Property="IsEnabled" Value="False">
37
-                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Start.png"/>
56
+                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Start.png" />
38
                                 </Trigger>
57
                                 </Trigger>
39
                             </ControlTemplate.Triggers>
58
                             </ControlTemplate.Triggers>
40
                         </ControlTemplate>
59
                         </ControlTemplate>
41
                     </Button.Template>
60
                     </Button.Template>
42
                 </Button>
61
                 </Button>
43
-                <Button Visibility="Collapsed" x:Name="BtnRecordingScreenPause"  Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" ToolTip="暂停" Click="BtnRecordingScreen_Click">
62
+                <Button
63
+                    x:Name="BtnRecordingScreenPause"
64
+                    Click="BtnRecordingScreen_Click"
65
+                    Cursor="Hand"
66
+                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
67
+                    ToolTip="暂停"
68
+                    Visibility="Collapsed">
44
                     <Button.Template>
69
                     <Button.Template>
45
                         <ControlTemplate TargetType="{x:Type Button}">
70
                         <ControlTemplate TargetType="{x:Type Button}">
46
-                            <Image x:Name="BtnImages"  Source="/SkinImages/SR/SR_Pause.png" />
71
+                            <Image x:Name="BtnImages" Source="/SkinImages/SR/SR_Pause.png" />
47
                             <ControlTemplate.Triggers>
72
                             <ControlTemplate.Triggers>
48
                                 <Trigger Property="IsMouseOver" Value="True">
73
                                 <Trigger Property="IsMouseOver" Value="True">
49
-                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Pause_MI.png"/>
74
+                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Pause_MI.png" />
50
                                 </Trigger>
75
                                 </Trigger>
51
                                 <Trigger Property="IsPressed" Value="True">
76
                                 <Trigger Property="IsPressed" Value="True">
52
-                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Pause.png"/>
77
+                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Pause.png" />
53
                                 </Trigger>
78
                                 </Trigger>
54
                                 <Trigger Property="IsEnabled" Value="False">
79
                                 <Trigger Property="IsEnabled" Value="False">
55
-                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Pause.png"/>
80
+                                    <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Pause.png" />
56
                                 </Trigger>
81
                                 </Trigger>
57
                             </ControlTemplate.Triggers>
82
                             </ControlTemplate.Triggers>
58
                         </ControlTemplate>
83
                         </ControlTemplate>
59
                     </Button.Template>
84
                     </Button.Template>
60
                 </Button>
85
                 </Button>
61
             </Grid>
86
             </Grid>
62
-            <!--其他按钮-->
87
+            <!--  其他按钮  -->
63
             <Grid Grid.Column="1">
88
             <Grid Grid.Column="1">
64
                 <Grid.RowDefinitions>
89
                 <Grid.RowDefinitions>
65
-                    <RowDefinition Height="10*"/>
66
-                    <RowDefinition Height="38*"/>
67
-                    <RowDefinition Height="10*"/>
90
+                    <RowDefinition Height="10*" />
91
+                    <RowDefinition Height="38*" />
92
+                    <RowDefinition Height="10*" />
68
                 </Grid.RowDefinitions>
93
                 </Grid.RowDefinitions>
69
                 <Grid.ColumnDefinitions>
94
                 <Grid.ColumnDefinitions>
70
-                    <ColumnDefinition Width="10*"/>
71
-                    <ColumnDefinition Width="38*"/>
72
-                    <ColumnDefinition Width="28*"/>
73
-                    <ColumnDefinition Width="92*"/>
74
-                    <ColumnDefinition Width="28*"/>
75
-                    <ColumnDefinition Width="38*"/>
76
-                    <ColumnDefinition Width="4*"/>
77
-                    <ColumnDefinition Width="38*"/>
78
-                    <ColumnDefinition Width="28*"/>
79
-                    <ColumnDefinition Width="38*"/>
80
-                    <ColumnDefinition Width="17*"/>
95
+                    <ColumnDefinition Width="10*" />
96
+                    <ColumnDefinition Width="38*" />
97
+                    <ColumnDefinition Width="28*" />
98
+                    <ColumnDefinition Width="92*" />
99
+                    <ColumnDefinition Width="28*" />
100
+                    <ColumnDefinition Width="38*" />
101
+                    <ColumnDefinition Width="4*" />
102
+                    <ColumnDefinition Width="38*" />
103
+                    <ColumnDefinition Width="28*" />
104
+                    <ColumnDefinition Width="38*" />
105
+                    <ColumnDefinition Width="17*" />
81
                 </Grid.ColumnDefinitions>
106
                 </Grid.ColumnDefinitions>
82
                 <Grid Grid.Row="1" Grid.Column="1">
107
                 <Grid Grid.Row="1" Grid.Column="1">
83
-                    <!--停止-->
84
-                    <Button x:Name="BtnStopRecordingScreen" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"  Click="BtnStopRecordingScreen_Click" ToolTip="停止">
108
+                    <!--  停止  -->
109
+                    <Button
110
+                        x:Name="BtnStopRecordingScreen"
111
+                        Click="BtnStopRecordingScreen_Click"
112
+                        Cursor="Hand"
113
+                        Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
114
+                        ToolTip="停止">
85
                         <Button.Template>
115
                         <Button.Template>
86
                             <ControlTemplate TargetType="{x:Type Button}">
116
                             <ControlTemplate TargetType="{x:Type Button}">
87
-                                <Image x:Name="BtnImages"  Source="/SkinImages/SR/SR_Stop.png" />
117
+                                <Image x:Name="BtnImages" Source="/SkinImages/SR/SR_Stop.png" />
88
                                 <ControlTemplate.Triggers>
118
                                 <ControlTemplate.Triggers>
89
                                     <Trigger Property="IsMouseOver" Value="True">
119
                                     <Trigger Property="IsMouseOver" Value="True">
90
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Stop_MI.png"/>
120
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Stop_MI.png" />
91
                                     </Trigger>
121
                                     </Trigger>
92
                                     <Trigger Property="IsPressed" Value="True">
122
                                     <Trigger Property="IsPressed" Value="True">
93
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Stop.png"/>
123
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Stop.png" />
94
                                     </Trigger>
124
                                     </Trigger>
95
                                     <Trigger Property="IsEnabled" Value="False">
125
                                     <Trigger Property="IsEnabled" Value="False">
96
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Stop_N.png"/>
126
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Stop_N.png" />
97
                                     </Trigger>
127
                                     </Trigger>
98
                                 </ControlTemplate.Triggers>
128
                                 </ControlTemplate.Triggers>
99
                             </ControlTemplate>
129
                             </ControlTemplate>
102
                 </Grid>
132
                 </Grid>
103
                 <Grid Grid.Row="1" Grid.Column="2">
133
                 <Grid Grid.Row="1" Grid.Column="2">
104
                     <Grid.RowDefinitions>
134
                     <Grid.RowDefinitions>
105
-                        <RowDefinition Height="9*"/>
106
-                        <RowDefinition Height="20*"/>
107
-                        <RowDefinition Height="9*"/>
135
+                        <RowDefinition Height="9*" />
136
+                        <RowDefinition Height="20*" />
137
+                        <RowDefinition Height="9*" />
108
                     </Grid.RowDefinitions>
138
                     </Grid.RowDefinitions>
109
-                    <Label Grid.Row="1" Background="#FF638AFF" Width="2" Padding="5" Margin="0"/>
139
+                    <Label
140
+                        Grid.Row="1"
141
+                        Width="2"
142
+                        Margin="0"
143
+                        Padding="5"
144
+                        Background="#FF638AFF" />
110
                 </Grid>
145
                 </Grid>
111
-                <Grid Grid.Row="0" Grid.Column="3" Grid.RowSpan="3" >
112
-                    <Label x:Name="TxbTime" Content="00:00" FontSize="36" Foreground="#FF3F6FFF" Visibility="Visible" FontFamily="/星火微课;component/Resources/#Quartz" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Grid.Column="1"/>
146
+                <Grid
147
+                    Grid.Row="0"
148
+                    Grid.RowSpan="3"
149
+                    Grid.Column="3">
150
+                    <Label
151
+                        x:Name="TxbTime"
152
+                        Grid.Column="1"
153
+                        Padding="0"
154
+                        HorizontalContentAlignment="Center"
155
+                        VerticalContentAlignment="Center"
156
+                        Content="00:00"
157
+                        FontFamily="/星火微课;component/Resources/#Quartz"
158
+                        FontSize="36"
159
+                        Foreground="#FF3F6FFF"
160
+                        Visibility="Visible" />
113
                 </Grid>
161
                 </Grid>
114
                 <Grid Grid.Row="1" Grid.Column="4">
162
                 <Grid Grid.Row="1" Grid.Column="4">
115
                     <Grid.RowDefinitions>
163
                     <Grid.RowDefinitions>
116
-                        <RowDefinition Height="9*"/>
117
-                        <RowDefinition Height="20*"/>
118
-                        <RowDefinition Height="9*"/>
164
+                        <RowDefinition Height="9*" />
165
+                        <RowDefinition Height="20*" />
166
+                        <RowDefinition Height="9*" />
119
                     </Grid.RowDefinitions>
167
                     </Grid.RowDefinitions>
120
-                    <Label Grid.Row="1" Background="#FF638AFF" Width="2" Padding="5" Margin="0"/>
168
+                    <Label
169
+                        Grid.Row="1"
170
+                        Width="2"
171
+                        Margin="0"
172
+                        Padding="5"
173
+                        Background="#FF638AFF" />
121
                 </Grid>
174
                 </Grid>
122
                 <Grid Grid.Row="1" Grid.Column="5">
175
                 <Grid Grid.Row="1" Grid.Column="5">
123
-                    <!--蓝笔-->
124
-                    <Button x:Name="BtnPenBlue" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"  Click="BtnBrush_Click" ToolTip="批注">
176
+                    <!--  蓝笔  -->
177
+                    <Button
178
+                        x:Name="BtnPenBlue"
179
+                        Click="BtnBrush_Click"
180
+                        Cursor="Hand"
181
+                        Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
182
+                        ToolTip="批注">
125
                         <Button.Template>
183
                         <Button.Template>
126
                             <ControlTemplate TargetType="{x:Type Button}">
184
                             <ControlTemplate TargetType="{x:Type Button}">
127
-                                <Image x:Name="BtnImages"  Source="/SkinImages/SR/SR_PenBlue.png" />
185
+                                <Image x:Name="BtnImages" Source="/SkinImages/SR/SR_PenBlue.png" />
128
                                 <ControlTemplate.Triggers>
186
                                 <ControlTemplate.Triggers>
129
                                     <Trigger Property="IsMouseOver" Value="True">
187
                                     <Trigger Property="IsMouseOver" Value="True">
130
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenBlue_MI.png"/>
188
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenBlue_MI.png" />
131
                                     </Trigger>
189
                                     </Trigger>
132
                                     <Trigger Property="IsPressed" Value="True">
190
                                     <Trigger Property="IsPressed" Value="True">
133
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenBlue_CL.png"/>
191
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenBlue_CL.png" />
134
                                     </Trigger>
192
                                     </Trigger>
135
                                     <Trigger Property="IsEnabled" Value="False">
193
                                     <Trigger Property="IsEnabled" Value="False">
136
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenBlue_N.png"/>
194
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenBlue_N.png" />
137
                                     </Trigger>
195
                                     </Trigger>
138
                                 </ControlTemplate.Triggers>
196
                                 </ControlTemplate.Triggers>
139
                             </ControlTemplate>
197
                             </ControlTemplate>
140
                         </Button.Template>
198
                         </Button.Template>
141
                     </Button>
199
                     </Button>
142
-                    <!--选中-->
143
-                    <Button x:Name="BtnPenBlue_CL" Visibility="Collapsed" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"  Click="BtnBrush_Click" ToolTip="批注">
200
+                    <!--  选中  -->
201
+                    <Button
202
+                        x:Name="BtnPenBlue_CL"
203
+                        Click="BtnBrush_Click"
204
+                        Cursor="Hand"
205
+                        Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
206
+                        ToolTip="批注"
207
+                        Visibility="Collapsed">
144
                         <Button.Template>
208
                         <Button.Template>
145
                             <ControlTemplate TargetType="{x:Type Button}">
209
                             <ControlTemplate TargetType="{x:Type Button}">
146
-                                <Image x:Name="BtnImages"  Source="/SkinImages/SR/SR_PenBlue_CL.png" />
210
+                                <Image x:Name="BtnImages" Source="/SkinImages/SR/SR_PenBlue_CL.png" />
147
                             </ControlTemplate>
211
                             </ControlTemplate>
148
                         </Button.Template>
212
                         </Button.Template>
149
                     </Button>
213
                     </Button>
150
                 </Grid>
214
                 </Grid>
151
                 <Grid Grid.Row="1" Grid.Column="7">
215
                 <Grid Grid.Row="1" Grid.Column="7">
152
-                    <!--红笔-->
153
-                    <Button x:Name="BtnPenRed" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"  Click="BtnBlackPenTwo_Click" ToolTip="批注">
216
+                    <!--  红笔  -->
217
+                    <Button
218
+                        x:Name="BtnPenRed"
219
+                        Click="BtnBlackPenTwo_Click"
220
+                        Cursor="Hand"
221
+                        Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
222
+                        ToolTip="批注">
154
                         <Button.Template>
223
                         <Button.Template>
155
                             <ControlTemplate TargetType="{x:Type Button}">
224
                             <ControlTemplate TargetType="{x:Type Button}">
156
-                                <Image x:Name="BtnImages"  Source="/SkinImages/SR/SR_PenRed.png" />
225
+                                <Image x:Name="BtnImages" Source="/SkinImages/SR/SR_PenRed.png" />
157
                                 <ControlTemplate.Triggers>
226
                                 <ControlTemplate.Triggers>
158
                                     <Trigger Property="IsMouseOver" Value="True">
227
                                     <Trigger Property="IsMouseOver" Value="True">
159
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenRed_MI.png"/>
228
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenRed_MI.png" />
160
                                     </Trigger>
229
                                     </Trigger>
161
                                     <Trigger Property="IsPressed" Value="True">
230
                                     <Trigger Property="IsPressed" Value="True">
162
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenRed_CL.png"/>
231
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenRed_CL.png" />
163
                                     </Trigger>
232
                                     </Trigger>
164
                                     <Trigger Property="IsEnabled" Value="False">
233
                                     <Trigger Property="IsEnabled" Value="False">
165
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenRed_N.png"/>
234
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_PenRed_N.png" />
166
                                     </Trigger>
235
                                     </Trigger>
167
                                 </ControlTemplate.Triggers>
236
                                 </ControlTemplate.Triggers>
168
                             </ControlTemplate>
237
                             </ControlTemplate>
169
                         </Button.Template>
238
                         </Button.Template>
170
                     </Button>
239
                     </Button>
171
-                    <!--选中-->
172
-                    <Button x:Name="BtnPenRed_CL" Visibility="Collapsed" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"  Click="BtnBlackPenTwo_Click" ToolTip="批注">
240
+                    <!--  选中  -->
241
+                    <Button
242
+                        x:Name="BtnPenRed_CL"
243
+                        Click="BtnBlackPenTwo_Click"
244
+                        Cursor="Hand"
245
+                        Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
246
+                        ToolTip="批注"
247
+                        Visibility="Collapsed">
173
                         <Button.Template>
248
                         <Button.Template>
174
                             <ControlTemplate TargetType="{x:Type Button}">
249
                             <ControlTemplate TargetType="{x:Type Button}">
175
-                                <Image x:Name="BtnImages"  Source="/SkinImages/SR/SR_PenRed_CL.png" />
250
+                                <Image x:Name="BtnImages" Source="/SkinImages/SR/SR_PenRed_CL.png" />
176
                             </ControlTemplate>
251
                             </ControlTemplate>
177
                         </Button.Template>
252
                         </Button.Template>
178
                     </Button>
253
                     </Button>
179
                 </Grid>
254
                 </Grid>
180
                 <Grid Grid.Row="1" Grid.Column="8">
255
                 <Grid Grid.Row="1" Grid.Column="8">
181
                     <Grid.RowDefinitions>
256
                     <Grid.RowDefinitions>
182
-                        <RowDefinition Height="9*"/>
183
-                        <RowDefinition Height="20*"/>
184
-                        <RowDefinition Height="9*"/>
257
+                        <RowDefinition Height="9*" />
258
+                        <RowDefinition Height="20*" />
259
+                        <RowDefinition Height="9*" />
185
                     </Grid.RowDefinitions>
260
                     </Grid.RowDefinitions>
186
-                    <Label Grid.Row="1" Background="#FF638AFF" Width="2" Padding="5" Margin="0"/>
261
+                    <Label
262
+                        Grid.Row="1"
263
+                        Width="2"
264
+                        Margin="0"
265
+                        Padding="5"
266
+                        Background="#FF638AFF" />
187
                 </Grid>
267
                 </Grid>
188
                 <Grid Grid.Row="1" Grid.Column="9">
268
                 <Grid Grid.Row="1" Grid.Column="9">
189
-                    <!--返回-->
190
-                    <Button x:Name="BtnReturn" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"  Click="BtnReturn_Click" ToolTip="返回">
269
+                    <!--  返回  -->
270
+                    <Button
271
+                        x:Name="BtnReturn"
272
+                        Click="BtnReturn_Click"
273
+                        Cursor="Hand"
274
+                        Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
275
+                        ToolTip="返回">
191
                         <Button.Template>
276
                         <Button.Template>
192
                             <ControlTemplate TargetType="{x:Type Button}">
277
                             <ControlTemplate TargetType="{x:Type Button}">
193
-                                <Image x:Name="BtnImages"  Source="/SkinImages/SR/SR_Out.png" />
278
+                                <Image x:Name="BtnImages" Source="/SkinImages/SR/SR_Out.png" />
194
                                 <ControlTemplate.Triggers>
279
                                 <ControlTemplate.Triggers>
195
                                     <Trigger Property="IsMouseOver" Value="True">
280
                                     <Trigger Property="IsMouseOver" Value="True">
196
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Out_MI.png"/>
281
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Out_MI.png" />
197
                                     </Trigger>
282
                                     </Trigger>
198
                                     <Trigger Property="IsEnabled" Value="False">
283
                                     <Trigger Property="IsEnabled" Value="False">
199
-                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Out_N.png"/>
284
+                                        <Setter TargetName="BtnImages" Property="Source" Value="/SkinImages/SR/SR_Out_N.png" />
200
                                     </Trigger>
285
                                     </Trigger>
201
                                 </ControlTemplate.Triggers>
286
                                 </ControlTemplate.Triggers>
202
                             </ControlTemplate>
287
                             </ControlTemplate>
209
             <StackPanel>
294
             <StackPanel>
210
                 <Viewbox Visibility="Collapsed">
295
                 <Viewbox Visibility="Collapsed">
211
                     <Grid x:Name="gridToobar" MouseLeftButtonDown="Grid_MouseLeftButtonDown">
296
                     <Grid x:Name="gridToobar" MouseLeftButtonDown="Grid_MouseLeftButtonDown">
212
-                        <Image x:Name="imgCanvas" Visibility="Collapsed"/>
213
-                        <InkCanvas x:Name="blackboard_canvas" Background="Transparent" Visibility="Collapsed" Grid.RowSpan="2" />
214
-                        <!--画笔工具栏-->
297
+                        <Image x:Name="imgCanvas" Visibility="Collapsed" />
298
+                        <InkCanvas
299
+                            x:Name="blackboard_canvas"
300
+                            Grid.RowSpan="2"
301
+                            Background="Transparent"
302
+                            Visibility="Collapsed" />
303
+                        <!--  画笔工具栏  -->
215
                         <Grid x:Name="gridToolbar" Visibility="Collapsed">
304
                         <Grid x:Name="gridToolbar" Visibility="Collapsed">
216
-                            <Image Source="./Images/Toobar22.png" HorizontalAlignment="Right"/>
217
-                            <StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="0,5,10,0">
218
-                                <Button Cursor="Hand" x:Name="btnToolbarDown" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,5,0,0" Click="BtnToolbarDown_Click">
219
-                                    <Image Source="./Images/Toobar5.png"/>
305
+                            <Image HorizontalAlignment="Right" Source="./Images/Toobar22.png" />
306
+                            <StackPanel
307
+                                Margin="0,5,10,0"
308
+                                HorizontalAlignment="Right"
309
+                                Orientation="Vertical">
310
+                                <Button
311
+                                    x:Name="btnToolbarDown"
312
+                                    Margin="0,5,0,0"
313
+                                    Click="BtnToolbarDown_Click"
314
+                                    Cursor="Hand"
315
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
316
+                                    <Image Source="./Images/Toobar5.png" />
220
                                 </Button>
317
                                 </Button>
221
-                                <Button Cursor="Hand" x:Name="btnEraser" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,5,0,0" Click="BtnEraser_Click">
222
-                                    <Image Source="./Images/Toobar12.png"/>
318
+                                <Button
319
+                                    x:Name="btnEraser"
320
+                                    Margin="0,5,0,0"
321
+                                    Click="BtnEraser_Click"
322
+                                    Cursor="Hand"
323
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
324
+                                    <Image Source="./Images/Toobar12.png" />
223
                                 </Button>
325
                                 </Button>
224
-                                <Button Cursor="Hand" x:Name="btnPen" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,5,0,0" Click="BtnPen_Click">
225
-                                    <Image Source="./Images/Toobar9.png"/>
326
+                                <Button
327
+                                    x:Name="btnPen"
328
+                                    Margin="0,5,0,0"
329
+                                    Click="BtnPen_Click"
330
+                                    Cursor="Hand"
331
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
332
+                                    <Image Source="./Images/Toobar9.png" />
226
                                 </Button>
333
                                 </Button>
227
-                                <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,5,0,0">
228
-                                    <Image Source="./Images/Toobar16.png"/>
334
+                                <Button
335
+                                    Margin="0,5,0,0"
336
+                                    Cursor="Hand"
337
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
338
+                                    <Image Source="./Images/Toobar16.png" />
229
                                 </Button>
339
                                 </Button>
230
-                                <Button Cursor="Hand" x:Name="btnRectangle" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,5,0,0" Click="BtnRectangle_Click">
231
-                                    <Image Source="./Images/Toobar3.png"/>
340
+                                <Button
341
+                                    x:Name="btnRectangle"
342
+                                    Margin="0,5,0,0"
343
+                                    Click="BtnRectangle_Click"
344
+                                    Cursor="Hand"
345
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
346
+                                    <Image Source="./Images/Toobar3.png" />
232
                                 </Button>
347
                                 </Button>
233
-                                <Button Cursor="Hand" x:Name="btnRound" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,5,0,0" Click="BtnRound_Click">
234
-                                    <Image Source="./Images/Toobar23.png"/>
348
+                                <Button
349
+                                    x:Name="btnRound"
350
+                                    Margin="0,5,0,0"
351
+                                    Click="BtnRound_Click"
352
+                                    Cursor="Hand"
353
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
354
+                                    <Image Source="./Images/Toobar23.png" />
235
                                 </Button>
355
                                 </Button>
236
-                                <Button  Cursor="Hand" x:Name="btnThickness" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,5,0,0" Click="BtnThickness_Click">
237
-                                    <Image Source="./Images/Toobar1.png"/>
356
+                                <Button
357
+                                    x:Name="btnThickness"
358
+                                    Margin="0,5,0,0"
359
+                                    Click="BtnThickness_Click"
360
+                                    Cursor="Hand"
361
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
362
+                                    <Image Source="./Images/Toobar1.png" />
238
                                 </Button>
363
                                 </Button>
239
-                                <Button  Cursor="Hand" x:Name="btnColour" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,5,0,0" Click="BtnColour_Click">
240
-                                    <Image Source="./Images/Toobar18.png"/>
364
+                                <Button
365
+                                    x:Name="btnColour"
366
+                                    Margin="0,5,0,0"
367
+                                    Click="BtnColour_Click"
368
+                                    Cursor="Hand"
369
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
370
+                                    <Image Source="./Images/Toobar18.png" />
241
                                 </Button>
371
                                 </Button>
242
                             </StackPanel>
372
                             </StackPanel>
243
                         </Grid>
373
                         </Grid>
244
-                        <!--字体颜色-->
374
+                        <!--  字体颜色  -->
245
                         <Grid x:Name="gridColour" Visibility="Collapsed">
375
                         <Grid x:Name="gridColour" Visibility="Collapsed">
246
-                            <Image Source="./Images/Toobar20.png" HorizontalAlignment="Right" Margin="0,200,62,0"/>
247
-                            <StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="0,215,68,0">
248
-                                <Button  Cursor="Hand" x:Name="btnWhite" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#FFFFFF" Height="15" Width="15" Margin="0,0,0,0" Click="BtnWhite_Click"/>
249
-                                <Button  Cursor="Hand" x:Name="btnRed" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#FF0000" Height="15" Width="15" Margin="0,8,0,0" Click="BtnRed_Click"/>
250
-                                <Button  Cursor="Hand" x:Name="btnGray" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#A7A9AC" Height="15" Width="15" Margin="0,8,0,0" Click="BtnGray_Click"/>
251
-                                <Button  Cursor="Hand" x:Name="btnCyanBlue" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#63D600" Height="15" Width="15" Margin="0,8,0,0" Click="BtnCyanBlue_Click"/>
252
-                                <Button  Cursor="Hand" x:Name="btnYellow" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#FFBC00" Height="15" Width="15" Margin="0,8,0,0" Click="BtnYellow_Click"/>
253
-                                <Button  Cursor="Hand" x:Name="btnBlue" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#00B4FC" Height="15" Width="15" Margin="0,8,0,0" Click="BtnBlue_Click"/>
376
+                            <Image
377
+                                Margin="0,200,62,0"
378
+                                HorizontalAlignment="Right"
379
+                                Source="./Images/Toobar20.png" />
380
+                            <StackPanel
381
+                                Margin="0,215,68,0"
382
+                                HorizontalAlignment="Right"
383
+                                Orientation="Vertical">
384
+                                <Button
385
+                                    x:Name="btnWhite"
386
+                                    Width="15"
387
+                                    Height="15"
388
+                                    Margin="0,0,0,0"
389
+                                    Background="#FFFFFF"
390
+                                    Click="BtnWhite_Click"
391
+                                    Cursor="Hand"
392
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
393
+                                <Button
394
+                                    x:Name="btnRed"
395
+                                    Width="15"
396
+                                    Height="15"
397
+                                    Margin="0,8,0,0"
398
+                                    Background="#FF0000"
399
+                                    Click="BtnRed_Click"
400
+                                    Cursor="Hand"
401
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
402
+                                <Button
403
+                                    x:Name="btnGray"
404
+                                    Width="15"
405
+                                    Height="15"
406
+                                    Margin="0,8,0,0"
407
+                                    Background="#A7A9AC"
408
+                                    Click="BtnGray_Click"
409
+                                    Cursor="Hand"
410
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
411
+                                <Button
412
+                                    x:Name="btnCyanBlue"
413
+                                    Width="15"
414
+                                    Height="15"
415
+                                    Margin="0,8,0,0"
416
+                                    Background="#63D600"
417
+                                    Click="BtnCyanBlue_Click"
418
+                                    Cursor="Hand"
419
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
420
+                                <Button
421
+                                    x:Name="btnYellow"
422
+                                    Width="15"
423
+                                    Height="15"
424
+                                    Margin="0,8,0,0"
425
+                                    Background="#FFBC00"
426
+                                    Click="BtnYellow_Click"
427
+                                    Cursor="Hand"
428
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
429
+                                <Button
430
+                                    x:Name="btnBlue"
431
+                                    Width="15"
432
+                                    Height="15"
433
+                                    Margin="0,8,0,0"
434
+                                    Background="#00B4FC"
435
+                                    Click="BtnBlue_Click"
436
+                                    Cursor="Hand"
437
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
254
                             </StackPanel>
438
                             </StackPanel>
255
                         </Grid>
439
                         </Grid>
256
-                        <!--字体粗细-->
440
+                        <!--  字体粗细  -->
257
                         <Grid x:Name="gridThickness" Visibility="Collapsed">
441
                         <Grid x:Name="gridThickness" Visibility="Collapsed">
258
-                            <Image Source="./Images/Toobar21.png" HorizontalAlignment="Right" Margin="0,200,62,0"/>
259
-                            <StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="0,260,62,0">
260
-                                <Button  Cursor="Hand" x:Name="btnFine" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#FFFFFF" Height="3" Width="20" Margin="0,0,0,0" Click="BtnFine_Click"/>
261
-                                <Button  Cursor="Hand" x:Name="btnIn" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#FFFFFF" Height="5" Width="20" Margin="0,10,0,0" Click="BtnIn_Click"/>
262
-                                <Button  Cursor="Hand" x:Name="btnCrude" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#FFFFFF" Height="10" Width="20" Margin="0,10,0,0" Click="BtnCrude_Click"/>
442
+                            <Image
443
+                                Margin="0,200,62,0"
444
+                                HorizontalAlignment="Right"
445
+                                Source="./Images/Toobar21.png" />
446
+                            <StackPanel
447
+                                Margin="0,260,62,0"
448
+                                HorizontalAlignment="Right"
449
+                                Orientation="Vertical">
450
+                                <Button
451
+                                    x:Name="btnFine"
452
+                                    Width="20"
453
+                                    Height="3"
454
+                                    Margin="0,0,0,0"
455
+                                    Background="#FFFFFF"
456
+                                    Click="BtnFine_Click"
457
+                                    Cursor="Hand"
458
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
459
+                                <Button
460
+                                    x:Name="btnIn"
461
+                                    Width="20"
462
+                                    Height="5"
463
+                                    Margin="0,10,0,0"
464
+                                    Background="#FFFFFF"
465
+                                    Click="BtnIn_Click"
466
+                                    Cursor="Hand"
467
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
468
+                                <Button
469
+                                    x:Name="btnCrude"
470
+                                    Width="20"
471
+                                    Height="10"
472
+                                    Margin="0,10,0,0"
473
+                                    Background="#FFFFFF"
474
+                                    Click="BtnCrude_Click"
475
+                                    Cursor="Hand"
476
+                                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
263
                             </StackPanel>
477
                             </StackPanel>
264
                         </Grid>
478
                         </Grid>
265
                     </Grid>
479
                     </Grid>

+ 60
- 128
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs View File

1
 using Common.system;
1
 using Common.system;
2
 
2
 
3
-using NAudio.Wave;
4
-
5
 using NReco.VideoConverter;
3
 using NReco.VideoConverter;
6
 
4
 
7
 using System;
5
 using System;
12
 using System.Windows.Forms;
10
 using System.Windows.Forms;
13
 using System.Windows.Ink;
11
 using System.Windows.Ink;
14
 using System.Windows.Interop;
12
 using System.Windows.Interop;
15
-using System.Windows.Media;
16
 using System.Windows.Media.Imaging;
13
 using System.Windows.Media.Imaging;
17
 using System.Windows.Threading;
14
 using System.Windows.Threading;
18
 
15
 
182
             {
179
             {
183
                 SRTime = SRTime.AddMilliseconds(1000);
180
                 SRTime = SRTime.AddMilliseconds(1000);
184
             }
181
             }
185
-             
182
+
186
             if (SRTime.Hour > 0)
183
             if (SRTime.Hour > 0)
187
             {
184
             {
188
                 TxbTime.Content = SRTime.ToString("HH:mm:ss");
185
                 TxbTime.Content = SRTime.ToString("HH:mm:ss");
223
 
220
 
224
 
221
 
225
             TempVideoPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + ".avi";
222
             TempVideoPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + ".avi";
226
-            TempAudioPathName1 = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + "_1.mp3" ;
223
+            TempAudioPathName1 = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + "_1.mp3";
227
             TempAudioPathName2 = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + "_2.mp3";
224
             TempAudioPathName2 = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + "_2.mp3";
228
 
225
 
229
         }
226
         }
282
                     t.IsEnabled = true;
279
                     t.IsEnabled = true;
283
                     t.Start();
280
                     t.Start();
284
                 }
281
                 }
285
-                else {
282
+                else
283
+                {
286
                     t.Interval = new TimeSpan(0, 0, 0, 0, 1000);
284
                     t.Interval = new TimeSpan(0, 0, 0, 0, 1000);
287
                 }
285
                 }
288
-             
286
+
289
                 _state = State.Loading;
287
                 _state = State.Loading;
290
-                #region 检测麦克风扬声器是否可用
291
-
292
-                //string AudioPath = FileToolsCommon.GetFileAbsolutePath("/temp/audio/");
293
-                //FileToolsCommon.CreateDirectory(AudioPath);
294
-                //string audioSpeakerPath = AudioPath + "adoS" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".m";
295
-                //string audioMicrophonePath = AudioPath + "adoM" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".m";
296
-                //try
297
-                //{
298
-                //    FileToolsCommon.DeleteFile(audioSpeakerPath);
299
-                //    FileToolsCommon.DeleteFile(audioMicrophonePath);
300
-                //}
301
-                //catch (Exception)
302
-                //{
303
-                //}
304
-                //扬声器
305
-                //if (APP.FFmpeg.StartRecordSpeakerAudio(audioSpeakerPath))
306
-                //{
307
-                //    APP.FFmpeg.StopRecordAudio(2);
308
-
309
-                //    //麦克风
310
-                //    if (APP.FFmpeg.StartRecordAudio(audioMicrophonePath))
311
-                //    {
312
-                //    }
313
-                //    else
314
-                //    {
315
-                //        //无法录制麦克风
316
-                //        MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制麦克风,是否继续?", "消息提示", MessageBoxButton.OKCancel);
317
-                //        if (Res == MessageBoxResult.Cancel)
318
-                //        {
319
-                //            return;
320
-                //        }
321
-                //    }
322
-                //    APP.FFmpeg.StopRecordAudio(1);
323
-                //}
324
-                //else
325
-                //{
326
-                //    //无法录制扬声器音频
327
-                //    MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制音频,是否继续?", "消息提示", MessageBoxButton.OKCancel);
328
-                //    if (Res == MessageBoxResult.Cancel)
329
-                //    {
330
-                //        return;
331
-                //    }
332
-                //}
333
-
334
-                #endregion 检测麦克风扬声器是否可用
335
 
288
 
336
                 VideoInfo = new Model_Video
289
                 VideoInfo = new Model_Video
337
                 {
290
                 {
339
                     WkType = Enum_WKVidetype.RecordingScreen
292
                     WkType = Enum_WKVidetype.RecordingScreen
340
                 };
293
                 };
341
                 SetUpVideoPathName();
294
                 SetUpVideoPathName();
342
-                k_hook.Start();//安装键盘钩子
295
+       
343
 
296
 
344
                 if (APP.W_CountdownWindow == null)
297
                 if (APP.W_CountdownWindow == null)
345
                 {
298
                 {
352
                 }
305
                 }
353
                 APP.W_CountdownWindow.Show();
306
                 APP.W_CountdownWindow.Show();
354
 
307
 
355
-              
308
+
356
 
309
 
357
                 BtnRecordingScreen.Visibility = Visibility.Collapsed;
310
                 BtnRecordingScreen.Visibility = Visibility.Collapsed;
358
                 BtnRecordingScreenPause.Visibility = Visibility.Visible;
311
                 BtnRecordingScreenPause.Visibility = Visibility.Visible;
391
                 int RecordWidth = curScreen.Bounds.Width;
344
                 int RecordWidth = curScreen.Bounds.Width;
392
                 int RecordHeight = curScreen.Bounds.Height;
345
                 int RecordHeight = curScreen.Bounds.Height;
393
                 helper3 = new ZVideoRecordHelper(TempVideoPathName, RecordWidth, RecordHeight);
346
                 helper3 = new ZVideoRecordHelper(TempVideoPathName, RecordWidth, RecordHeight);
394
-            
347
+
395
                 new Thread(o =>
348
                 new Thread(o =>
396
                 {
349
                 {
397
                     Thread.Sleep(3000);
350
                     Thread.Sleep(3000);
398
-                    Dispatcher.Invoke(() => {
351
+                    Dispatcher.Invoke(() =>
352
+                    {
399
                         _state = State.Start;
353
                         _state = State.Start;
400
                         helper1.StartRecordAudio();
354
                         helper1.StartRecordAudio();
401
                         helper2.StartRecordAudio();
355
                         helper2.StartRecordAudio();
402
                         helper3.StartRecordVideo();
356
                         helper3.StartRecordVideo();
357
+
358
+                       
359
+                    });
360
+
361
+                    Thread.Sleep(1000);
362
+
363
+                    Dispatcher.Invoke(() =>
364
+                    {
365
+                        k_hook.Start();//安装键盘钩子
403
                     });
366
                     });
367
+                   
404
                 })
368
                 })
405
                 { IsBackground = true }.Start();
369
                 { IsBackground = true }.Start();
406
 
370
 
407
-                Console.WriteLine("TempAudioPathName1:"+ TempAudioPathName1);
371
+                Console.WriteLine("TempAudioPathName1:" + TempAudioPathName1);
408
                 Console.WriteLine("TempAudioPathName2:" + TempAudioPathName2);
372
                 Console.WriteLine("TempAudioPathName2:" + TempAudioPathName2);
409
                 Console.WriteLine("TempVideoPathName:" + TempVideoPathName);
373
                 Console.WriteLine("TempVideoPathName:" + TempVideoPathName);
410
             }
374
             }
414
                 helper1.PauseRecordAudio();
378
                 helper1.PauseRecordAudio();
415
                 helper2.PauseRecordAudio();
379
                 helper2.PauseRecordAudio();
416
                 helper3.PauseRecordVideo();
380
                 helper3.PauseRecordVideo();
381
+                BtnRecordingScreen.Visibility = Visibility.Visible;
382
+                BtnRecordingScreenPause.Visibility = Visibility.Collapsed;
417
             }
383
             }
418
-            else if (_state == State.Pause) {
384
+            else if (_state == State.Pause)
385
+            {
419
                 _state = State.Start;
386
                 _state = State.Start;
420
                 helper1.ResumeRecordAudio();
387
                 helper1.ResumeRecordAudio();
421
                 helper2.ResumeRecordAudio();
388
                 helper2.ResumeRecordAudio();
422
                 helper3.ResumeRecordVideo();
389
                 helper3.ResumeRecordVideo();
390
+                BtnRecordingScreen.Visibility = Visibility.Collapsed;
391
+                BtnRecordingScreenPause.Visibility = Visibility.Visible;
423
             }
392
             }
424
 
393
 
425
         }
394
         }
452
             BtnRecordingScreen.ToolTip = "开始";
421
             BtnRecordingScreen.ToolTip = "开始";
453
             k_hook.Stop();
422
             k_hook.Stop();
454
             TxbTime.Content = "00:00";
423
             TxbTime.Content = "00:00";
455
-   
424
+
456
             if (APP.W_PracticeWindow != null)
425
             if (APP.W_PracticeWindow != null)
457
             {
426
             {
458
                 if (APP.W_PracticeWindow.Visibility == Visibility.Visible)
427
                 if (APP.W_PracticeWindow.Visibility == Visibility.Visible)
471
             APP.W_XHMicroLessonSystemWindow.InitTQLPPen();
440
             APP.W_XHMicroLessonSystemWindow.InitTQLPPen();
472
             APP.W_XHMicroLessonSystemWindow.Show();
441
             APP.W_XHMicroLessonSystemWindow.Show();
473
 
442
 
474
-            if (_state == State.Pause || _state == State.Start) {
443
+            if (_state == State.Pause || _state == State.Start)
444
+            {
445
+                End();
475
                 t.Stop();
446
                 t.Stop();
476
                 t = null;
447
                 t = null;
477
                 Console.WriteLine("停止录制");
448
                 Console.WriteLine("停止录制");
478
                 helper1.StopRecordAudio();
449
                 helper1.StopRecordAudio();
479
                 helper2.StopRecordAudio();
450
                 helper2.StopRecordAudio();
480
                 helper3.StopRecordVideo();
451
                 helper3.StopRecordVideo();
481
-                FFMpegConverter ffMpeg = new FFMpegConverter();
482
-       
483
-                FFMpegInput[] input = new FFMpegInput[] {
452
+
453
+                new Thread(new ThreadStart(new Action(() =>
454
+                {
455
+                    FFMpegConverter ffMpeg = new FFMpegConverter();
456
+
457
+                    FFMpegInput[] input = new FFMpegInput[] {
484
                     new FFMpegInput(TempVideoPathName),
458
                     new FFMpegInput(TempVideoPathName),
485
                     new FFMpegInput(TempAudioPathName1),
459
                     new FFMpegInput(TempAudioPathName1),
486
                     new FFMpegInput(TempAudioPathName1),
460
                     new FFMpegInput(TempAudioPathName1),
487
                 };
461
                 };
488
-    
489
-                // 多路音频混音
490
-                ffMpeg.ConvertMedia(
491
-                    input,
492
-                    VideoSavePathName,
493
-                    "mp4",
494
-                    new OutputSettings()
495
-                    {
496
-                        CustomOutputArgs = "-filter_complex amix=inputs=2:duration=first:dropout_transition=2"
497
-                    }
498
-                );
499
-                //生成缩略图
500
-                string ThumbnailPath = FileToolsCommon.GetDirectoryName(VideoSavePathName) + "ThumbnailPath/";
501
-                FileToolsCommon.CreateDirectory(ThumbnailPath);
502
-                //缩略图存储位置
503
-                string ThumbnailPathName = ThumbnailPath + FileToolsCommon.GetIOFileName(VideoSavePathName).Replace(".", "") + ".JPG";
504
-                new Thread(new ThreadStart(new Action(() =>
505
-                {
462
+
463
+                    // 多路音频混音
464
+                    ffMpeg.ConvertMedia(
465
+                        input,
466
+                        VideoSavePathName,
467
+                        "mp4",
468
+                        new OutputSettings()
469
+                        {
470
+                            CustomOutputArgs = "-filter_complex amix=inputs=2:duration=first:dropout_transition=2"
471
+                        }
472
+                    );
473
+                    //生成缩略图
474
+                    string ThumbnailPath = FileToolsCommon.GetDirectoryName(VideoSavePathName) + "ThumbnailPath/";
475
+                    FileToolsCommon.CreateDirectory(ThumbnailPath);
476
+                    //缩略图存储位置
477
+                    string ThumbnailPathName = ThumbnailPath + FileToolsCommon.GetIOFileName(VideoSavePathName).Replace(".", "") + ".JPG";
506
 
478
 
507
                     FileToolsCommon.DeleteFile(ThumbnailPathName);
479
                     FileToolsCommon.DeleteFile(ThumbnailPathName);
508
                     VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
480
                     VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
526
                 Click_stopRecordingScreen();
498
                 Click_stopRecordingScreen();
527
             }
499
             }
528
             Hide();
500
             Hide();
529
-            End();
501
+
502
+            SRTime = Convert.ToDateTime("2020-01-01 00:00:00");
503
+            TxbTime.Content = "00:00";
504
+
530
         }
505
         }
531
 
506
 
532
         public void MaxToobar()
507
         public void MaxToobar()
1079
         /// <param name="e"></param>
1054
         /// <param name="e"></param>
1080
         private void BtnReturn_Click(object sender, RoutedEventArgs e)
1055
         private void BtnReturn_Click(object sender, RoutedEventArgs e)
1081
         {
1056
         {
1082
-            if (_state==State.Pause || _state == State.Start)
1057
+            if (_state == State.Pause || _state == State.Start)
1083
             {
1058
             {
1084
-                MessageBoxResult br = MessageWindow.Show("退出将取消保存当前录屏,是否继续?", "提示", MessageBoxButton.OKCancel);
1059
+                MessageBoxResult br = MessageWindow.Show("退出将结束并保存录制,是否继续?", "提示", MessageBoxButton.OKCancel);
1085
                 if (br == MessageBoxResult.Cancel)
1060
                 if (br == MessageBoxResult.Cancel)
1086
                 {
1061
                 {
1087
                     return;
1062
                     return;
1088
                 }
1063
                 }
1089
-                k_hook.Stop();
1090
-                BtnRecordingScreen.ToolTip = "开始";
1091
-
1092
-                TxbTime.Content = "00:00";
1093
-                End();
1094
-                APP.W_PracticeWindow.ReturnPractice();
1095
-                if (APP.W_PracticeWindow != null)
1096
-                {
1097
-                    if (APP.W_PracticeWindow.Visibility == Visibility.Visible)
1098
-                    {
1099
-                        APP.W_PracticeWindow.Hide();
1100
-                    }
1101
-                }
1102
-                if (gridToolbar.Visibility == Visibility.Visible)
1103
-                {
1104
-                    gridToolbar.Visibility = Visibility.Hidden;
1105
-                    gridColour.Visibility = Visibility.Hidden;
1106
-                    gridThickness.Visibility = Visibility.Hidden;
1107
-                }
1108
-                if (APP.W_XHMicroLessonSystemWindow == null)
1109
-                {
1110
-                    APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
1111
-                }
1112
-                try
1113
-                {
1114
-                    try
1115
-                    {
1116
-                        APP.FFmpeg.SuspendFFmpeg();
1117
-                    }
1118
-                    catch (Exception ex)
1119
-                    {
1120
-                        LogHelper.WriteErrLog("【录屏返回】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
1121
-                    }
1122
-         
1123
-                    new Thread(new ThreadStart(new Action(() =>
1124
-                    {
1125
-                        VideoInfo = null;
1126
-                        FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temprs/");
1127
-                    }))).Start();
1128
-                }
1129
-                catch (Exception ex)
1130
-                {
1131
-                    LogHelper.WriteErrLog("【录屏返回】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
1132
-                }
1064
+                BtnStopRecordingScreen_Click(null,null);
1133
             }
1065
             }
1134
             APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
1066
             APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
1135
             APP.W_XHMicroLessonSystemWindow.InitPen();
1067
             APP.W_XHMicroLessonSystemWindow.InitPen();

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

43
         <ControlTemplate.Triggers>
43
         <ControlTemplate.Triggers>
44
             <Trigger Property="IsMouseOver" Value="True">
44
             <Trigger Property="IsMouseOver" Value="True">
45
                 <Setter TargetName="ImgSetUp" Property="Source" Value="/SkinImages/TechnologyBlue/HM_Close_MI.png"/>
45
                 <Setter TargetName="ImgSetUp" Property="Source" Value="/SkinImages/TechnologyBlue/HM_Close_MI.png"/>
46
-                <Setter TargetName="Word" Property="Foreground" Value="#FFA1C0FA"/>
46
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff"/>
47
             </Trigger>
47
             </Trigger>
48
         </ControlTemplate.Triggers>
48
         </ControlTemplate.Triggers>
49
     </ControlTemplate>
49
     </ControlTemplate>
61
         <ControlTemplate.Triggers>
61
         <ControlTemplate.Triggers>
62
             <Trigger Property="IsMouseOver" Value="True">
62
             <Trigger Property="IsMouseOver" Value="True">
63
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_MI.png"/>
63
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_MI.png"/>
64
-                <Setter TargetName="Word" Property="Foreground" Value="#FFA1C0FA"/>
64
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff"/>
65
             </Trigger>
65
             </Trigger>
66
             <Trigger Property="IsPressed" Value="True">
66
             <Trigger Property="IsPressed" Value="True">
67
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_MI.png"/>
67
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_MI.png"/>
68
-                <Setter TargetName="Word" Property="Foreground" Value="#FFA1C0FA"/>
68
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff"/>
69
             </Trigger>
69
             </Trigger>
70
             <Trigger Property="IsEnabled" Value="False">
70
             <Trigger Property="IsEnabled" Value="False">
71
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_N.png"/>
71
                 <Setter TargetName="ImgRecord" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZ_N.png"/>
86
         <ControlTemplate.Triggers>
86
         <ControlTemplate.Triggers>
87
             <Trigger Property="IsMouseOver" Value="True">
87
             <Trigger Property="IsMouseOver" Value="True">
88
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_MI.png"/>
88
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_MI.png"/>
89
-                <Setter TargetName="Word" Property="Foreground" Value="#FFA1C0FA"/>
89
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff"/>
90
             </Trigger>
90
             </Trigger>
91
             <Trigger Property="IsPressed" Value="True">
91
             <Trigger Property="IsPressed" Value="True">
92
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_MI.png"/>
92
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_MI.png"/>
93
-                <Setter TargetName="Word" Property="Foreground" Value="#FFA1C0FA"/>
93
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff"/>
94
             </Trigger>
94
             </Trigger>
95
             <Trigger Property="IsEnabled" Value="False">
95
             <Trigger Property="IsEnabled" Value="False">
96
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_N.png"/>
96
                 <Setter TargetName="ImgRecordSuspend" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_LZZT_N.png"/>
111
         <ControlTemplate.Triggers>
111
         <ControlTemplate.Triggers>
112
             <Trigger Property="IsMouseOver" Value="True">
112
             <Trigger Property="IsMouseOver" Value="True">
113
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_MI.png"/>
113
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_MI.png"/>
114
-                <Setter TargetName="Word" Property="Foreground" Value="#FFA1C0FA"/>
114
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff"/>
115
             </Trigger>
115
             </Trigger>
116
             <Trigger Property="IsPressed" Value="True">
116
             <Trigger Property="IsPressed" Value="True">
117
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_MI.png"/>
117
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_MI.png"/>
118
-                <Setter TargetName="Word" Property="Foreground" Value="#FFA1C0FA"/>
118
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff"/>
119
             </Trigger>
119
             </Trigger>
120
             <Trigger Property="IsEnabled" Value="False">
120
             <Trigger Property="IsEnabled" Value="False">
121
                 <Setter TargetName="ImgRecordStop" Property="Source" Value="/SkinImages/TechnologyBlue/Toolbar_Save_N.png"/>
121
                 <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="#FFA1C0FA" />
81
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
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="#FFA1C0FA" />
85
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
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="#FFA1C0FA" />
116
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
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="#FFA1C0FA" />
120
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
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="#FFA1C0FA" />
151
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
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="#FFA1C0FA" />
155
+                <Setter TargetName="Word" Property="Foreground" Value="#3f6fff" />
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" />

+ 21
- 17
XHWK.WKTool/UControl/Uc_VideoItem.xaml View File

49
                             <RowDefinition Height="60*" />
49
                             <RowDefinition Height="60*" />
50
                             <RowDefinition Height="40*" />
50
                             <RowDefinition Height="40*" />
51
                         </Grid.RowDefinitions>
51
                         </Grid.RowDefinitions>
52
-                        <Grid Grid.Row="0" Grid.Column="2">
52
+                        <Grid
53
+                            Grid.Row="0"
54
+                            Grid.Column="2"
55
+                            Visibility="Hidden">
53
                             <Button
56
                             <Button
54
                                 x:Name="btnSetUp"
57
                                 x:Name="btnSetUp"
55
                                 Margin="0,0,4,0"
58
                                 Margin="0,0,4,0"
80
             <Grid Grid.Row="2">
83
             <Grid Grid.Row="2">
81
                 <Grid.RowDefinitions>
84
                 <Grid.RowDefinitions>
82
                     <RowDefinition Height="5*" />
85
                     <RowDefinition Height="5*" />
83
-                    <RowDefinition Height="30*" />
86
+                    <RowDefinition Height="30" />
84
                     <RowDefinition Height="5*" />
87
                     <RowDefinition Height="5*" />
85
-                    <RowDefinition Height="30*" />
88
+                    <RowDefinition Height="26" />
86
                     <RowDefinition Height="36*" />
89
                     <RowDefinition Height="36*" />
87
                 </Grid.RowDefinitions>
90
                 </Grid.RowDefinitions>
88
                 <!--  名  -->
91
                 <!--  名  -->
89
                 <Grid Grid.Row="1">
92
                 <Grid Grid.Row="1">
90
                     <TextBlock
93
                     <TextBlock
91
                         x:Name="TbName"
94
                         x:Name="TbName"
95
+                        VerticalAlignment="Center"
92
                         FontSize="{Binding WordSize18}"
96
                         FontSize="{Binding WordSize18}"
93
-                        Foreground="#FF3492F4"
97
+                        Foreground="#3f6fff"
94
                         MouseLeftButtonDown="TextBlock_MouseLeftButtonDown"
98
                         MouseLeftButtonDown="TextBlock_MouseLeftButtonDown"
95
                         Text="一二三四五六七八九十一..."
99
                         Text="一二三四五六七八九十一..."
96
                         TextAlignment="Center"
100
                         TextAlignment="Center"
144
                         x:Name="lblDateSize"
148
                         x:Name="lblDateSize"
145
                         HorizontalContentAlignment="Center"
149
                         HorizontalContentAlignment="Center"
146
                         Content="2020-10-10 10:10:00|1000.00MB"
150
                         Content="2020-10-10 10:10:00|1000.00MB"
147
-                        FontSize="{Binding WordSize12}"
151
+                        FontSize="12"
148
                         Foreground="#FF9A9A9A" />
152
                         Foreground="#FF9A9A9A" />
149
                 </Grid>
153
                 </Grid>
150
                 <!--  按钮  -->
154
                 <!--  按钮  -->
157
                         <ColumnDefinition Width="20*" />
161
                         <ColumnDefinition Width="20*" />
158
                     </Grid.ColumnDefinitions>
162
                     </Grid.ColumnDefinitions>
159
                     <Grid Grid.Column="1">
163
                     <Grid Grid.Column="1">
160
-                        <Border
161
-                            x:Name="BorUploadBtn"
162
-                            Background="#FF3492F4"
163
-                            CornerRadius="4">
164
+                        <Border x:Name="BorUploadBtn">
164
                             <Button
165
                             <Button
165
                                 x:Name="BtnUpload"
166
                                 x:Name="BtnUpload"
167
+                                Width="76"
168
+                                Height="30"
166
                                 HorizontalAlignment="Stretch"
169
                                 HorizontalAlignment="Stretch"
167
                                 VerticalAlignment="Stretch"
170
                                 VerticalAlignment="Stretch"
171
+                                Background="#3f6fff"
168
                                 Click="BtnUpload_Click"
172
                                 Click="BtnUpload_Click"
169
                                 Content="上传"
173
                                 Content="上传"
170
                                 Cursor="Hand"
174
                                 Cursor="Hand"
171
-                                FontSize="{Binding WordSize18}"
172
-                                Foreground="White"
173
-                                Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
175
+                                FontSize="14"
176
+                                Foreground="White" />
174
                         </Border>
177
                         </Border>
175
                     </Grid>
178
                     </Grid>
176
                     <Grid Grid.Column="3">
179
                     <Grid Grid.Column="3">
177
-                        <Border Background="#FFC3C3C3" CornerRadius="6">
180
+                        <Border>
178
                             <Button
181
                             <Button
179
                                 x:Name="BtnDelVideo"
182
                                 x:Name="BtnDelVideo"
183
+                                Width="76"
184
+                                Height="30"
180
                                 HorizontalAlignment="Stretch"
185
                                 HorizontalAlignment="Stretch"
181
                                 VerticalAlignment="Stretch"
186
                                 VerticalAlignment="Stretch"
182
-                                Background="Transparent"
187
+                                Background="#FFC3C3C3"
183
                                 Click="BtnDelVideo_Click"
188
                                 Click="BtnDelVideo_Click"
184
                                 Content="删除"
189
                                 Content="删除"
185
                                 Cursor="Hand"
190
                                 Cursor="Hand"
186
-                                FontSize="{Binding WordSize18}"
187
-                                Foreground="White"
188
-                                Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
191
+                                FontSize="14"
192
+                                Foreground="White" />
189
                         </Border>
193
                         </Border>
190
                     </Grid>
194
                     </Grid>
191
                 </Grid>
195
                 </Grid>

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

67
             lblDateSize.Content = VideoModel.RSTime + " " + VideoModel.VideoSize;
67
             lblDateSize.Content = VideoModel.RSTime + " " + VideoModel.VideoSize;
68
             if (VideoModel.IsUpload)
68
             if (VideoModel.IsUpload)
69
             {
69
             {
70
-                //BtnUpload.Visibility = Visibility.Hidden;
71
-                BorUploadBtn.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#DDDDDD"));
72
-                BtnUpload.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#999999"));
73
-                BtnUpload.IsEnabled = false;
70
+                BtnUpload.Visibility = Visibility.Hidden;
71
+              
74
             }
72
             }
75
         }
73
         }
76
         #endregion
74
         #endregion
320
 
318
 
321
                 if (dAL_Upload.UploadVideo(VideoModel.FileGuid, out string ErrMessage))
319
                 if (dAL_Upload.UploadVideo(VideoModel.FileGuid, out string ErrMessage))
322
                 {
320
                 {
321
+                    APP.IsUpLoad = false;
323
                     //MessageWindow.Show("视频上传服务器成功!");
322
                     //MessageWindow.Show("视频上传服务器成功!");
324
                     if (W_UploadWindow == null)
323
                     if (W_UploadWindow == null)
325
                     {
324
                     {

+ 178
- 101
XHWK.WKTool/UploadWindow.xaml View File

1
-<Window x:Class="XHWK.WKTool.UploadWindow"
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" xmlns:Views="clr-namespace:XHWK.WKTool.Helpers"
7
-        mc:Ignorable="d"
8
-        Title="UploadWindow" Height="346" Width="457"   AllowsTransparency="True"
1
+<Window
2
+    x:Class="XHWK.WKTool.UploadWindow"
3
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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"
7
+    xmlns:local="clr-namespace:XHWK.WKTool"
8
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9
+    Title="UploadWindow"
10
+    Width="457"
11
+    Height="346"
12
+    Margin="0"
13
+    AllowsTransparency="True"
14
+    BorderBrush="#eeeeee"
15
+    BorderThickness="1"
16
+    Loaded="Window_Loaded"
9
     WindowStartupLocation="CenterScreen"
17
     WindowStartupLocation="CenterScreen"
10
-    WindowStyle="None" Loaded="Window_Loaded" Margin="0"    BorderThickness="7">
11
-    <Window.Effect>
12
-        <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
13
-    </Window.Effect>
14
-    <Viewbox>
15
-        <Grid Height="341" Width="454" >
16
-            <!--分4行-->
17
-            <Grid.RowDefinitions>
18
-                <RowDefinition Height="45"/>
19
-                <RowDefinition Height="30"/>
20
-                <RowDefinition Height="90"/>
21
-                <RowDefinition Height="90"/>
22
-                <RowDefinition Height="*"/>
23
-            </Grid.RowDefinitions>
24
-            <!--第一行 标题-->
25
-            <Grid x:Name="GridTitle" Visibility="Visible" Grid.Row="0" Margin="-1,0" Background="#2D8CF0" MouseLeftButtonDown="Window_MouseLeftButtonDown">
26
-                <TextBlock Text="上传" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
27
-                <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>
28
-            </Grid>
29
-            <Grid x:Name="GridTitle_Black" Visibility="Collapsed" Grid.Row="0" Margin="0,0" Background="#FFE9E9E9" MouseLeftButtonDown="Window_MouseLeftButtonDown">
30
-                <TextBlock Text="上传" Foreground="#FF333333" FontSize="16" Padding="10,13,0,0"/>
31
-                <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown_Black" Content="×" Foreground="#FF333333" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>
32
-            </Grid>
33
-            <!--第三行 教材-->
34
-            <ComboBox Cursor="Hand"
35
-                            x:Name="book_list"
36
-                            Grid.Row="2"
37
-                            Height="50"
38
-                      Width="400"
39
-                            Margin="0,0,0,0"
40
-                            Padding="10,0,0,0"
41
-                            VerticalContentAlignment="Center"
42
-                            DisplayMemberPath="Value"
43
-                            FontSize="18"
44
-                            ItemsSource="{Binding bookList}"
45
-                            SelectedValuePath="Key"
46
-                      SelectionChanged="toolbar_list_SelectionChanged" BorderBrush="#FFCDD6E0" Foreground="Black" Background="White"
47
-                          >
48
-                <ComboBox.Resources>
49
-                    <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="White" />
50
-                    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Gray" />
51
-                </ComboBox.Resources>
52
-            </ComboBox>
53
-            <!--章节-->
54
-            <ComboBox Cursor="Hand"
55
-                            x:Name="cmbTeachingMaterial"
56
-                            Grid.Row="3"
57
-                               Height="50"
58
-                             Width="400"
59
-                            Padding="10,0,0,0"
60
-                            VerticalContentAlignment="Center"
61
-                          
62
-                            DisplayMemberPath="Value"
63
-                            FontSize="18"
64
-                            Foreground="Black"
65
-                            ItemsSource="{Binding zhangjieList}"
66
-                            SelectedValuePath="Key" BorderBrush="#FFCDD6E0" >
67
-                <ComboBox.Resources>
68
-                    <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="White" />
69
-                    <!--<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Green" />-->
70
-                </ComboBox.Resources>
71
-            </ComboBox>
72
-            <!--第四行 开始按钮-->
73
-            <Button  Cursor="Hand" Grid.Row="4" IsDefault="True" x:Name="btnStart" Content="确定" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="418" Height="43" Margin="10,0,10,0" Click="BtnStart_Click">
74
-                <Button.Template>
75
-                    <ControlTemplate TargetType="{x:Type Button}">
76
-                        <Border
77
-                                BorderBrush="{TemplateBinding Control.BorderBrush}"
78
-                                BorderThickness="1"
79
-                                CornerRadius="2">
80
-                            <Border.Background>#38ADFF</Border.Background>
81
-                            <ContentPresenter
82
-                                    HorizontalAlignment="Center"
83
-                                    VerticalAlignment="Center"
84
-                                    Content="{TemplateBinding ContentControl.Content}" />
85
-                        </Border>
86
-                    </ControlTemplate>
87
-                </Button.Template>
88
-            </Button>
89
-            <Views:ZJClippingBorder Grid.Row="0" Grid.RowSpan="2" x:Name="tip_outer" Margin="0" Background="#FFE6EAF0" CornerRadius="4" Visibility="Collapsed">
90
-                <Grid>
91
-                    <Label Content="上传中..." HorizontalAlignment="Center" Margin="0,7,0,0" Height="35" VerticalAlignment="Top" FontSize="20"></Label>
92
-                    <ProgressBar BorderBrush="#4597FF"
93
-                             Foreground="#4597FF"
94
-                    Grid.Row="0"
18
+    WindowStyle="None"
19
+    mc:Ignorable="d">
20
+
21
+    <Grid>
22
+        <!--  分4行  -->
23
+        <Grid.RowDefinitions>
24
+            <RowDefinition Height="45" />
25
+            <RowDefinition Height="30" />
26
+            <RowDefinition Height="90" />
27
+            <RowDefinition Height="90" />
28
+            <RowDefinition Height="*" />
29
+        </Grid.RowDefinitions>
30
+        <!--  第一行 标题  -->
31
+        <Grid
32
+            x:Name="GridTitle"
33
+            Grid.Row="0"
34
+            Background="#3f6fff"
35
+            MouseLeftButtonDown="Window_MouseLeftButtonDown"
36
+            Visibility="Visible">
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
+                Width="45"
46
+                Height="45"
47
+                HorizontalAlignment="Right"
48
+                Click="BtnDown_Click"
49
+                Content="×"
50
+                Cursor="Hand"
51
+                FontSize="25"
52
+                Foreground="#FFFFFF"
53
+                Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
54
+        </Grid>
55
+        <Grid
56
+            x:Name="GridTitle_Black"
57
+            Grid.Row="0"
58
+            Margin="0,0"
59
+            Background="#FFE9E9E9"
60
+            MouseLeftButtonDown="Window_MouseLeftButtonDown"
61
+            Visibility="Collapsed">
62
+            <TextBlock
63
+                Padding="10,13,0,0"
64
+                FontSize="16"
65
+                Foreground="#FF333333"
66
+                Text="上传" />
67
+            <Button
68
+                x:Name="btnDown_Black"
69
+                Grid.Row="0"
70
+                Padding="10,0,10,0"
71
+                HorizontalAlignment="Right"
72
+                Click="BtnDown_Click"
73
+                Content="×"
74
+                Cursor="Hand"
75
+                FontSize="25"
76
+                Foreground="#FF333333"
77
+                Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
78
+        </Grid>
79
+        <!--  第三行 教材  -->
80
+        <ComboBox
81
+            x:Name="book_list"
82
+            Grid.Row="2"
83
+            Width="400"
84
+            Height="50"
85
+            Margin="0,0,0,0"
86
+            Padding="10,0,0,0"
87
+            VerticalContentAlignment="Center"
88
+            Background="White"
89
+            BorderBrush="#FFCDD6E0"
90
+            Cursor="Hand"
91
+            DisplayMemberPath="Value"
92
+            FontSize="16"
93
+            Foreground="Black"
94
+            ItemsSource="{Binding bookList}"
95
+            SelectedValuePath="Key"
96
+            SelectionChanged="toolbar_list_SelectionChanged">
97
+            <ComboBox.Resources>
98
+                <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="White" />
99
+                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Gray" />
100
+            </ComboBox.Resources>
101
+        </ComboBox>
102
+        <!--  章节  -->
103
+        <ComboBox
104
+            x:Name="cmbTeachingMaterial"
105
+            Grid.Row="3"
106
+            Width="400"
107
+            Height="50"
108
+            Padding="10,0,0,0"
109
+            VerticalContentAlignment="Center"
110
+            BorderBrush="#FFCDD6E0"
111
+            Cursor="Hand"
112
+            DisplayMemberPath="Value"
113
+            FontSize="16"
114
+            Foreground="Black"
115
+            ItemsSource="{Binding zhangjieList}"
116
+            SelectedValuePath="Key">
117
+            <ComboBox.Resources>
118
+                <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="White" />
119
+                <!--<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Green" />-->
120
+            </ComboBox.Resources>
121
+        </ComboBox>
122
+        <!--  第四行 开始按钮  -->
123
+        <Button
124
+            x:Name="btnStart"
125
+            Grid.Row="4"
126
+            Width="400"
127
+            Height="42"
128
+            Margin="10,0,10,0"
129
+            Click="BtnStart_Click"
130
+            Content="确定"
131
+            Cursor="Hand"
132
+            FontSize="18"
133
+            Foreground="#FFFFFF"
134
+            IsDefault="True"
135
+            Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
136
+            <Button.Template>
137
+                <ControlTemplate TargetType="{x:Type Button}">
138
+                    <Border
139
+                        BorderBrush="{TemplateBinding Control.BorderBrush}"
140
+                        BorderThickness="1"
141
+                        CornerRadius="21">
142
+                        <Border.Background>#3f6fff</Border.Background>
143
+                        <ContentPresenter
144
+                            HorizontalAlignment="Center"
145
+                            VerticalAlignment="Center"
146
+                            Content="{TemplateBinding ContentControl.Content}" />
147
+                    </Border>
148
+                </ControlTemplate>
149
+            </Button.Template>
150
+        </Button>
151
+        <Views:ZJClippingBorder
152
+            x:Name="tip_outer"
153
+            Grid.Row="0"
154
+            Grid.RowSpan="2"
155
+            Margin="0"
156
+            Background="#FFE6EAF0"
157
+            CornerRadius="4"
158
+            Visibility="Collapsed">
159
+            <Grid>
160
+                <Label
161
+                    Height="35"
162
+                    Margin="0,7,0,0"
163
+                    HorizontalAlignment="Center"
164
+                    VerticalAlignment="Top"
165
+                    Content="上传中..."
166
+                    FontSize="20" />
167
+                <ProgressBar
95
                     x:Name="pgbProcess"
168
                     x:Name="pgbProcess"
169
+                    Grid.Row="0"
96
                     Height="20"
170
                     Height="20"
97
                     Margin="50,20,50,0"
171
                     Margin="50,20,50,0"
172
+                    BorderBrush="#4597FF"
173
+                    Foreground="#4597FF"
98
                     Visibility="Visible" />
174
                     Visibility="Visible" />
99
-                    <Label Grid.Row="0"
100
-                    HorizontalAlignment="Center" Width="60"
175
+                <Label
101
                     x:Name="lbProcess"
176
                     x:Name="lbProcess"
177
+                    Grid.Row="0"
178
+                    Width="60"
102
                     Height="30"
179
                     Height="30"
103
                     Margin="0,20,0,0"
180
                     Margin="0,20,0,0"
104
-                       FontSize="16"
181
+                    HorizontalAlignment="Center"
105
                     Content=""
182
                     Content=""
106
-                       Foreground="White"
183
+                    FontSize="16"
184
+                    Foreground="White"
107
                     Visibility="Visible" />
185
                     Visibility="Visible" />
108
-                </Grid>
109
-            </Views:ZJClippingBorder>
110
-        </Grid>
111
-    </Viewbox>
186
+            </Grid>
187
+        </Views:ZJClippingBorder>
188
+    </Grid>
112
 </Window>
189
 </Window>

+ 18
- 17
XHWK.WKTool/UploadWindow.xaml.cs View File

53
         public UploadWindow()
53
         public UploadWindow()
54
         {
54
         {
55
             InitializeComponent();
55
             InitializeComponent();
56
-            //if (APP.SkinStyle == "1")
57
-            //{
58
-            //    GridTitle.Visibility = Visibility.Visible;
59
-            //    GridTitle_Black.Visibility = Visibility.Collapsed;
60
-            //}
61
-            //else if (APP.SkinStyle == "2")
62
-            //{
63
-            //    GridTitle.Visibility = Visibility.Collapsed;
64
-            //    GridTitle_Black.Visibility = Visibility.Visible;
65
-            //}
66
-            //else
67
-            //{
68
-            //    GridTitle.Visibility = Visibility.Visible;
69
-            //    GridTitle_Black.Visibility = Visibility.Collapsed;
70
-            //}
56
+
71
         }
57
         }
72
         /// <summary>
58
         /// <summary>
73
         /// 初始化
59
         /// 初始化
127
                 {
113
                 {
128
                     Key = "0",
114
                     Key = "0",
129
                     Value = "全部",
115
                     Value = "全部",
116
+                    leaf = 1
130
                 });
117
                 });
131
                 for (int i = 0; i < APP.DirectorList.Count; i++)
118
                 for (int i = 0; i < APP.DirectorList.Count; i++)
132
                 {
119
                 {
134
                     pageData.zhangjieList.Add(new ComboBoxBean()
121
                     pageData.zhangjieList.Add(new ComboBoxBean()
135
                     {
122
                     {
136
                         Key = item.directorid,
123
                         Key = item.directorid,
137
-                        Value = item.directorname
124
+                        Value = item.directorname,
125
+                        leaf = item.leaf
138
                     });
126
                     });
139
                     addChild(item);
127
                     addChild(item);
140
                 }
128
                 }
158
                     pageData.zhangjieList.Add(new ComboBoxBean()
146
                     pageData.zhangjieList.Add(new ComboBoxBean()
159
                     {
147
                     {
160
                         Key = child.directorid,
148
                         Key = child.directorid,
161
-                        Value = getSpace(child.directorlevel) + child.directorname
149
+                        Value = getSpace(child.directorlevel) + child.directorname,
150
+                        leaf = child.leaf
162
                     });
151
                     });
163
                     if (child.children != null && child.children.Count > 0)
152
                     if (child.children != null && child.children.Count > 0)
164
                     {
153
                     {
215
             if (string.IsNullOrWhiteSpace(book_list.Text))
204
             if (string.IsNullOrWhiteSpace(book_list.Text))
216
             {
205
             {
217
                 MessageWindow.Show("请选择教材!");
206
                 MessageWindow.Show("请选择教材!");
207
+                return;
218
             }
208
             }
209
+
210
+            if (cmbTeachingMaterial.SelectedIndex < pageData.zhangjieList.Count)
211
+            {
212
+                int leaf = pageData.zhangjieList[cmbTeachingMaterial.SelectedIndex].leaf;
213
+                if (leaf != 1)
214
+                {
215
+                    MessageWindow.Show("只能选择小节或全部进行上传!");
216
+                    return;
217
+                }
218
+            }
219
+
219
             btnStart.IsEnabled = false;
220
             btnStart.IsEnabled = false;
220
             book_list.IsEnabled = false;
221
             book_list.IsEnabled = false;
221
             cmbTeachingMaterial.IsEnabled = false;
222
             cmbTeachingMaterial.IsEnabled = false;

+ 2
- 2
XHWK.WKTool/VideoClipWindow.xaml View File

266
             <RowDefinition Height="auto"></RowDefinition>
266
             <RowDefinition Height="auto"></RowDefinition>
267
             <RowDefinition Height="147*"></RowDefinition>
267
             <RowDefinition Height="147*"></RowDefinition>
268
         </Grid.RowDefinitions>
268
         </Grid.RowDefinitions>
269
-        <Grid Background="#2D8CF0" Grid.Row="0" MouseLeftButtonDown="Title_MouseLeftButtonDown">
269
+        <Grid Background="#3f6fff" Grid.Row="0" MouseLeftButtonDown="Title_MouseLeftButtonDown">
270
             <TextBlock Text="视频剪辑" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
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" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="Button_Click"/>
271
             <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="Button_Click"/>
272
         </Grid>
272
         </Grid>
350
                     <Button.Template>
350
                     <Button.Template>
351
                         <ControlTemplate TargetType="{x:Type Button}">
351
                         <ControlTemplate TargetType="{x:Type Button}">
352
                             <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="8" Padding="10,5">
352
                             <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="8" Padding="10,5">
353
-                                <Border.Background>#FF3492F4</Border.Background>
353
+                                <Border.Background>#3f6fff</Border.Background>
354
                                 <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding ContentControl.Content}" />
354
                                 <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding ContentControl.Content}" />
355
                             </Border>
355
                             </Border>
356
                         </ControlTemplate>
356
                         </ControlTemplate>

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

1
+<Window
2
+    x:Class="XHWK.WKTool.Welcome"
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="Welcome"
9
+    Width="100"
10
+    Height="100"
11
+    mc:Ignorable="d">
12
+    <Grid />
13
+</Window>

+ 28
- 0
XHWK.WKTool/Welcome.xaml.cs View File

1
+using System.IO;
2
+using System.Windows;
3
+
4
+namespace XHWK.WKTool
5
+{
6
+    /// <summary>
7
+    /// Welcome.xaml 的交互逻辑
8
+    /// </summary>
9
+    public partial class Welcome : Window
10
+    {
11
+        public Welcome()
12
+        {
13
+            InitializeComponent();
14
+
15
+
16
+            if (!File.Exists(APP.DataPath + "signature.txt"))//上次登录时间为空 或者签名为空 或者上次登录时间不是今天   都需要输入密匙验证 ,否则只验证本地的签名
17
+            {
18
+                new KeyVerification().Show();
19
+                Close();
20
+            }
21
+            else
22
+            {
23
+                new ProductVerification().Show();
24
+                Close();
25
+            }
26
+        }
27
+    }
28
+}

+ 50
- 132
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

846
                                                             Cursor="SizeAll"
846
                                                             Cursor="SizeAll"
847
                                                             Fill="#00000000"
847
                                                             Fill="#00000000"
848
                                                             SnapsToDevicePixels="True"
848
                                                             SnapsToDevicePixels="True"
849
-                                                            Stroke="#2D8CF0"
849
+                                                            Stroke="#3f6fff"
850
                                                             StrokeDashArray="4 4"
850
                                                             StrokeDashArray="4 4"
851
                                                             StrokeThickness="4"
851
                                                             StrokeThickness="4"
852
                                                             Visibility="Hidden" />
852
                                                             Visibility="Hidden" />
873
                                                                 HorizontalAlignment="Left"
873
                                                                 HorizontalAlignment="Left"
874
                                                                 VerticalAlignment="Top"
874
                                                                 VerticalAlignment="Top"
875
                                                                 Background="White"
875
                                                                 Background="White"
876
-                                                                BorderBrush="#2D8CF0"
876
+                                                                BorderBrush="#3f6fff"
877
                                                                 BorderThickness="2"
877
                                                                 BorderThickness="2"
878
                                                                 Cursor="SizeNWSE"
878
                                                                 Cursor="SizeNWSE"
879
                                                                 DragCompleted="RectRightUp_DragCompleted"
879
                                                                 DragCompleted="RectRightUp_DragCompleted"
889
                                                                 HorizontalAlignment="Left"
889
                                                                 HorizontalAlignment="Left"
890
                                                                 VerticalAlignment="Top"
890
                                                                 VerticalAlignment="Top"
891
                                                                 Background="White"
891
                                                                 Background="White"
892
-                                                                BorderBrush="#2D8CF0"
892
+                                                                BorderBrush="#3f6fff"
893
                                                                 BorderThickness="2"
893
                                                                 BorderThickness="2"
894
                                                                 Cursor="SizeNESW"
894
                                                                 Cursor="SizeNESW"
895
                                                                 DragCompleted="RectRightUp_DragCompleted"
895
                                                                 DragCompleted="RectRightUp_DragCompleted"
905
                                                                 HorizontalAlignment="Left"
905
                                                                 HorizontalAlignment="Left"
906
                                                                 VerticalAlignment="Top"
906
                                                                 VerticalAlignment="Top"
907
                                                                 Background="White"
907
                                                                 Background="White"
908
-                                                                BorderBrush="#2D8CF0"
908
+                                                                BorderBrush="#3f6fff"
909
                                                                 BorderThickness="2"
909
                                                                 BorderThickness="2"
910
                                                                 Cursor="SizeNESW"
910
                                                                 Cursor="SizeNESW"
911
                                                                 DragCompleted="RectRightUp_DragCompleted"
911
                                                                 DragCompleted="RectRightUp_DragCompleted"
921
                                                                 HorizontalAlignment="Left"
921
                                                                 HorizontalAlignment="Left"
922
                                                                 VerticalAlignment="Top"
922
                                                                 VerticalAlignment="Top"
923
                                                                 Background="White"
923
                                                                 Background="White"
924
-                                                                BorderBrush="#2D8CF0"
924
+                                                                BorderBrush="#3f6fff"
925
                                                                 BorderThickness="2"
925
                                                                 BorderThickness="2"
926
                                                                 Cursor="SizeNWSE"
926
                                                                 Cursor="SizeNWSE"
927
                                                                 DragCompleted="RectRightUp_DragCompleted"
927
                                                                 DragCompleted="RectRightUp_DragCompleted"
942
                                                 VerticalAlignment="Top"
942
                                                 VerticalAlignment="Top"
943
                                                 Visibility="Visible" />
943
                                                 Visibility="Visible" />
944
                                             <!--  导入图片  -->
944
                                             <!--  导入图片  -->
945
-                                            <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed" />-->
945
+                                            <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#3f6fff" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed" />-->
946
                                             <InkCanvas
946
                                             <InkCanvas
947
                                                 x:Name="blackboard_canvas"
947
                                                 x:Name="blackboard_canvas"
948
                                                 Grid.Row="0"
948
                                                 Grid.Row="0"
1352
                         x:Name="gridSetUp"
1352
                         x:Name="gridSetUp"
1353
                         VerticalScrollBarVisibility="Auto"
1353
                         VerticalScrollBarVisibility="Auto"
1354
                         Visibility="Collapsed">
1354
                         Visibility="Collapsed">
1355
-                        <Grid>
1355
+                        <Grid Height="650">
1356
                             <Grid Background="#FFFFFF">
1356
                             <Grid Background="#FFFFFF">
1357
                                 <Grid.RowDefinitions>
1357
                                 <Grid.RowDefinitions>
1358
-                                    <RowDefinition Height="200*" />
1358
+                                    <RowDefinition Height="200" />
1359
                                     <RowDefinition Height="160*" />
1359
                                     <RowDefinition Height="160*" />
1360
                                     <RowDefinition Height="100*" />
1360
                                     <RowDefinition Height="100*" />
1361
                                     <RowDefinition Height="200*" />
1361
                                     <RowDefinition Height="200*" />
1365
                                 <!--  更换皮肤 h200  -->
1365
                                 <!--  更换皮肤 h200  -->
1366
                                 <Grid Grid.Row="0" Margin="100,0">
1366
                                 <Grid Grid.Row="0" Margin="100,0">
1367
                                     <Grid.RowDefinitions>
1367
                                     <Grid.RowDefinitions>
1368
-                                        <RowDefinition Height="20*" />
1369
-                                        <RowDefinition Height="20*" />
1370
-                                        <RowDefinition Height="140*" />
1371
-                                        <RowDefinition Height="20*" />
1368
+                                        <RowDefinition Height="20" />
1369
+                                        <RowDefinition Height="20" />
1370
+                                        <RowDefinition Height="140" />
1371
+                                        <RowDefinition Height="20" />
1372
                                     </Grid.RowDefinitions>
1372
                                     </Grid.RowDefinitions>
1373
                                     <Grid Grid.Row="1" Grid.Column="0">
1373
                                     <Grid Grid.Row="1" Grid.Column="0">
1374
                                         <Grid.ColumnDefinitions>
1374
                                         <Grid.ColumnDefinitions>
1692
                                                 Text="文件路径" />
1692
                                                 Text="文件路径" />
1693
                                         </Grid>
1693
                                         </Grid>
1694
                                         <Grid Grid.Row="1" Grid.Column="1">
1694
                                         <Grid Grid.Row="1" Grid.Column="1">
1695
-                                            <Grid Margin="20,17,10,17">
1695
+                                            <Grid>
1696
                                                 <Border
1696
                                                 <Border
1697
+                                                    Height="30"
1698
+                                                    Margin="10,0,0,0"
1697
                                                     BorderBrush="#FFE3E3E3"
1699
                                                     BorderBrush="#FFE3E3E3"
1698
                                                     BorderThickness="1"
1700
                                                     BorderThickness="1"
1699
                                                     CornerRadius="1">
1701
                                                     CornerRadius="1">
1711
                                         </Grid>
1713
                                         </Grid>
1712
                                         <Grid Grid.Row="1" Grid.Column="2">
1714
                                         <Grid Grid.Row="1" Grid.Column="2">
1713
                                             <Grid.ColumnDefinitions>
1715
                                             <Grid.ColumnDefinitions>
1714
-                                                <ColumnDefinition Width="100*" />
1715
-                                                <ColumnDefinition Width="100*" />
1716
-                                                <ColumnDefinition Width="25*" />
1716
+                                                <ColumnDefinition Width="76" />
1717
+                                                <ColumnDefinition Width="76" />
1718
+
1717
                                             </Grid.ColumnDefinitions>
1719
                                             </Grid.ColumnDefinitions>
1718
                                             <!--  浏览按钮  -->
1720
                                             <!--  浏览按钮  -->
1719
                                             <Button
1721
                                             <Button
1720
                                                 x:Name="btnBrowse"
1722
                                                 x:Name="btnBrowse"
1721
                                                 Grid.Column="0"
1723
                                                 Grid.Column="0"
1722
-                                                Margin="10,15"
1724
+                                                Width="66"
1725
+                                                Height="30"
1723
                                                 HorizontalAlignment="Stretch"
1726
                                                 HorizontalAlignment="Stretch"
1724
                                                 VerticalAlignment="Stretch"
1727
                                                 VerticalAlignment="Stretch"
1728
+                                                Background="#3f6fff"
1725
                                                 Click="BtnBrowse_Click"
1729
                                                 Click="BtnBrowse_Click"
1726
                                                 Content="浏览"
1730
                                                 Content="浏览"
1727
                                                 Cursor="Hand"
1731
                                                 Cursor="Hand"
1728
-                                                FontSize="{Binding WordSize16}"
1729
-                                                Foreground="#FFFFFF"
1730
-                                                Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
1731
-                                                <Button.Template>
1732
-                                                    <ControlTemplate TargetType="{x:Type Button}">
1733
-                                                        <Border
1734
-                                                            BorderBrush="{TemplateBinding BorderBrush}"
1735
-                                                            BorderThickness="1"
1736
-                                                            CornerRadius="8">
1737
-                                                            <Border.Background>
1738
-                                                                <Brush>#2D8CF0</Brush>
1739
-                                                            </Border.Background>
1740
-                                                            <ContentPresenter
1741
-                                                                HorizontalAlignment="Center"
1742
-                                                                VerticalAlignment="Center"
1743
-                                                                Content="{TemplateBinding Content}" />
1744
-                                                        </Border>
1745
-                                                    </ControlTemplate>
1746
-                                                </Button.Template>
1747
-                                            </Button>
1732
+                                                FontSize="14"
1733
+                                                Foreground="#FFFFFF" />
1748
                                             <!--  打开按钮  -->
1734
                                             <!--  打开按钮  -->
1749
                                             <Button
1735
                                             <Button
1750
                                                 x:Name="btnOpen"
1736
                                                 x:Name="btnOpen"
1751
                                                 Grid.Column="1"
1737
                                                 Grid.Column="1"
1752
-                                                Margin="10,15"
1738
+                                                Width="66"
1739
+                                                Height="30"
1753
                                                 HorizontalAlignment="Stretch"
1740
                                                 HorizontalAlignment="Stretch"
1754
                                                 VerticalAlignment="Stretch"
1741
                                                 VerticalAlignment="Stretch"
1742
+                                                Background="#3f6fff"
1755
                                                 Click="btnOpen_Click"
1743
                                                 Click="btnOpen_Click"
1756
                                                 Content="打开"
1744
                                                 Content="打开"
1757
                                                 Cursor="Hand"
1745
                                                 Cursor="Hand"
1758
-                                                FontSize="{Binding WordSize16}"
1759
-                                                Foreground="#FFFFFF"
1760
-                                                Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
1761
-                                                <Button.Template>
1762
-                                                    <ControlTemplate TargetType="{x:Type Button}">
1763
-                                                        <Border
1764
-                                                            BorderBrush="{TemplateBinding BorderBrush}"
1765
-                                                            BorderThickness="1"
1766
-                                                            CornerRadius="8">
1767
-                                                            <Border.Background>
1768
-                                                                <Brush>#2D8CF0</Brush>
1769
-                                                            </Border.Background>
1770
-                                                            <ContentPresenter
1771
-                                                                HorizontalAlignment="Center"
1772
-                                                                VerticalAlignment="Center"
1773
-                                                                Content="{TemplateBinding Content}" />
1774
-                                                        </Border>
1775
-                                                    </ControlTemplate>
1776
-                                                </Button.Template>
1777
-                                            </Button>
1746
+                                                FontSize="14"
1747
+                                                Foreground="#FFFFFF" />
1778
                                         </Grid>
1748
                                         </Grid>
1779
                                     </Grid>
1749
                                     </Grid>
1780
                                     <Label
1750
                                     <Label
1871
                                         <!--  保存  -->
1841
                                         <!--  保存  -->
1872
                                         <Button
1842
                                         <Button
1873
                                             x:Name="btnSave"
1843
                                             x:Name="btnSave"
1874
-                                            Margin="5"
1844
+                                            Width="76"
1845
+                                            Height="30"
1875
                                             HorizontalAlignment="Stretch"
1846
                                             HorizontalAlignment="Stretch"
1876
                                             VerticalAlignment="Stretch"
1847
                                             VerticalAlignment="Stretch"
1848
+                                            Background="#3f6fff"
1877
                                             Click="BtnSave_Click"
1849
                                             Click="BtnSave_Click"
1878
                                             Content="保存"
1850
                                             Content="保存"
1879
                                             Cursor="Hand"
1851
                                             Cursor="Hand"
1880
-                                            FontSize="{Binding WordSize18}"
1881
-                                            Foreground="#FFFFFF"
1882
-                                            Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
1883
-                                            <Button.Template>
1884
-                                                <ControlTemplate TargetType="{x:Type Button}">
1885
-                                                    <Border
1886
-                                                        BorderBrush="{TemplateBinding BorderBrush}"
1887
-                                                        BorderThickness="1"
1888
-                                                        CornerRadius="10">
1889
-                                                        <Border.Background>
1890
-                                                            <Brush>#2D8CF0</Brush>
1891
-                                                        </Border.Background>
1892
-                                                        <ContentPresenter
1893
-                                                            HorizontalAlignment="Center"
1894
-                                                            VerticalAlignment="Center"
1895
-                                                            Content="{TemplateBinding Content}" />
1896
-                                                    </Border>
1897
-                                                </ControlTemplate>
1898
-                                            </Button.Template>
1899
-                                        </Button>
1852
+                                            FontSize="14"
1853
+                                            Foreground="#FFFFFF" />
1900
                                     </Grid>
1854
                                     </Grid>
1901
 
1855
 
1902
                                     <Grid
1856
                                     <Grid
1955
                                             VerticalAlignment="Center"
1909
                                             VerticalAlignment="Center"
1956
                                             FontSize="16"
1910
                                             FontSize="16"
1957
                                             Text="视频名称" />
1911
                                             Text="视频名称" />
1958
-                                        <!--<TextBlock
1959
-                    HorizontalAlignment="Center"
1960
-                    VerticalAlignment="Center"
1961
-                    FontSize="15"
1962
-                    Text="视频时长" Foreground="White" />-->
1912
+
1963
                                         <TextBlock
1913
                                         <TextBlock
1964
                                             HorizontalAlignment="Center"
1914
                                             HorizontalAlignment="Center"
1965
                                             VerticalAlignment="Center"
1915
                                             VerticalAlignment="Center"
2145
         <Border
2095
         <Border
2146
             x:Name="GridPrintingTitle"
2096
             x:Name="GridPrintingTitle"
2147
             Grid.Column="1"
2097
             Grid.Column="1"
2148
-            Width="588"
2149
-            Height="210"
2098
+            Width="446"
2099
+            Height="188"
2150
             BorderBrush="#eeeeee"
2100
             BorderBrush="#eeeeee"
2151
             BorderThickness="1"
2101
             BorderThickness="1"
2152
             Visibility="Collapsed">
2102
             Visibility="Collapsed">
2153
             <Grid Background="#ffffff">
2103
             <Grid Background="#ffffff">
2154
                 <Grid.RowDefinitions>
2104
                 <Grid.RowDefinitions>
2155
-                    <RowDefinition Height="46" />
2105
+                    <RowDefinition Height="42" />
2156
                     <RowDefinition Height="*" />
2106
                     <RowDefinition Height="*" />
2157
                     <RowDefinition Height="64" />
2107
                     <RowDefinition Height="64" />
2158
                 </Grid.RowDefinitions>
2108
                 </Grid.RowDefinitions>
2159
-                <Grid Grid.Row="0" Background="#F1F2F8">
2109
+                <Grid Grid.Row="0" Background="#3F6FFF">
2160
                     <TextBlock
2110
                     <TextBlock
2161
                         Margin="10,0,0,0"
2111
                         Margin="10,0,0,0"
2162
                         VerticalAlignment="Center"
2112
                         VerticalAlignment="Center"
2163
                         FontSize="16"
2113
                         FontSize="16"
2164
-                        Foreground="#333333"
2114
+                        Foreground="White"
2165
                         Text="打印机" />
2115
                         Text="打印机" />
2166
 
2116
 
2167
                     <Button
2117
                     <Button
2168
                         Grid.Row="0"
2118
                         Grid.Row="0"
2169
                         Width="46"
2119
                         Width="46"
2170
                         HorizontalAlignment="Right"
2120
                         HorizontalAlignment="Right"
2171
-                        VerticalAlignment="Top"
2121
+                        VerticalAlignment="Stretch"
2172
                         Click="BtnPrintCloseClick"
2122
                         Click="BtnPrintCloseClick"
2173
                         Content="×"
2123
                         Content="×"
2174
                         Cursor="Hand"
2124
                         Cursor="Hand"
2175
                         FontSize="30"
2125
                         FontSize="30"
2176
-                        Foreground="#FF333333"
2177
-                        Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" />
2126
+                        Foreground="White" />
2178
                 </Grid>
2127
                 </Grid>
2179
                 <Grid Grid.Row="1" Height="46">
2128
                 <Grid Grid.Row="1" Height="46">
2180
                     <Grid.ColumnDefinitions>
2129
                     <Grid.ColumnDefinitions>
2188
                         VerticalAlignment="Center"
2137
                         VerticalAlignment="Center"
2189
                         FontSize="16"
2138
                         FontSize="16"
2190
                         Style="{DynamicResource TxbMesColor}"
2139
                         Style="{DynamicResource TxbMesColor}"
2191
-                        Text="打印机" />
2140
+                        Text="打印机" />
2192
 
2141
 
2193
                     <ComboBox
2142
                     <ComboBox
2194
                         x:Name="cmbClass"
2143
                         x:Name="cmbClass"
2195
                         Grid.Column="1"
2144
                         Grid.Column="1"
2196
                         Height="36"
2145
                         Height="36"
2197
-                        Margin="4,0,10,0"
2198
-                        Padding="10,0,0,0"
2146
+                        Margin="10,0,10,0"
2199
                         HorizontalAlignment="Stretch"
2147
                         HorizontalAlignment="Stretch"
2200
                         HorizontalContentAlignment="Center"
2148
                         HorizontalContentAlignment="Center"
2201
                         VerticalContentAlignment="Center"
2149
                         VerticalContentAlignment="Center"
2214
                         <ColumnDefinition Width="30" />
2162
                         <ColumnDefinition Width="30" />
2215
                         <ColumnDefinition Width="Auto" />
2163
                         <ColumnDefinition Width="Auto" />
2216
                         <ColumnDefinition Width="*" />
2164
                         <ColumnDefinition Width="*" />
2217
-                        <ColumnDefinition Width="100" />
2165
+                        <ColumnDefinition Width="86" />
2218
                     </Grid.ColumnDefinitions>
2166
                     </Grid.ColumnDefinitions>
2219
 
2167
 
2220
                     <Image
2168
                     <Image
2236
                         Content="打印说明"
2184
                         Content="打印说明"
2237
                         Cursor="Hand"
2185
                         Cursor="Hand"
2238
                         FontSize="{Binding WordSize14}"
2186
                         FontSize="{Binding WordSize14}"
2239
-                        Foreground="#437AFA"
2240
-                        IsDefault="True"
2241
-                        Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
2242
-                        <Button.Template>
2243
-                            <ControlTemplate TargetType="{x:Type Button}">
2244
-                                <Border
2245
-                                    BorderBrush="{TemplateBinding BorderBrush}"
2246
-                                    BorderThickness="1"
2247
-                                    CornerRadius="8">
2248
-
2249
-                                    <ContentPresenter
2250
-                                        HorizontalAlignment="Center"
2251
-                                        VerticalAlignment="Center"
2252
-                                        Content="{TemplateBinding Content}" />
2253
-                                </Border>
2254
-                            </ControlTemplate>
2255
-                        </Button.Template>
2256
-                    </Button>
2187
+                        Foreground="#3F6FFF"
2188
+                        IsDefault="True" />
2257
                     <Button
2189
                     <Button
2258
                         x:Name="btnPrint_Print"
2190
                         x:Name="btnPrint_Print"
2259
                         Grid.Column="3"
2191
                         Grid.Column="3"
2260
-                        Height="36"
2192
+                        Width="76"
2193
+                        Height="30"
2261
                         Margin="0,0,10,0"
2194
                         Margin="0,0,10,0"
2262
                         HorizontalAlignment="Stretch"
2195
                         HorizontalAlignment="Stretch"
2263
                         VerticalAlignment="Stretch"
2196
                         VerticalAlignment="Stretch"
2197
+                        Background="#3F6FFF"
2264
                         Click="BtnPrint_Print_Click"
2198
                         Click="BtnPrint_Print_Click"
2265
                         Content="打印"
2199
                         Content="打印"
2266
                         Cursor="Hand"
2200
                         Cursor="Hand"
2267
                         FontSize="{Binding WordSize14}"
2201
                         FontSize="{Binding WordSize14}"
2268
                         Foreground="White"
2202
                         Foreground="White"
2269
-                        IsDefault="True"
2270
-                        Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
2271
-                        <Button.Template>
2272
-                            <ControlTemplate TargetType="{x:Type Button}">
2273
-                                <Border
2274
-                                    BorderBrush="{TemplateBinding Control.BorderBrush}"
2275
-                                    BorderThickness="1"
2276
-                                    CornerRadius="8">
2277
-                                    <Border.Background>#2E8CF0</Border.Background>
2278
-                                    <ContentPresenter
2279
-                                        HorizontalAlignment="Center"
2280
-                                        VerticalAlignment="Center"
2281
-                                        Content="{TemplateBinding ContentControl.Content}" />
2282
-                                </Border>
2283
-                            </ControlTemplate>
2284
-                        </Button.Template>
2285
-                    </Button>
2203
+                        IsDefault="True" />
2286
                 </Grid>
2204
                 </Grid>
2287
 
2205
 
2288
             </Grid>
2206
             </Grid>

+ 120
- 154
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

2181
         /// <param name="e"></param>
2181
         /// <param name="e"></param>
2182
         private void BtnUpload_Click(object sender, RoutedEventArgs e)
2182
         private void BtnUpload_Click(object sender, RoutedEventArgs e)
2183
         {
2183
         {
2184
-            //if (gridUpload.Visibility == Visibility.Visible)
2185
-            //{
2186
-            //    gridUpload.Visibility = Visibility.Collapsed;
2187
-            //    GridMain.Visibility = Visibility.Visible;
2188
-            //    //ImgRecord.Visibility = Visibility.Visible;//上传结束时可录制
2189
-            //    //ImgRecordTwo.Visibility = Visibility.Collapsed;//上传结束时可录制
2190
-            //    //BtnRecord.IsEnabled = true;//设置结束时可录制
2191
-            //    if (APP.pageData.pagenum > 0)
2192
-            //    {
2193
-            //        gridPage.Visibility = Visibility.Visible;
2194
-            //    }
2195
-            //    DataContext = APP.pageData;
2196
-            //}
2197
-            //else
2198
-            //{
2199
-            //    gridPage.Visibility = Visibility.Collapsed;
2200
-            //    gridUpload.Visibility = Visibility.Visible;
2201
-            //    GridMain.Visibility = Visibility.Collapsed;
2202
-            //    //ImgRecord.Visibility = Visibility.Collapsed;//上传时不可录制
2203
-            //    //ImgRecordTwo.Visibility = Visibility.Visible;//上传时不可录制
2204
-            //    //BtnRecord.IsEnabled = false;//上传时不可录制
2205
-            //    InitializeUpload();
2206
-            //}
2207
-
2208
             if (GridMyVideo.Visibility == Visibility.Visible)
2184
             if (GridMyVideo.Visibility == Visibility.Visible)
2209
             {
2185
             {
2210
                 GridMyVideo.Visibility = Visibility.Collapsed;
2186
                 GridMyVideo.Visibility = Visibility.Collapsed;
2211
                 GridMain.Visibility = Visibility.Visible;
2187
                 GridMain.Visibility = Visibility.Visible;
2212
                 GridM.IsEnabled = true;
2188
                 GridM.IsEnabled = true;
2213
                 GridRecordingTitle.Visibility = Visibility.Visible;
2189
                 GridRecordingTitle.Visibility = Visibility.Visible;
2214
-                //if (APP.pageData.pagenum > 0)
2215
-                //{
2216
-                //    GridPage.Visibility = Visibility.Visible;
2217
-                //}
2218
-                //DataContext = APP.pageData;
2190
+               
2219
             }
2191
             }
2220
             else
2192
             else
2221
             {
2193
             {
2223
                 GridMyVideo.Visibility = Visibility.Visible;
2195
                 GridMyVideo.Visibility = Visibility.Visible;
2224
                 LoadUploadInitData();
2196
                 LoadUploadInitData();
2225
             }
2197
             }
2226
-            //btnStop.IsEnabled = true;//停止录制按钮可点击
2198
+     
2227
         }
2199
         }
2228
 
2200
 
2229
         /// <summary>
2201
         /// <summary>
2404
         /// <param name="e"></param>
2376
         /// <param name="e"></param>
2405
         private void BtnUploads_Click(object sender, RoutedEventArgs e)
2377
         private void BtnUploads_Click(object sender, RoutedEventArgs e)
2406
         {
2378
         {
2379
+            Console.WriteLine("Subscript:" + Subscript);
2407
             if (APP.IsLoginType == false)
2380
             if (APP.IsLoginType == false)
2408
             {
2381
             {
2409
                 Login();
2382
                 Login();
2410
                 return;
2383
                 return;
2411
             }
2384
             }
2385
+
2386
+         
2412
             pageData.menuList[Subscript].IsEnabled = false;
2387
             pageData.menuList[Subscript].IsEnabled = false;
2413
             List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnUpload");
2388
             List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnUpload");
2414
             for (int i = 0; i < buttons.Count; i++)
2389
             for (int i = 0; i < buttons.Count; i++)
3084
         /// <param name="e"></param>
3059
         /// <param name="e"></param>
3085
         private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
3060
         private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
3086
         {
3061
         {
3087
-            bool microphoneGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.microphone);
3088
-            bool loudspeakerGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.loudspeaker);
3089
-
3090
-            if (!microphoneGood) {
3091
-                MessageBox.Show("麦克风不可用");
3092
-                return;
3093
-            }
3094
 
3062
 
3095
-            if (!loudspeakerGood)
3063
+            ThreadPool.QueueUserWorkItem(o =>
3096
             {
3064
             {
3097
-                MessageBox.Show("扬声器不可用");
3098
-                return;
3099
-            }
3100
-
3101
-            Record();
3102
-            
3065
+                bool microphoneGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.microphone);
3066
+                bool loudspeakerGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.loudspeaker);
3103
 
3067
 
3104
-            k_hook.Stop();
3105
-            if (APP.W_ScreenRecordingToolbarWindow == null)
3106
-            {
3107
-                APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
3068
+                Dispatcher.Invoke(() =>
3108
                 {
3069
                 {
3109
-                    Topmost = true
3110
-                };
3111
-                APP.W_ScreenRecordingToolbarWindow.Initialize();
3112
-            }
3113
-            else
3114
-            {
3115
-                APP.W_ScreenRecordingToolbarWindow.Initialize();
3116
-            }
3117
-            APP.W_ScreenRecordingToolbarWindow.Click_stopRecordingScreen += W_ScreenRecordingToolbarWindow_Click_stopRecordingScreen;
3118
-            //显示在右下角
3119
-            APP.W_ScreenRecordingToolbarWindow.WindowStartupLocation = WindowStartupLocation.Manual;
3120
-            Graphics graphics = Graphics.FromHwnd(IntPtr.Zero);
3121
-            float DIP = graphics.DpiX;
3122
-            float DIPY = graphics.DpiY;
3123
-            APP.W_ScreenRecordingToolbarWindow.Left = PrimaryScreen.WorkingArea.Width / (DIP / 96) - APP.W_ScreenRecordingToolbarWindow.Width;
3124
-            APP.W_ScreenRecordingToolbarWindow.Top = PrimaryScreen.WorkingArea.Height / (DIP / 96) - APP.W_ScreenRecordingToolbarWindow.Height - 100;
3125
-            APP.W_ScreenRecordingToolbarWindow.Topmost = true;
3126
-            APP.W_ScreenRecordingToolbarWindow.Show();
3127
-            Hide();
3070
+                    if (!microphoneGood)
3071
+                    {
3072
+                        MessageWindow.Show("麦克风不可用");
3073
+                        return;
3074
+                    }
3075
+
3076
+                    if (!loudspeakerGood)
3077
+                    {
3078
+                        MessageWindow.Show("扬声器不可用");
3079
+                        return;
3080
+                    }
3081
+
3082
+                    Record();
3083
+
3084
+
3085
+                    k_hook.Stop();
3086
+                    if (APP.W_ScreenRecordingToolbarWindow == null)
3087
+                    {
3088
+                        APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
3089
+                        {
3090
+                            Topmost = true
3091
+                        };
3092
+                        APP.W_ScreenRecordingToolbarWindow.Initialize();
3093
+                    }
3094
+                    else
3095
+                    {
3096
+                        APP.W_ScreenRecordingToolbarWindow.Initialize();
3097
+                    }
3098
+                    APP.W_ScreenRecordingToolbarWindow.Click_stopRecordingScreen += W_ScreenRecordingToolbarWindow_Click_stopRecordingScreen;
3099
+                    //显示在右下角
3100
+                    APP.W_ScreenRecordingToolbarWindow.WindowStartupLocation = WindowStartupLocation.Manual;
3101
+                    Graphics graphics = Graphics.FromHwnd(IntPtr.Zero);
3102
+                    float DIP = graphics.DpiX;
3103
+                    float DIPY = graphics.DpiY;
3104
+                    APP.W_ScreenRecordingToolbarWindow.Left = PrimaryScreen.WorkingArea.Width / (DIP / 96) - APP.W_ScreenRecordingToolbarWindow.Width;
3105
+                    APP.W_ScreenRecordingToolbarWindow.Top = PrimaryScreen.WorkingArea.Height / (DIP / 96) - APP.W_ScreenRecordingToolbarWindow.Height - 100;
3106
+                    APP.W_ScreenRecordingToolbarWindow.Topmost = true;
3107
+                    APP.W_ScreenRecordingToolbarWindow.Show();
3108
+                    Hide();
3109
+                });
3110
+            });
3111
+
3112
+
3113
+
3128
         }
3114
         }
3129
 
3115
 
3130
         /// <summary>
3116
         /// <summary>
3223
                 IsPressButton = true;
3209
                 IsPressButton = true;
3224
                 new Thread(new ThreadStart(new Action(() =>
3210
                 new Thread(new ThreadStart(new Action(() =>
3225
                 {
3211
                 {
3226
-                    Thread.Sleep(1000);
3212
+                    Thread.Sleep(500);
3227
                     IsPressButton = false;
3213
                     IsPressButton = false;
3228
                 }))).Start();
3214
                 }))).Start();
3229
             }
3215
             }
3230
 
3216
 
3231
             #endregion 防止连击
3217
             #endregion 防止连击
3232
 
3218
 
3233
-            bool microphoneGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.microphone);
3234
 
3219
 
3235
-            if (!microphoneGood)
3236
-            {
3237
-                MessageBox.Show("麦克风不可用");
3238
-                return;
3239
-            }
3240
-
3241
-            Record();
3242
-
3243
-            if (APP.PageContextData.currpage > 0)
3244
-            {
3245
-                blackboard_canvas.Visibility = Visibility.Visible;
3246
-            }
3247
-            else
3220
+            if (APP.PageContextData.currpage == 0)
3248
             {
3221
             {
3249
                 MessageWindow.Show("请先导入文档或截图!");
3222
                 MessageWindow.Show("请先导入文档或截图!");
3250
                 return;
3223
                 return;
3251
             }
3224
             }
3252
-            if (RectImgBorder.Visibility != Visibility.Hidden)
3253
-            {
3254
-                HideAngleBorder();
3255
-            }
3256
-            //btnStop.IsEnabled = true;//停止录制按钮可点击
3225
+
3257
             if (RecordType == 0)
3226
             if (RecordType == 0)
3258
             {
3227
             {
3259
-                //停止中开始录制
3260
-                RecordType = 3;
3261
 
3228
 
3262
-                #region 检测麦克风扬声器是否可用
3229
+                ThreadPool.QueueUserWorkItem(o =>
3230
+                {
3263
 
3231
 
3264
-                //string AudioPath = FileToolsCommon.GetFileAbsolutePath("/temp/audio/");
3265
-                //FileToolsCommon.CreateDirectory(AudioPath);
3266
-                //string audioMicrophonePath = AudioPath + "adoM" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".m";
3267
-                //try
3268
-                //{
3269
-                //    FileToolsCommon.DeleteFile(audioMicrophonePath);
3270
-                //}
3271
-                //catch (Exception)
3272
-                //{
3273
-                //}
3274
-                ////麦克风
3275
-                //if (APP.FFmpeg.StartRecordAudio(audioMicrophonePath))
3276
-                //{
3277
-                //    APP.FFmpeg.StopRecordAudio(1);
3278
-                //}
3279
-                //else
3280
-                //{
3281
-                //    //无法录制麦克风
3282
-                //    MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制麦克风,是否继续?", "消息提示", MessageBoxButton.OKCancel);
3283
-                //    if (Res == MessageBoxResult.Cancel)
3284
-                //    {
3285
-                //        return;
3286
-                //    }
3287
-                //}
3232
+                    bool microphoneGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.microphone);
3288
 
3233
 
3289
-                #endregion 检测麦克风扬声器是否可用
3234
+                    Dispatcher.Invoke(() =>
3235
+                    {
3290
 
3236
 
3291
-                BtnPrint.IsEnabled = false;
3292
-                BtnScreenshot.IsEnabled = false;
3293
-                BtnImport.IsEnabled = false;
3294
-                BtnScreenRecording.IsEnabled = false;
3295
-                BtnUpload.IsEnabled = false;
3296
-                BtnSetUp.IsEnabled = false;
3297
-                BtnDevice.IsEnabled = false;
3237
+                        if (!microphoneGood)
3238
+                        {
3239
+                            MessageWindow.Show("麦克风不可用");
3240
+                            return;
3241
+                        }
3298
 
3242
 
3299
-                BtnLoginType.IsEnabled = false;
3300
-                blackboard_canvas.Visibility = Visibility.Visible;
3243
+                        //停止中开始录制
3244
+                        RecordType = 3;
3245
+                        blackboard_canvas.Visibility = Visibility.Visible;
3246
+                        if (RectImgBorder.Visibility != Visibility.Hidden)
3247
+                        {
3248
+                            HideAngleBorder();
3249
+                        }
3301
 
3250
 
3302
-                TxbType.Text = "准备录制";
3303
-                BtnRecord.Visibility = Visibility.Collapsed;
3304
-                BtnRecordSuspend.Visibility = Visibility.Visible;
3305
-                BtnRecord.IsEnabled = true;
3306
-                BtnStop.IsEnabled = true;
3251
+                        Record();
3307
 
3252
 
3308
-                #region 录像倒计时
3253
+                        BtnPrint.IsEnabled = false;
3254
+                        BtnScreenshot.IsEnabled = false;
3255
+                        BtnImport.IsEnabled = false;
3256
+                        BtnScreenRecording.IsEnabled = false;
3257
+                        BtnUpload.IsEnabled = false;
3258
+                        BtnSetUp.IsEnabled = false;
3259
+                        BtnDevice.IsEnabled = false;
3309
 
3260
 
3310
-                if (APP.W_CountdownWindow == null)
3311
-                {
3312
-                    APP.W_CountdownWindow = new CountdownWindow();
3313
-                    APP.W_CountdownWindow.Initialize();
3314
-                }
3315
-                else
3316
-                {
3317
-                    APP.W_CountdownWindow.Initialize();
3318
-                }
3319
-                APP.W_CountdownWindow.Show();
3261
+                        BtnLoginType.IsEnabled = false;
3262
+                        blackboard_canvas.Visibility = Visibility.Visible;
3320
 
3263
 
3321
-                #endregion 录像倒计时
3264
+                        TxbType.Text = "准备录制";
3265
+                        BtnRecord.Visibility = Visibility.Collapsed;
3266
+                        BtnRecordSuspend.Visibility = Visibility.Visible;
3267
+                        BtnRecord.IsEnabled = true;
3268
+                        BtnStop.IsEnabled = true;
3322
 
3269
 
3323
-                new Thread(new ThreadStart(new Action(() =>
3324
-                {
3325
-                    Thread.Sleep(3000);
3270
+                        #region 录像倒计时
3326
 
3271
 
3327
-                    Dispatcher.Invoke(() =>
3328
-                    {
3329
-                        TxbType.Text = "正在录制";
3272
+                        if (APP.W_CountdownWindow == null)
3273
+                        {
3274
+                            APP.W_CountdownWindow = new CountdownWindow();
3275
+                            APP.W_CountdownWindow.Initialize();
3276
+                        }
3277
+                        else
3278
+                        {
3279
+                            APP.W_CountdownWindow.Initialize();
3280
+                        }
3281
+                        APP.W_CountdownWindow.Show();
3282
+
3283
+                        #endregion 录像倒计时
3284
+
3285
+                        new Thread(new ThreadStart(new Action(() =>
3286
+                        {
3287
+                            Thread.Sleep(3000);
3288
+
3289
+                            Dispatcher.Invoke(() =>
3290
+                            {
3291
+                                TxbType.Text = "正在录制";
3292
+                            });
3293
+                            RecordType = 1;
3294
+                            StartRecord();
3295
+                        }))).Start();
3330
                     });
3296
                     });
3331
-                    RecordType = 1;
3332
-                    StartRecord();
3333
-                }))).Start();
3297
+
3298
+                });
3299
+
3300
+
3334
             }
3301
             }
3335
             else if (RecordType == 1)
3302
             else if (RecordType == 1)
3336
             {
3303
             {
3346
             if (RecordType == 0)
3313
             if (RecordType == 0)
3347
             {
3314
             {
3348
                 TxbType.Text = "准备录制";
3315
                 TxbType.Text = "准备录制";
3349
-                BtnRecord.Visibility = Visibility.Collapsed;
3350
-                BtnRecordSuspend.Visibility = Visibility.Visible;
3316
+                BtnRecord.Visibility = Visibility.Visible;
3317
+                BtnRecordSuspend.Visibility = Visibility.Collapsed;
3351
                 BtnRecord.IsEnabled = true;
3318
                 BtnRecord.IsEnabled = true;
3352
-                BtnStop.IsEnabled = true;
3319
+                BtnStop.IsEnabled = false;
3353
             }
3320
             }
3354
             else if (RecordType == 1)
3321
             else if (RecordType == 1)
3355
             {
3322
             {
3356
                 TxbType.Text = "录制中";
3323
                 TxbType.Text = "录制中";
3357
-                BtnRecord.Content = "暂停录制";
3358
                 BtnRecord.Visibility = Visibility.Collapsed;
3324
                 BtnRecord.Visibility = Visibility.Collapsed;
3359
                 BtnRecordSuspend.Visibility = Visibility.Visible;
3325
                 BtnRecordSuspend.Visibility = Visibility.Visible;
3360
             }
3326
             }

+ 21
- 3
XHWK.WKTool/XHWK.WKTool.csproj View File

334
     <Compile Include="VideoClipWindow.xaml.cs">
334
     <Compile Include="VideoClipWindow.xaml.cs">
335
       <DependentUpon>VideoClipWindow.xaml</DependentUpon>
335
       <DependentUpon>VideoClipWindow.xaml</DependentUpon>
336
     </Compile>
336
     </Compile>
337
+    <Compile Include="Welcome.xaml.cs">
338
+      <DependentUpon>Welcome.xaml</DependentUpon>
339
+    </Compile>
337
     <Compile Include="XHMicroLessonSystemWindow.xaml.cs">
340
     <Compile Include="XHMicroLessonSystemWindow.xaml.cs">
338
       <DependentUpon>XHMicroLessonSystemWindow.xaml</DependentUpon>
341
       <DependentUpon>XHMicroLessonSystemWindow.xaml</DependentUpon>
339
     </Compile>
342
     </Compile>
340
-    <Compile Include="App.cs" />
341
     <Compile Include="CreateAMicroLessonWindow.xaml.cs">
343
     <Compile Include="CreateAMicroLessonWindow.xaml.cs">
342
       <DependentUpon>CreateAMicroLessonWindow.xaml</DependentUpon>
344
       <DependentUpon>CreateAMicroLessonWindow.xaml</DependentUpon>
343
       <SubType>Code</SubType>
345
       <SubType>Code</SubType>
344
     </Compile>
346
     </Compile>
345
-    <Page Include="App.xaml">
347
+    <ApplicationDefinition Include="App.xaml">
346
       <SubType>Designer</SubType>
348
       <SubType>Designer</SubType>
347
       <Generator>XamlIntelliSenseFileGenerator</Generator>
349
       <Generator>XamlIntelliSenseFileGenerator</Generator>
348
-    </Page>
350
+    </ApplicationDefinition>
349
     <Page Include="AppUpdateWin.xaml">
351
     <Page Include="AppUpdateWin.xaml">
350
       <Generator>MSBuild:Compile</Generator>
352
       <Generator>MSBuild:Compile</Generator>
351
       <SubType>Designer</SubType>
353
       <SubType>Designer</SubType>
398
       <Generator>MSBuild:Compile</Generator>
400
       <Generator>MSBuild:Compile</Generator>
399
       <SubType>Designer</SubType>
401
       <SubType>Designer</SubType>
400
     </Page>
402
     </Page>
403
+    <Page Include="Resources\OverwrideDefaultControlStyles.xaml">
404
+      <SubType>Designer</SubType>
405
+      <Generator>MSBuild:Compile</Generator>
406
+    </Page>
407
+    <Page Include="Resources\StyleButton.xaml">
408
+      <SubType>Designer</SubType>
409
+      <Generator>MSBuild:Compile</Generator>
410
+    </Page>
411
+    <Page Include="Resources\StyleScrolllview.xaml">
412
+      <SubType>Designer</SubType>
413
+      <Generator>MSBuild:Compile</Generator>
414
+    </Page>
401
     <Page Include="Skin\SkinDictionary_TechnologyBlue.xaml">
415
     <Page Include="Skin\SkinDictionary_TechnologyBlue.xaml">
402
       <Generator>MSBuild:Compile</Generator>
416
       <Generator>MSBuild:Compile</Generator>
403
       <SubType>Designer</SubType>
417
       <SubType>Designer</SubType>
426
       <SubType>Designer</SubType>
440
       <SubType>Designer</SubType>
427
       <Generator>MSBuild:Compile</Generator>
441
       <Generator>MSBuild:Compile</Generator>
428
     </Page>
442
     </Page>
443
+    <Page Include="Welcome.xaml">
444
+      <SubType>Designer</SubType>
445
+      <Generator>MSBuild:Compile</Generator>
446
+    </Page>
429
     <Page Include="XHMicroLessonSystemWindow.xaml">
447
     <Page Include="XHMicroLessonSystemWindow.xaml">
430
       <Generator>MSBuild:Compile</Generator>
448
       <Generator>MSBuild:Compile</Generator>
431
       <SubType>Designer</SubType>
449
       <SubType>Designer</SubType>

+ 1
- 1
XHWK.WKTool/XHWK.WKTool.csproj.user View File

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

+ 1
- 1
打包脚本/Inno Setup星火微课.iss View File

3
 
3
 
4
 #define MyAppName "星火微课"  
4
 #define MyAppName "星火微课"  
5
 #define MyAppDir "xhwk"
5
 #define MyAppDir "xhwk"
6
-#define MyAppVersion "2.6.7"
6
+#define MyAppVersion "2.6.8"
7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
8
 #define MyAppURL "http://www.xhkjedu.com/"
8
 #define MyAppURL "http://www.xhkjedu.com/"
9
 #define MySourcePath "D:\Project\C#\xhwkclient\XHWK.WKTool\bin\x86\Debug\"
9
 #define MySourcePath "D:\Project\C#\xhwkclient\XHWK.WKTool\bin\x86\Debug\"

+ 15
- 0
样式.txt View File

1
+主色调 
2
+#3F6FFF
3
+
4
+按钮小
5
+圆角6
6
+宽度 76 高度30
7
+字体 14
8
+
9
+弹窗
10
+顶部42
11
+字体 16
12
+颜色 #333333
13
+宽度 446
14
+高度 188
15
+

Loading…
Cancel
Save