Compare commits

..

111 Commits

Author SHA1 Message Date
CJK_mkp b9d6ac3047 Merge pull request #32 from awesome-iwb/beta
ICC CE 1.6.4(ICC CE Beta1.6.7)
2025-06-18 18:20:56 +08:00
CJK_mkp e7c723de46 fix:进程崩溃判定错误 improve:重新配置了自动更新 2025-06-18 18:16:48 +08:00
CJK_mkp 10629b253c 修复自动更新 2025-06-18 16:12:47 +08:00
CJK_mkp dace6ad486 修改自动更新 2025-06-18 16:08:26 +08:00
CJK_mkp 4c70f35714 Merge pull request #31 from awesome-iwb/beta
ICC CE 1.6.3 (ICC CE Beta1.6.6)
2025-06-18 15:44:17 +08:00
CJK_mkp 7b4d13c16f update:自动更新服务 2025-06-18 15:40:07 +08:00
CJK_mkp 0e561ad24e 修改版本 2025-06-18 15:32:45 +08:00
CJK_mkp d09d8223c9 更新版本号 2025-06-18 15:12:44 +08:00
CJK_mkp 6dafde9735 improve:直线拉直灵敏度设置 2025-06-18 15:10:33 +08:00
CJK_mkp a0f84bf017 Merge pull request #30 from awesome-iwb/beta
ICC CE 1.6.2 (ICC CE Beta  1.6.4)
2025-06-18 13:42:52 +08:00
CJK_mkp 7049c53889 fix:墨迹纠正 2025-06-18 13:37:52 +08:00
CJK_mkp 7750fa799d fix:墨迹纠正 2025-06-18 13:24:50 +08:00
CJK_mkp 5f828736de fix:issue #13 #23 add:设置页面侧边栏 2025-06-18 09:08:38 +08:00
CJK_mkp 869c8ce31b Merge pull request #29 from awesome-iwb/beta
ICC CE 1.6.1 (Beta 1.6.1)
2025-06-17 22:38:48 +08:00
CJK_mkp 0b7b55224f add:直线拉直与端点吸附 2025-06-17 22:37:37 +08:00
CJK_mkp 2a23be44f2 add:有关触屏体验改进的功能 2025-06-17 22:05:22 +08:00
CJK_mkp fa0cbb4d3f fix:修复日志重复输出 2025-06-17 21:45:50 +08:00
CJK_mkp 38bc4decf6 fix:issue #13 #23 2025-06-17 21:24:47 +08:00
CJK_mkp b5ec6e0d79 Merge pull request #28 from awesome-iwb/beta
ICC CE 1.5.2 (Beta 1.5.14)
2025-06-17 19:22:32 +08:00
CJK_mkp 82486c707d fix:issue #5 2025-06-17 19:15:22 +08:00
CJK_mkp 5ff437bed5 improve:PPT联动 2025-06-17 19:09:31 +08:00
CJK_mkp 2f7e0b85c0 fix:issue #3 2025-06-17 19:00:47 +08:00
CJK_mkp c9548af008 fix:issue #3 2025-06-17 18:52:34 +08:00
CJK_mkp b20e4a041f fix:issue #13 #23 2025-06-17 18:45:55 +08:00
CJK_mkp 87f64ccc81 improve:对随机抽功能增加禁用开关 2025-06-17 18:21:14 +08:00
CJK_mkp 58028ea95c fix:issue #13 #23 2025-06-17 13:20:06 +08:00
CJK_mkp 35fa062cc3 improve:尝试使用注册表方法禁用受保护的视图功能(不确定可用性) 2025-06-13 13:44:50 +08:00
CJK_mkp 9de6555519 fix:issue #13 #23 2025-06-13 11:43:50 +08:00
CJK_mkp a9baf47823 fix:修复崩溃自动重启的误判 2025-06-13 09:19:44 +08:00
CJK_mkp a9b64d2899 fix:issue #3 2025-06-12 22:48:25 +08:00
CJK_mkp 4d9fa754e8 Merge pull request #26 from awesome-iwb/beta
ICC CE 1.5.1 (Bate1.5.5)
2025-06-12 19:19:18 +08:00
CJK_mkp 862ac27212 fix:issue #13 #23 2025-06-12 19:14:58 +08:00
CJK_mkp 4ada8b05e7 fix:只读状态下翻页控件无法使用 2025-06-12 18:55:50 +08:00
CJK_mkp d250e83df9 fix:只读状态下无法识别的问题 2025-06-12 14:26:01 +08:00
CJK_mkp 8e8f4256ac fix:issue #13 #23 2025-06-12 11:23:59 +08:00
CJK_mkp d6502251e1 fix:issue #13 #23 2025-06-12 11:21:45 +08:00
CJK_mkp c3159c61ee improve:优化进程崩溃检测机制 2025-06-12 10:34:29 +08:00
CJK_mkp 0e5b31a8e4 add:崩溃后操作 2025-06-12 10:13:47 +08:00
CJK_mkp ad18277223 Merge pull request #25 from awesome-iwb/beta
I CC CE 1.4.8 (Beta1.4.17)
2025-06-12 09:42:18 +08:00
CJK_mkp 661fd21626 fix:issue #5 2025-06-11 21:58:40 +08:00
CJK_mkp d8fd231476 fix:issue #5 2025-06-11 21:27:31 +08:00
CJK_mkp 8d611a22a2 Update README.md 2025-06-11 15:27:59 +08:00
CJK_mkp 6cb8b188ec fix:issue #13 #23 2025-06-11 15:09:34 +08:00
CJK_mkp d1d0e00959 fix:issue #13 #23 2025-06-11 14:57:51 +08:00
CJK_mkp cbc317795e fix:issue #23 #13 2025-06-11 14:31:20 +08:00
CJK_mkp ab88c34abc fix:issue #23 2025-06-11 14:03:04 +08:00
CJK_mkp 18b0556f7a delete:无用的using 2025-06-11 11:23:05 +08:00
CJK_mkp 7bea23005d improve:issue #24 2025-06-11 10:47:04 +08:00
CJK_mkp b46cbcc15f fix:issue #23 2025-06-11 10:26:19 +08:00
CJK_mkp 71ad15ce25 Merge pull request #22 from awesome-iwb/beta
ICC CE 1.4.7 (Beta1.4.14)
2025-06-10 22:15:45 +08:00
CJK_mkp 5a3101a182 修改版本号 2025-06-10 22:10:27 +08:00
CJK_mkp eba888082a Revert "try to fix:issue #3"
This reverts commit 43beffeadd.
2025-06-10 18:00:31 +08:00
CJK_mkp 43beffeadd try to fix:issue #3 2025-06-10 17:50:31 +08:00
CJK_mkp 3645906067 try to fix:issue #13 2025-06-10 17:33:46 +08:00
CJK_mkp 0206273200 improve:Ci点名功能 2025-06-10 17:21:26 +08:00
CJK_mkp 0a50d15da0 fix:PPT放映模式下进退白板翻页按钮不显示 2025-06-10 17:10:53 +08:00
CJK_mkp 85d98c0b70 improve:改进了日志输出 2025-06-10 16:48:45 +08:00
CJK_mkp 6a02bf01d5 ICC CE 1.4.6 (Beta 1.4.11)
ICC CE 1.4.6
2025-06-10 14:32:53 +08:00
CJK_mkp 9b1d9c117e add:调用Classisland点名功能
在点名中增加了调用Ci的点名选项
2025-06-10 14:19:01 +08:00
CJK_mkp f2b32b40a4 fix:issue #5
修改检测逻辑,优化进程管理
2025-06-10 11:09:51 +08:00
CJK_mkp 457e9e5e74 fix:issue #11 2025-06-09 11:49:42 +08:00
CJK_mkp 4b4aaae001 improve:墨迹保存 2025-06-09 08:41:23 +08:00
CJK_mkp 11369aedf8 improve:墨迹保存 2025-06-09 07:40:00 +08:00
CJK_mkp cc38e8f148 improve:墨迹保存 2025-06-09 00:16:15 +08:00
CJK_mkp b0c6bbb8f7 improve:墨迹保存 2025-06-09 00:09:24 +08:00
CJK_mkp 5399c9c7b9 improve:墨迹保存 2025-06-09 00:05:28 +08:00
CJK_mkp fe58c5c4d1 improve:墨迹保存 2025-06-09 00:02:27 +08:00
CJK_mkp a42aa75308 improve:墨迹保存 2025-06-08 23:58:20 +08:00
CJK_mkp a3b61d984d improve:墨迹保存 2025-06-08 23:47:27 +08:00
CJK_mkp c2f2f3a9af fix:issue #18 2025-06-08 23:13:30 +08:00
CJK_mkp 4a626ec245 Merge pull request #19 from awesome-iwb/beta
ICC CE 1.4.5
2025-06-08 19:47:20 +08:00
CJK_mkp 57317be766 Update MW_PPT.cs 2025-06-08 19:37:15 +08:00
Hydrogen 6abd433f13 Merge pull request #17 from awesome-iwb/beta 2025-06-08 13:45:03 +08:00
Hydrogen ad049c517d 修改透明版图标
上传由Hydrogen设计的新版透明图标(待测试)
2025-06-08 13:34:58 +08:00
Hydrogen 24332f819e 删除透明版图标,为上传新透明图标做准备 2025-06-08 13:33:26 +08:00
CJK_mkp 1d3b573425 Merge pull request #16 from awesome-iwb/beta
ICC CE 1.4.4
2025-06-08 11:16:49 +08:00
CJK_mkp 8e7a377f66 Merge pull request #15 from Hydro11451/beta
修复智绘教查杀并修改部分文字
2025-06-08 11:03:27 +08:00
Hydrogen dbe0818f35 修复智绘教查杀并修改部分文字 2025-06-08 10:12:35 +08:00
CJK_mkp 5a4a97d4be Merge pull request #10 from CJKmkp/beta
ICC CE 1.4.3
2025-06-07 16:19:15 +08:00
CJK_mkp 25f83e1df0 Merge pull request #8 from Hydro11451/beta
修正“特别鸣谢”的一些内容
2025-06-07 16:04:36 +08:00
Hydrogen 5d90d2d1b6 Merge branch 'CJKmkp:beta' into beta 2025-06-07 14:22:10 +08:00
Hydrogen f14bf6da16 修正“特别鸣谢”的一些内容 2025-06-07 14:20:58 +08:00
CJK_mkp 680779530e Merge branch 'beta' of https://github.com/CJKmkp/ICC-CE into beta 2025-06-07 14:20:17 +08:00
CJK_mkp 7d6358c771 Update icc-transparent-dark-small.png 2025-06-07 14:19:59 +08:00
CJK_mkp 6255b0926a Merge pull request #7 from Hydro11451/beta
更改浮动工具栏图标设置项相关文字
2025-06-07 14:05:43 +08:00
Hydrogen ace6f57e3f 更改浮动工具栏图标设置项相关文字 2025-06-07 13:40:07 +08:00
CJK_mkp 6a7951e8a4 修改图标 2025-06-07 10:50:21 +08:00
CJK_mkp 234277fee8 Revert "修改图标"
This reverts commit f5bac0bed9.
2025-06-07 10:44:28 +08:00
CJK_mkp f5bac0bed9 修改图标 2025-06-07 10:38:00 +08:00
CJK_mkp 05a5e1a0f1 Merge branch 'beta' of https://github.com/CJKmkp/ICC-CE into beta 2025-06-07 08:41:07 +08:00
CJK_mkp 2ed034ba27 Fix:issue #5 2025-06-07 08:41:01 +08:00
CJK_mkp af3663d20e Merge pull request #6 from CJKmkp/main
同步分支
2025-06-06 23:05:24 +08:00
CJK_mkp 247d15e0c8 Create CODE_OF_CONDUCT.md 2025-06-06 23:03:41 +08:00
CJK_mkp f87a2a12ad Merge pull request #4 from CJKmkp/beta
ICC CE 1.4.2
2025-06-06 22:17:20 +08:00
CJK_mkp e6ddefce3b Update README.md 2025-06-06 22:14:39 +08:00
CJK_mkp fd3a7d44eb Update README.md 2025-06-06 21:58:06 +08:00
CJK_mkp 65e2f42e61 Update AutoUpdateHelper.cs 2025-06-06 18:23:58 +08:00
CJK_mkp 96ecb44249 Delete .github/workflows/MSIX.yml 2025-06-06 18:22:13 +08:00
CJK_mkp 37f1d93f68 Create MSIX.yml 2025-06-06 18:16:39 +08:00
CJK_mkp 09753e5db2 Update README.md 2025-06-06 17:43:32 +08:00
CJK_mkp dd4363c53b Update README.md 2025-06-06 17:39:24 +08:00
CJK_mkp 468236cc60 Update README.md 2025-06-06 17:39:01 +08:00
CJK_mkp 08edcd3256 Update README.md 2025-06-06 17:38:37 +08:00
CJK_mkp 684a89b99e Update dotnet-desktop.yml 2025-06-06 17:33:55 +08:00
CJK_mkp ab9427b224 ICC CE 1.4.2 beta 2025-06-06 16:36:55 +08:00
CJK_mkp 35070a76fb fix:issus #3 2025-06-06 16:11:07 +08:00
CJK_mkp 6d36496ff8 Fix:issus #3 2025-06-06 16:09:28 +08:00
CJK_mkp e76b464488 ICC CE 1.4.1 beta 2025-06-06 11:39:40 +08:00
CJK_mkp c4287828b7 ICC CE 1.4.1 beta 2025-06-06 11:15:01 +08:00
CJK_mkp 61e94b870f Create CODE_OF_CONDUCT.md 2025-06-01 08:03:36 +08:00
CJK_mkp 2e2c33bcf2 修复启动时自动收纳不可用的BUG 2025-05-31 21:13:02 +08:00
231 changed files with 16373 additions and 12048 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ name: .NET Build
on: on:
push: push:
branches: [ main ] branches: [ main,beta ]
pull_request: pull_request:
branches: [ main ] branches: [ main ]
+3 -1
View File
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="UserContentModel"> <component name="UserContentModel">
<attachedFolders /> <attachedFolders>
<Path>../../ICC CE main</Path>
</attachedFolders>
<explicitIncludes /> <explicitIncludes />
<explicitExcludes /> <explicitExcludes />
</component> </component>
Binary file not shown.
-12
View File
@@ -1,12 +0,0 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE main\\ICC-CE\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": []
}
]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+62 -32
View File
@@ -1,29 +1,37 @@
{ {
"Version": 1, "Version": 1,
"WorkspaceRootPath": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\", "WorkspaceRootPath": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\",
"Documents": [ "Documents": [
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\privacy.txt||{8B382828-6202-11D1-8870-0000F87579D2}", "AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\administrator\\desktop\\icc ce\\icc ce 1.2.5\\ink canvas\\mainwindow_cs\\mw_floatingbaricons.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|solutionrelative:ink canvas\\mainwindow_cs\\mw_floatingbaricons.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\README.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:README.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\privacy.txt||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:privacy.txt||{8B382828-6202-11D1-8870-0000F87579D2}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:privacy.txt||{8B382828-6202-11D1-8870-0000F87579D2}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Manual.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Manual.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Manual.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Manual.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\LICENSE||{8B382828-6202-11D1-8870-0000F87579D2}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:LICENSE||{8B382828-6202-11D1-8870-0000F87579D2}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:LICENSE||{8B382828-6202-11D1-8870-0000F87579D2}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas.sln.DotSettings.user||{FA3CD31E-987B-443A-9B81-186104E8DAC1}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas.sln.DotSettings.user||{FA3CD31E-987B-443A-9B81-186104E8DAC1}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Ink Canvas.sln.DotSettings.user||{FA3CD31E-987B-443A-9B81-186104E8DAC1}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Ink Canvas.sln.DotSettings.user||{FA3CD31E-987B-443A-9B81-186104E8DAC1}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\administrator\\desktop\\icc ce\\icc ce 1.2.3\\ink canvas\\mainwindow_cs\\mw_ppt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\administrator\\desktop\\icc ce\\icc ce 1.2.5\\ink canvas\\mainwindow_cs\\mw_ppt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|solutionrelative:ink canvas\\mainwindow_cs\\mw_ppt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" "RelativeMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|solutionrelative:ink canvas\\mainwindow_cs\\mw_ppt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\administrator\\desktop\\icc ce\\icc ce 1.2.3\\ink canvas\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", "AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\administrator\\desktop\\icc ce\\icc ce 1.2.5\\ink canvas\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}",
"RelativeMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|solutionrelative:ink canvas\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" "RelativeMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|solutionrelative:ink canvas\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}"
}, },
{ {
@@ -40,22 +48,48 @@
"DocumentGroups": [ "DocumentGroups": [
{ {
"DockedWidth": 200, "DockedWidth": 200,
"SelectedChildIndex": 4, "SelectedChildIndex": 0,
"Children": [ "Children": [
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 5, "DocumentIndex": 0,
"Title": "MW_FloatingBarIcons.cs",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"RelativeDocumentMoniker": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs*",
"RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs*",
"ViewState": "AgIAAFgHAAAAAAAAAAAgwGcHAAAIAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-05-31T10:49:24.719Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "README.md",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\README.md",
"RelativeDocumentMoniker": "README.md",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\README.md",
"RelativeToolTip": "README.md",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
"WhenOpened": "2025-05-31T10:48:22.883Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 7,
"Title": "MainWindow.xaml", "Title": "MainWindow.xaml",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas\\MainWindow.xaml", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow.xaml",
"RelativeDocumentMoniker": "Ink Canvas\\MainWindow.xaml", "RelativeDocumentMoniker": "Ink Canvas\\MainWindow.xaml",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas\\MainWindow.xaml", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow.xaml",
"RelativeToolTip": "Ink Canvas\\MainWindow.xaml", "RelativeToolTip": "Ink Canvas\\MainWindow.xaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-05-24T13:22:56.715Z" "WhenOpened": "2025-05-24T13:22:56.715Z"
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 7, "DocumentIndex": 9,
"Title": "Microsoft.Common.CurrentVersion.targets", "Title": "Microsoft.Common.CurrentVersion.targets",
"DocumentMoniker": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64\\Microsoft.Common.CurrentVersion.targets", "DocumentMoniker": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64\\Microsoft.Common.CurrentVersion.targets",
"RelativeDocumentMoniker": "..\\..\\..\\..\\..\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64\\Microsoft.Common.CurrentVersion.targets", "RelativeDocumentMoniker": "..\\..\\..\\..\\..\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64\\Microsoft.Common.CurrentVersion.targets",
@@ -67,11 +101,11 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 4, "DocumentIndex": 6,
"Title": "MW_PPT.cs", "Title": "MW_PPT.cs",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs",
"RelativeDocumentMoniker": "Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "RelativeDocumentMoniker": "Ink Canvas\\MainWindow_cs\\MW_PPT.cs",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs",
"RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_PPT.cs",
"ViewState": "AgIAAFgAAAAAAAAAAAAUwHQAAAAAAAAAAAAAAA==", "ViewState": "AgIAAFgAAAAAAAAAAAAUwHQAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
@@ -79,7 +113,7 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 6, "DocumentIndex": 8,
"Title": "README.md", "Title": "README.md",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md",
"RelativeDocumentMoniker": "..\\icc-0610.2.3\\README.md", "RelativeDocumentMoniker": "..\\icc-0610.2.3\\README.md",
@@ -91,11 +125,11 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 0, "DocumentIndex": 2,
"Title": "privacy.txt", "Title": "privacy.txt",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\privacy.txt", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\privacy.txt",
"RelativeDocumentMoniker": "privacy.txt", "RelativeDocumentMoniker": "privacy.txt",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\privacy.txt", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\privacy.txt",
"RelativeToolTip": "privacy.txt", "RelativeToolTip": "privacy.txt",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003109|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003109|",
@@ -104,11 +138,11 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 1, "DocumentIndex": 3,
"Title": "Manual.md", "Title": "Manual.md",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Manual.md", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Manual.md",
"RelativeDocumentMoniker": "Manual.md", "RelativeDocumentMoniker": "Manual.md",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Manual.md", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Manual.md",
"RelativeToolTip": "Manual.md", "RelativeToolTip": "Manual.md",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
@@ -117,11 +151,11 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 2, "DocumentIndex": 4,
"Title": "LICENSE", "Title": "LICENSE",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\LICENSE", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE",
"RelativeDocumentMoniker": "LICENSE", "RelativeDocumentMoniker": "LICENSE",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\LICENSE", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE",
"RelativeToolTip": "LICENSE", "RelativeToolTip": "LICENSE",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
@@ -130,20 +164,16 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 3, "DocumentIndex": 5,
"Title": "Ink Canvas.sln.DotSettings.user", "Title": "Ink Canvas.sln.DotSettings.user",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas.sln.DotSettings.user", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas.sln.DotSettings.user",
"RelativeDocumentMoniker": "Ink Canvas.sln.DotSettings.user", "RelativeDocumentMoniker": "Ink Canvas.sln.DotSettings.user",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas.sln.DotSettings.user", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas.sln.DotSettings.user",
"RelativeToolTip": "Ink Canvas.sln.DotSettings.user", "RelativeToolTip": "Ink Canvas.sln.DotSettings.user",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003464|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003464|",
"WhenOpened": "2025-05-24T13:04:00.792Z", "WhenOpened": "2025-05-24T13:04:00.792Z",
"EditorCaption": "" "EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
} }
] ]
} }
+62 -32
View File
@@ -1,29 +1,37 @@
{ {
"Version": 1, "Version": 1,
"WorkspaceRootPath": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\", "WorkspaceRootPath": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\",
"Documents": [ "Documents": [
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\privacy.txt||{8B382828-6202-11D1-8870-0000F87579D2}", "AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\administrator\\desktop\\icc ce\\icc ce 1.2.5\\ink canvas\\mainwindow_cs\\mw_floatingbaricons.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|solutionrelative:ink canvas\\mainwindow_cs\\mw_floatingbaricons.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\README.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:README.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\privacy.txt||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:privacy.txt||{8B382828-6202-11D1-8870-0000F87579D2}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:privacy.txt||{8B382828-6202-11D1-8870-0000F87579D2}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Manual.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Manual.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Manual.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Manual.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\LICENSE||{8B382828-6202-11D1-8870-0000F87579D2}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:LICENSE||{8B382828-6202-11D1-8870-0000F87579D2}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:LICENSE||{8B382828-6202-11D1-8870-0000F87579D2}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas.sln.DotSettings.user||{FA3CD31E-987B-443A-9B81-186104E8DAC1}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas.sln.DotSettings.user||{FA3CD31E-987B-443A-9B81-186104E8DAC1}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Ink Canvas.sln.DotSettings.user||{FA3CD31E-987B-443A-9B81-186104E8DAC1}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Ink Canvas.sln.DotSettings.user||{FA3CD31E-987B-443A-9B81-186104E8DAC1}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\administrator\\desktop\\icc ce\\icc ce 1.2.3\\ink canvas\\mainwindow_cs\\mw_ppt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\administrator\\desktop\\icc ce\\icc ce 1.2.5\\ink canvas\\mainwindow_cs\\mw_ppt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|solutionrelative:ink canvas\\mainwindow_cs\\mw_ppt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" "RelativeMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|solutionrelative:ink canvas\\mainwindow_cs\\mw_ppt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\administrator\\desktop\\icc ce\\icc ce 1.2.3\\ink canvas\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", "AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\administrator\\desktop\\icc ce\\icc ce 1.2.5\\ink canvas\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}",
"RelativeMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|solutionrelative:ink canvas\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" "RelativeMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|solutionrelative:ink canvas\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}"
}, },
{ {
@@ -40,22 +48,48 @@
"DocumentGroups": [ "DocumentGroups": [
{ {
"DockedWidth": 200, "DockedWidth": 200,
"SelectedChildIndex": 4, "SelectedChildIndex": 0,
"Children": [ "Children": [
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 5, "DocumentIndex": 0,
"Title": "MW_FloatingBarIcons.cs",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"RelativeDocumentMoniker": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"ViewState": "AgIAAFgHAAAAAAAAAAAgwGcHAAAIAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-05-31T10:49:24.719Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "README.md",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\README.md",
"RelativeDocumentMoniker": "README.md",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\README.md",
"RelativeToolTip": "README.md",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
"WhenOpened": "2025-05-31T10:48:22.883Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 7,
"Title": "MainWindow.xaml", "Title": "MainWindow.xaml",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas\\MainWindow.xaml", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow.xaml",
"RelativeDocumentMoniker": "Ink Canvas\\MainWindow.xaml", "RelativeDocumentMoniker": "Ink Canvas\\MainWindow.xaml",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas\\MainWindow.xaml", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow.xaml",
"RelativeToolTip": "Ink Canvas\\MainWindow.xaml", "RelativeToolTip": "Ink Canvas\\MainWindow.xaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-05-24T13:22:56.715Z" "WhenOpened": "2025-05-24T13:22:56.715Z"
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 7, "DocumentIndex": 9,
"Title": "Microsoft.Common.CurrentVersion.targets", "Title": "Microsoft.Common.CurrentVersion.targets",
"DocumentMoniker": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64\\Microsoft.Common.CurrentVersion.targets", "DocumentMoniker": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64\\Microsoft.Common.CurrentVersion.targets",
"RelativeDocumentMoniker": "..\\..\\..\\..\\..\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64\\Microsoft.Common.CurrentVersion.targets", "RelativeDocumentMoniker": "..\\..\\..\\..\\..\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64\\Microsoft.Common.CurrentVersion.targets",
@@ -67,11 +101,11 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 4, "DocumentIndex": 6,
"Title": "MW_PPT.cs", "Title": "MW_PPT.cs",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs",
"RelativeDocumentMoniker": "Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "RelativeDocumentMoniker": "Ink Canvas\\MainWindow_cs\\MW_PPT.cs",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs",
"RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_PPT.cs",
"ViewState": "AgIAAFgAAAAAAAAAAAAUwHQAAAAAAAAAAAAAAA==", "ViewState": "AgIAAFgAAAAAAAAAAAAUwHQAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
@@ -79,7 +113,7 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 6, "DocumentIndex": 8,
"Title": "README.md", "Title": "README.md",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md",
"RelativeDocumentMoniker": "..\\icc-0610.2.3\\README.md", "RelativeDocumentMoniker": "..\\icc-0610.2.3\\README.md",
@@ -91,11 +125,11 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 0, "DocumentIndex": 2,
"Title": "privacy.txt", "Title": "privacy.txt",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\privacy.txt", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\privacy.txt",
"RelativeDocumentMoniker": "privacy.txt", "RelativeDocumentMoniker": "privacy.txt",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\privacy.txt", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\privacy.txt",
"RelativeToolTip": "privacy.txt", "RelativeToolTip": "privacy.txt",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003109|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003109|",
@@ -104,11 +138,11 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 1, "DocumentIndex": 3,
"Title": "Manual.md", "Title": "Manual.md",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Manual.md", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Manual.md",
"RelativeDocumentMoniker": "Manual.md", "RelativeDocumentMoniker": "Manual.md",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Manual.md", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Manual.md",
"RelativeToolTip": "Manual.md", "RelativeToolTip": "Manual.md",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
@@ -117,11 +151,11 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 2, "DocumentIndex": 4,
"Title": "LICENSE", "Title": "LICENSE",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\LICENSE", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE",
"RelativeDocumentMoniker": "LICENSE", "RelativeDocumentMoniker": "LICENSE",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\LICENSE", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE",
"RelativeToolTip": "LICENSE", "RelativeToolTip": "LICENSE",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
@@ -130,20 +164,16 @@
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 3, "DocumentIndex": 5,
"Title": "Ink Canvas.sln.DotSettings.user", "Title": "Ink Canvas.sln.DotSettings.user",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas.sln.DotSettings.user", "DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas.sln.DotSettings.user",
"RelativeDocumentMoniker": "Ink Canvas.sln.DotSettings.user", "RelativeDocumentMoniker": "Ink Canvas.sln.DotSettings.user",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.3\\Ink Canvas.sln.DotSettings.user", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas.sln.DotSettings.user",
"RelativeToolTip": "Ink Canvas.sln.DotSettings.user", "RelativeToolTip": "Ink Canvas.sln.DotSettings.user",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003464|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003464|",
"WhenOpened": "2025-05-24T13:04:00.792Z", "WhenOpened": "2025-05-24T13:04:00.792Z",
"EditorCaption": "" "EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
} }
] ]
} }
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
5.0.1 1.6.3.0
+128
View File
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
QQ:2564608840.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
+703 -1
View File
@@ -1,13 +1,20 @@
using Hardcodet.Wpf.TaskbarNotification; using Hardcodet.Wpf.TaskbarNotification;
using Ink_Canvas.Helpers; using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Modern.Controls; using iNKORE.UI.WPF.Modern.Controls;
using System; using System;
using System.Diagnostics;
using System.Threading;
using Microsoft.Win32;
using System.Security; // 添加SecurityException所需命名空间
using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Windows; using System.Windows;
using System.Windows.Threading;
using static System.Windows.Forms.VisualStyles.VisualStyleElement; using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using MessageBox = System.Windows.MessageBox; using MessageBox = System.Windows.MessageBox;
using Window = System.Windows.Window; using Window = System.Windows.Window;
using System.Collections.Generic;
namespace Ink_Canvas namespace Ink_Canvas
{ {
@@ -21,23 +28,50 @@ namespace Ink_Canvas
public static string[] StartArgs = null; public static string[] StartArgs = null;
public static string RootPath = Environment.GetEnvironmentVariable("APPDATA") + "\\Ink Canvas\\"; public static string RootPath = Environment.GetEnvironmentVariable("APPDATA") + "\\Ink Canvas\\";
// 新增:保存看门狗进程对象
private static Process watchdogProcess = null;
// 新增:标记是否为软件内主动退出
public static bool IsAppExitByUser = false;
// 新增:退出信号文件路径
private static string watchdogExitSignalFile = Path.Combine(Path.GetTempPath(), "icc_watchdog_exit_" + System.Diagnostics.Process.GetCurrentProcess().Id + ".flag");
public App() public App()
{ {
this.Startup += new StartupEventHandler(App_Startup); this.Startup += new StartupEventHandler(App_Startup);
this.DispatcherUnhandledException += App_DispatcherUnhandledException; this.DispatcherUnhandledException += App_DispatcherUnhandledException;
StartHeartbeatMonitor();
StartWatchdogIfNeeded();
this.Exit += App_Exit; // 注册退出事件
} }
// 增加字段保存崩溃后操作设置
public static CrashActionType CrashAction = CrashActionType.SilentRestart;
private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{ {
Ink_Canvas.MainWindow.ShowNewMessage("抱歉,出现未预期的异常,可能导致 InkCanvasForClass 运行不稳定。\n建议保存墨迹后重启应用。", true); Ink_Canvas.MainWindow.ShowNewMessage("抱歉,出现未预期的异常,可能导致 InkCanvasForClass 运行不稳定。\n建议保存墨迹后重启应用。", true);
LogHelper.NewLog(e.Exception.ToString()); LogHelper.NewLog(e.Exception.ToString());
e.Handled = true; e.Handled = true;
// 修改:仅当非用户主动退出时才触发自动重启
if (CrashAction == CrashActionType.SilentRestart && !IsAppExitByUser)
{
try
{
string exePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
System.Diagnostics.Process.Start(exePath);
}
catch { }
Environment.Exit(1);
}
// CrashActionType.NoAction 时不做处理
} }
private TaskbarIcon _taskbar; private TaskbarIcon _taskbar;
void App_Startup(object sender, StartupEventArgs e) void App_Startup(object sender, StartupEventArgs e)
{ {
RunWatchdogIfNeeded();
/*if (!StoreHelper.IsStoreApp) */RootPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; /*if (!StoreHelper.IsStoreApp) */RootPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
LogHelper.NewLog(string.Format("Ink Canvas Starting (Version: {0})", Assembly.GetExecutingAssembly().GetName().Version.ToString())); LogHelper.NewLog(string.Format("Ink Canvas Starting (Version: {0})", Assembly.GetExecutingAssembly().GetName().Version.ToString()));
@@ -56,6 +90,127 @@ namespace Ink_Canvas
_taskbar = (TaskbarIcon)FindResource("TaskbarTrayIcon"); _taskbar = (TaskbarIcon)FindResource("TaskbarTrayIcon");
StartArgs = e.Args; StartArgs = e.Args;
// 新增:Office注册表检测
try
{
LogHelper.WriteLogToFile("开始Office注册表检测");
// 检查Office安装
if (!IsOfficeInstalled())
{
LogHelper.WriteLogToFile("未检测到Office安装", LogHelper.LogType.Warning);
return;
}
// 尝试获取所有可能的Office版本路径
var officeVersions = GetOfficeVersions();
if (officeVersions.Count == 0)
{
LogHelper.WriteLogToFile("未找到任何Office版本", LogHelper.LogType.Warning);
return;
}
foreach (var version in officeVersions)
{
string regPath = $"Software\\Microsoft\\Office\\{version}\\Common\\Security";
LogHelper.WriteLogToFile($"正在处理Office版本 {version}, 注册表路径: {regPath}");
try
{
using (Microsoft.Win32.RegistryKey baseKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(regPath))
{
if (baseKey == null)
{
LogHelper.WriteLogToFile($"注册表路径不存在: {regPath}", LogHelper.LogType.Warning);
// 尝试创建路径
try
{
using (Microsoft.Win32.RegistryKey createKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(regPath, true))
{
if (createKey != null)
{
createKey.SetValue("DisableProtectedView", 1, Microsoft.Win32.RegistryValueKind.DWord);
LogHelper.WriteLogToFile($"创建并设置注册表路径: {regPath}", LogHelper.LogType.Info);
}
}
}
catch (Exception createEx)
{
LogHelper.WriteLogToFile($"创建注册表路径失败: {createEx.Message}", LogHelper.LogType.Error);
}
continue;
}
// 备份路径更改为软件根目录下的saves/RegistryBackups文件夹
string backupPath = Path.Combine(RootPath, "saves", "RegistryBackups");
LogHelper.WriteLogToFile($"备份路径: {backupPath}");
if (!Directory.Exists(backupPath))
{
Directory.CreateDirectory(backupPath);
LogHelper.WriteLogToFile($"创建备份目录: {backupPath}");
}
string backupFile = Path.Combine(backupPath, $"SecurityBackup_{version}_{DateTime.Now:yyyyMMddHHmmss}.reg");
LogHelper.WriteLogToFile($"创建备份文件: {backupFile}");
// 使用UTF8编码写入注册表文件
using (StreamWriter sw = new StreamWriter(backupFile, false, System.Text.Encoding.UTF8))
{
sw.WriteLine("Windows Registry Editor Version 5.00\n");
sw.WriteLine();
sw.WriteLine($"[{Microsoft.Win32.Registry.CurrentUser.Name}\\{regPath}]");
foreach (string valueName in baseKey.GetValueNames())
{
object value = baseKey.GetValue(valueName);
sw.WriteLine($"\"{valueName}\"=dword:{((int)value):x8}");
LogHelper.WriteLogToFile($"备份注册表值: {valueName} = {value}");
}
}
using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(regPath, true))
{
// 仅在值不存在或不等于1时更新
object currentValue = key.GetValue("DisableProtectedView");
if (currentValue == null || (int)currentValue != 1)
{
key.SetValue("DisableProtectedView", 1, Microsoft.Win32.RegistryValueKind.DWord);
LogHelper.WriteLogToFile($"Office {version} 注册表值已设置: DisableProtectedView = 1");
}
else
{
LogHelper.WriteLogToFile($"Office {version} 注册表值已存在且无需更改: DisableProtectedView = 1");
}
}
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"处理Office版本 {version} 时出错: {ex.Message}", LogHelper.LogType.Error);
continue;
}
}
// 处理Office 365的特殊路径
TryModifyOffice365Registry();
}
catch (SecurityException secEx)
{
LogHelper.WriteLogToFile($"安全异常: {secEx.Message}", LogHelper.LogType.Error);
ShowPermissionError();
}
catch (UnauthorizedAccessException authEx)
{
LogHelper.WriteLogToFile($"访问被拒绝: {authEx.Message}", LogHelper.LogType.Error);
ShowPermissionError();
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"未知错误: {ex.GetType().FullName} - {ex.Message}", LogHelper.LogType.Error);
LogHelper.WriteLogToFile(ex.StackTrace, LogHelper.LogType.Info);
}
} }
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
@@ -75,5 +230,552 @@ namespace Ink_Canvas
} }
catch { } catch { }
} }
// 新增:用于设置崩溃后操作类型
public enum CrashActionType
{
SilentRestart,
NoAction
}
// 心跳相关
private static Timer heartbeatTimer;
private static DateTime lastHeartbeat = DateTime.Now;
private static Timer watchdogTimer;
private void StartHeartbeatMonitor()
{
// 主线程定时更新心跳
heartbeatTimer = new Timer(_ => lastHeartbeat = DateTime.Now, null, 0, 1000);
// 辅助线程检测心跳超时
watchdogTimer = new Timer(_ =>
{
if ((DateTime.Now - lastHeartbeat).TotalSeconds > 10)
{
LogHelper.NewLog("检测到主线程无响应,自动重启。");
if (CrashAction == CrashActionType.SilentRestart)
{
try
{
string exePath = Process.GetCurrentProcess().MainModule.FileName;
Process.Start(exePath);
}
catch { }
Environment.Exit(1);
}
}
}, null, 0, 3000);
}
// 看门狗进程
private void StartWatchdogIfNeeded()
{
// 避免递归启动
if (Environment.GetCommandLineArgs().Contains("--watchdog")) return;
// 启动看门狗进程
string exePath = Process.GetCurrentProcess().MainModule.FileName;
var psi = new ProcessStartInfo
{
FileName = exePath,
Arguments = "--watchdog " + Process.GetCurrentProcess().Id + " \"" + watchdogExitSignalFile + "\"",
CreateNoWindow = true,
UseShellExecute = false,
WindowStyle = ProcessWindowStyle.Hidden
};
watchdogProcess = Process.Start(psi);
}
// 看门狗主逻辑(在 Main 函数或 App_Startup 入口前加判断)
public static void RunWatchdogIfNeeded()
{
var args = Environment.GetCommandLineArgs();
if (args.Length >= 4 && args[1] == "--watchdog")
{
int pid = int.Parse(args[2]);
string exitSignalFile = args[3];
try
{
var proc = Process.GetProcessById(pid);
while (!proc.HasExited)
{
// 检查退出信号文件
if (File.Exists(exitSignalFile))
{
try { File.Delete(exitSignalFile); } catch { }
Environment.Exit(0);
}
Thread.Sleep(2000);
}
// 主进程异常退出,自动重启
string exePath = Process.GetCurrentProcess().MainModule.FileName;
Process.Start(exePath);
}
catch { }
Environment.Exit(0);
}
}
private void App_Exit(object sender, ExitEventArgs e)
{
// 仅在软件内主动退出时关闭看门狗,并写入退出信号
try
{
if (IsAppExitByUser)
{
// 写入退出信号文件,通知看门狗正常退出
File.WriteAllText(watchdogExitSignalFile, "exit");
if (watchdogProcess != null && !watchdogProcess.HasExited)
{
watchdogProcess.Kill();
}
}
}
catch { }
}
/// <summary>
/// 检查Office是否安装
/// </summary>
private bool IsOfficeInstalled()
{
try
{
// 检查多个可能的注册表路径
// 1. 检查传统的Office版本
using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office"))
{
if (key != null && key.GetSubKeyNames().Any(name => name.Contains(".0")))
{
LogHelper.WriteLogToFile("检测到传统Office安装", LogHelper.LogType.Info);
return true;
}
}
// 2. 检查64位注册表中的Office
using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Wow6432Node\\Microsoft\\Office"))
{
if (key != null && key.GetSubKeyNames().Any(name => name.Contains(".0")))
{
LogHelper.WriteLogToFile("检测到64位注册表中的Office安装", LogHelper.LogType.Info);
return true;
}
}
// 3. 检查Office 365/Click-to-Run安装
using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\ClickToRun"))
{
if (key != null)
{
LogHelper.WriteLogToFile("检测到Office 365 Click-to-Run", LogHelper.LogType.Info);
return true;
}
}
// 4. 检查Office 365部署配置
using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\15.0\\ClickToRun"))
{
if (key != null)
{
LogHelper.WriteLogToFile("检测到Office 365 (15.0)", LogHelper.LogType.Info);
return true;
}
}
using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\16.0\\ClickToRun"))
{
if (key != null)
{
LogHelper.WriteLogToFile("检测到Office 365 (16.0)", LogHelper.LogType.Info);
return true;
}
}
// 5. 检查Office 365零售订阅信息
using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\ClickToRun\\Configuration"))
{
if (key != null)
{
LogHelper.WriteLogToFile("检测到Office 365配置", LogHelper.LogType.Info);
return true;
}
}
LogHelper.WriteLogToFile("未检测到任何Office安装", LogHelper.LogType.Warning);
return false;
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"检查Office安装时出错: {ex.Message}", LogHelper.LogType.Error);
return false;
}
}
/// <summary>
/// 显示权限不足的错误提示
/// </summary>
private void ShowPermissionError()
{
const string message = "需要管理员权限才能完成此操作\n请以管理员身份重新启动应用程序";
LogHelper.WriteLogToFile(message, LogHelper.LogType.Error);
System.Windows.MessageBox.Show(message, "权限错误", MessageBoxButton.OK, MessageBoxImage.Error);
}
/// <summary>
/// 获取所有已安装的Office版本
/// </summary>
private List<string> GetOfficeVersions()
{
var versions = new List<string>();
try
{
// 检查HKLM
using (var key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office"))
{
if (key != null)
{
foreach (var subKeyName in key.GetSubKeyNames())
{
if (subKeyName.Contains(".0"))
{
versions.Add(subKeyName);
LogHelper.WriteLogToFile($"在HKLM中找到Office版本: {subKeyName}");
}
}
}
}
// 检查HKCU
using (var key = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Office"))
{
if (key != null)
{
foreach (var subKeyName in key.GetSubKeyNames())
{
if (subKeyName.Contains(".0") && !versions.Contains(subKeyName))
{
versions.Add(subKeyName);
LogHelper.WriteLogToFile($"在HKCU中找到Office版本: {subKeyName}");
}
}
}
}
// 检查64位注册表
using (var key = Registry.LocalMachine.OpenSubKey("Software\\Wow6432Node\\Microsoft\\Office"))
{
if (key != null)
{
foreach (var subKeyName in key.GetSubKeyNames())
{
if (subKeyName.Contains(".0") && !versions.Contains(subKeyName))
{
versions.Add(subKeyName);
LogHelper.WriteLogToFile($"在64位注册表中找到Office版本: {subKeyName}");
}
}
}
}
// 检查Office 365的特殊路径
CheckOffice365Versions(versions);
// 如果没有找到任何版本,添加默认的Office 365版本号
if (versions.Count == 0 && IsOffice365Installed())
{
versions.Add("16.0");
LogHelper.WriteLogToFile("未找到具体版本,添加默认Office 365版本: 16.0");
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"获取Office版本时出错: {ex.Message}", LogHelper.LogType.Error);
}
// 按版本号排序
versions.Sort((a, b) =>
{
try
{
double va = double.Parse(a.Replace(".0", ""));
double vb = double.Parse(b.Replace(".0", ""));
return vb.CompareTo(va); // 降序排列,最新版本在前
}
catch
{
return 0;
}
});
return versions;
}
/// <summary>
/// 检测Office 365是否已安装
/// </summary>
private bool IsOffice365Installed()
{
try
{
// 检查多个Office 365特定路径
using (var key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\ClickToRun"))
{
if (key != null)
return true;
}
using (var key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\15.0\\ClickToRun"))
{
if (key != null)
return true;
}
using (var key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\16.0\\ClickToRun"))
{
if (key != null)
return true;
}
using (var key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\ClickToRun\\Configuration"))
{
if (key != null)
return true;
}
return false;
}
catch
{
return false;
}
}
/// <summary>
/// 检查Office 365特有的版本信息
/// </summary>
private void CheckOffice365Versions(List<string> versions)
{
try
{
// 检查Click-to-Run版本路径
using (var key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Office\\ClickToRun\\Configuration"))
{
if (key != null)
{
var platformVersion = key.GetValue("Platform") as string;
var clickToRunVersion = key.GetValue("VersionToReport") as string;
if (!string.IsNullOrEmpty(platformVersion))
{
var majorVersion = platformVersion.Split('.').FirstOrDefault();
if (!string.IsNullOrEmpty(majorVersion) && !versions.Contains($"{majorVersion}.0"))
{
versions.Add($"{majorVersion}.0");
LogHelper.WriteLogToFile($"在Office 365配置中找到平台版本: {majorVersion}.0");
}
}
if (!string.IsNullOrEmpty(clickToRunVersion))
{
var majorVersion = clickToRunVersion.Split('.').FirstOrDefault();
if (!string.IsNullOrEmpty(majorVersion) && !versions.Contains($"{majorVersion}.0"))
{
versions.Add($"{majorVersion}.0");
LogHelper.WriteLogToFile($"在Office 365配置中找到报告版本: {majorVersion}.0");
}
}
}
}
// 检查安装路径来确认版本
var possibleVersions = new[] { "15.0", "16.0" }; // Office 2013 (15.0) 和 Office 2016/2019/365 (16.0)
foreach (var version in possibleVersions)
{
using (var key = Registry.LocalMachine.OpenSubKey($"Software\\Microsoft\\Office\\{version}\\Common\\InstallRoot"))
{
if (key != null && key.GetValue("Path") != null && !versions.Contains(version))
{
versions.Add(version);
LogHelper.WriteLogToFile($"在InstallRoot中找到Office版本: {version}");
}
}
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"检查Office 365版本时出错: {ex.Message}", LogHelper.LogType.Error);
}
}
/// <summary>
/// 尝试修改Office 365的特殊注册表路径
/// </summary>
private void TryModifyOffice365Registry()
{
try
{
// 准备备份目录
string backupPath = Path.Combine(RootPath, "saves", "RegistryBackups");
if (!Directory.Exists(backupPath))
{
Directory.CreateDirectory(backupPath);
LogHelper.WriteLogToFile($"创建Office 365备份目录: {backupPath}");
}
// 检查Office 365 Outlook和PowerPoint的特定路径
string[] apps = { "outlook", "powerpoint" };
foreach (var app in apps)
{
// 检查用户级别的注册表
string regPath = $"Software\\Microsoft\\Office\\16.0\\{app}\\Security";
LogHelper.WriteLogToFile($"检查Office 365特定应用注册表: {regPath}");
try
{
// 先检查是否存在该路径
using (var baseKey = Registry.CurrentUser.OpenSubKey(regPath))
{
// 如果路径存在,先备份
if (baseKey != null)
{
string backupFile = Path.Combine(backupPath, $"SecurityBackup_365_{app}_{DateTime.Now:yyyyMMddHHmmss}.reg");
LogHelper.WriteLogToFile($"创建Office 365 {app}备份文件: {backupFile}");
// 使用UTF8编码写入注册表文件
using (StreamWriter sw = new StreamWriter(backupFile, false, System.Text.Encoding.UTF8))
{
sw.WriteLine("Windows Registry Editor Version 5.00\n");
sw.WriteLine();
sw.WriteLine($"[{Microsoft.Win32.Registry.CurrentUser.Name}\\{regPath}]");
foreach (string valueName in baseKey.GetValueNames())
{
object value = baseKey.GetValue(valueName);
sw.WriteLine($"\"{valueName}\"=dword:{((int)value):x8}");
LogHelper.WriteLogToFile($"备份Office 365 {app}注册表值: {valueName} = {value}");
}
}
}
}
// 修改或创建注册表项
using (var key = Registry.CurrentUser.CreateSubKey(regPath, true))
{
if (key != null)
{
object currentValue = key.GetValue("DisableProtectedView");
if (currentValue == null || (int)currentValue != 1)
{
key.SetValue("DisableProtectedView", 1, RegistryValueKind.DWord);
LogHelper.WriteLogToFile($"Office 365 {app} 注册表值已设置: DisableProtectedView = 1");
}
else
{
LogHelper.WriteLogToFile($"Office 365 {app} 注册表值已存在且无需更改");
}
}
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"修改 {app} 注册表时出错: {ex.Message}", LogHelper.LogType.Error);
}
}
// 尝试通过Office信任中心路径修改
string trustCenterPath = "Software\\Microsoft\\Office\\16.0\\Common\\Security\\FileValidation";
LogHelper.WriteLogToFile($"检查信任中心路径: {trustCenterPath}");
try
{
// 先检查是否存在该路径
using (var baseKey = Registry.CurrentUser.OpenSubKey(trustCenterPath))
{
// 如果路径存在,先备份
if (baseKey != null)
{
string backupFile = Path.Combine(backupPath, $"SecurityBackup_365_TrustCenter_{DateTime.Now:yyyyMMddHHmmss}.reg");
LogHelper.WriteLogToFile($"创建信任中心备份文件: {backupFile}");
// 使用UTF8编码写入注册表文件
using (StreamWriter sw = new StreamWriter(backupFile, false, System.Text.Encoding.UTF8))
{
sw.WriteLine("Windows Registry Editor Version 5.00\n");
sw.WriteLine();
sw.WriteLine($"[{Microsoft.Win32.Registry.CurrentUser.Name}\\{trustCenterPath}]");
foreach (string valueName in baseKey.GetValueNames())
{
object value = baseKey.GetValue(valueName);
sw.WriteLine($"\"{valueName}\"=dword:{((int)value):x8}");
LogHelper.WriteLogToFile($"备份信任中心注册表值: {valueName} = {value}");
}
}
}
}
using (var key = Registry.CurrentUser.CreateSubKey(trustCenterPath, true))
{
if (key != null)
{
key.SetValue("DisableEditFromPV", 1, RegistryValueKind.DWord);
LogHelper.WriteLogToFile("已禁用受保护视图中的编辑");
}
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"修改信任中心路径时出错: {ex.Message}", LogHelper.LogType.Error);
}
// 尝试修改EnableEditWhileViewingPolicy
string policyPath = "Software\\Policies\\Microsoft\\Office\\16.0\\Common\\Security";
try
{
// 先检查是否存在该路径
using (var baseKey = Registry.CurrentUser.OpenSubKey(policyPath))
{
// 如果路径存在,先备份
if (baseKey != null)
{
string backupFile = Path.Combine(backupPath, $"SecurityBackup_365_Policy_{DateTime.Now:yyyyMMddHHmmss}.reg");
LogHelper.WriteLogToFile($"创建策略备份文件: {backupFile}");
// 使用UTF8编码写入注册表文件
using (StreamWriter sw = new StreamWriter(backupFile, false, System.Text.Encoding.UTF8))
{
sw.WriteLine("Windows Registry Editor Version 5.00\n");
sw.WriteLine();
sw.WriteLine($"[{Microsoft.Win32.Registry.CurrentUser.Name}\\{policyPath}]");
foreach (string valueName in baseKey.GetValueNames())
{
object value = baseKey.GetValue(valueName);
sw.WriteLine($"\"{valueName}\"=dword:{((int)value):x8}");
LogHelper.WriteLogToFile($"备份策略注册表值: {valueName} = {value}");
}
}
}
}
using (var key = Registry.CurrentUser.CreateSubKey(policyPath, true))
{
if (key != null)
{
key.SetValue("EnableEditWhileViewingPolicy", 1, RegistryValueKind.DWord);
LogHelper.WriteLogToFile("已启用查看时编辑策略");
}
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"修改策略路径时出错: {ex.Message}", LogHelper.LogType.Error);
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"修改Office 365注册表时发生未知错误: {ex.Message}", LogHelper.LogType.Error);
}
}
} }
} }
+2 -2
View File
@@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.0.2.0")] [assembly: AssemblyVersion("1.6.3.0")]
[assembly: AssemblyFileVersion("5.0.2.0")] [assembly: AssemblyFileVersion("1.6.3.0")]
+513 -39
View File
@@ -8,6 +8,8 @@ using System.Windows;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Windows.Controls; using System.Windows.Controls;
using System.IO.Compression;
using System.Text;
namespace Ink_Canvas.Helpers namespace Ink_Canvas.Helpers
{ {
@@ -18,30 +20,37 @@ namespace Ink_Canvas.Helpers
try try
{ {
string localVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); string localVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
LogHelper.WriteLogToFile($"AutoUpdate | Local version: {localVersion}");
string remoteAddress = proxy; string remoteAddress = proxy;
remoteAddress += "https://gitea.bliemhax.com/kriastans/InkCanvasForClass/raw/branch/master/AutomaticUpdateVersionControl.txt"; remoteAddress += "https://raw.githubusercontent.com/awesome-iwb/icc-ce/refs/heads/main/AutomaticUpdateVersionControl.txt";
string remoteVersion = await GetRemoteVersion(remoteAddress); string remoteVersion = await GetRemoteVersion(remoteAddress);
if (remoteVersion != null) if (remoteVersion != null)
{ {
LogHelper.WriteLogToFile($"AutoUpdate | Remote version: {remoteVersion}");
Version local = new Version(localVersion); Version local = new Version(localVersion);
Version remote = new Version(remoteVersion); Version remote = new Version(remoteVersion);
if (remote > local) if (remote > local)
{ {
LogHelper.WriteLogToFile("AutoUpdate | New version Availble: " + remoteVersion); LogHelper.WriteLogToFile($"AutoUpdate | New version available: {remoteVersion}");
return remoteVersion; return remoteVersion;
} }
else return null; else
{
LogHelper.WriteLogToFile($"AutoUpdate | Current version is up to date");
return null;
}
} }
else else
{ {
LogHelper.WriteLogToFile("Failed to retrieve remote version.", LogHelper.LogType.Error); LogHelper.WriteLogToFile("AutoUpdate | Failed to retrieve remote version.", LogHelper.LogType.Error);
return null; return null;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine($"AutoUpdate | Error: {ex.Message}"); LogHelper.WriteLogToFile($"AutoUpdate | Error in CheckForUpdates: {ex.Message}", LogHelper.LogType.Error);
return null; return null;
} }
} }
@@ -52,15 +61,59 @@ namespace Ink_Canvas.Helpers
{ {
try try
{ {
// Set a reasonable timeout
client.Timeout = TimeSpan.FromSeconds(15);
LogHelper.WriteLogToFile($"AutoUpdate | Sending HTTP request to: {fileUrl}");
HttpResponseMessage response = await client.GetAsync(fileUrl); HttpResponseMessage response = await client.GetAsync(fileUrl);
LogHelper.WriteLogToFile($"AutoUpdate | HTTP response status: {response.StatusCode}");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
return await response.Content.ReadAsStringAsync(); string content = await response.Content.ReadAsStringAsync();
// Trim any whitespace, newlines, etc.
content = content.Trim();
// If the content contains HTML (likely the GitHub view page instead of raw content),
// try to extract the version number
if (content.Contains("<html") || content.Contains("<!DOCTYPE"))
{
LogHelper.WriteLogToFile($"AutoUpdate | Received HTML content instead of raw version number - trying to extract version");
// Try to extract version from GitHub page - look for text content in the file
int startPos = content.IndexOf("<table");
if (startPos > 0)
{
int endPos = content.IndexOf("</table>", startPos);
if (endPos > startPos)
{
string tableContent = content.Substring(startPos, endPos - startPos);
// Look for the version number pattern (like 1.2.3 or 1.2.3.4)
var match = System.Text.RegularExpressions.Regex.Match(tableContent, @"(\d+\.\d+\.\d+(\.\d+)?)");
if (match.Success)
{
content = match.Groups[1].Value;
LogHelper.WriteLogToFile($"AutoUpdate | Extracted version from HTML: {content}");
}
else
{
LogHelper.WriteLogToFile($"AutoUpdate | Could not extract version from HTML content");
return null;
}
}
}
}
LogHelper.WriteLogToFile($"AutoUpdate | Response content: {content}");
return content;
} }
catch (HttpRequestException ex) catch (HttpRequestException ex)
{ {
LogHelper.WriteLogToFile($"AutoUpdate | HTTP request error: {ex.Message}", LogHelper.LogType.Error); LogHelper.WriteLogToFile($"AutoUpdate | HTTP request error: {ex.Message}", LogHelper.LogType.Error);
} }
catch (TaskCanceledException ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | Request timed out: {ex.Message}", LogHelper.LogType.Error);
}
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.WriteLogToFile($"AutoUpdate | Error: {ex.Message}", LogHelper.LogType.Error); LogHelper.WriteLogToFile($"AutoUpdate | Error: {ex.Message}", LogHelper.LogType.Error);
@@ -70,7 +123,7 @@ namespace Ink_Canvas.Helpers
} }
} }
private static string updatesFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Ink Canvas Annotation", "AutoUpdate"); private static string updatesFolderPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "AutoUpdate");
private static string statusFilePath = null; private static string statusFilePath = null;
public static async Task<bool> DownloadSetupFileAndSaveStatus(string version, string proxy = "") public static async Task<bool> DownloadSetupFileAndSaveStatus(string version, string proxy = "")
@@ -85,48 +138,172 @@ namespace Ink_Canvas.Helpers
return true; return true;
} }
string downloadUrl = $"{proxy}https://github.com/ChangSakura/Ink-Canvas/releases/download/v{version}/Ink.Canvas.Annotation.V{version}.Setup.exe"; // Ensure update directory exists
if (!Directory.Exists(updatesFolderPath))
{
Directory.CreateDirectory(updatesFolderPath);
LogHelper.WriteLogToFile($"AutoUpdate | Created updates directory: {updatesFolderPath}");
}
// Use the correct URL format for GitHub releases
string downloadUrl = $"{proxy}https://github.com/awesome-iwb/icc-ce/releases/download/{version}/InkCanvasForClass.CE.{version}.zip";
LogHelper.WriteLogToFile($"AutoUpdate | Download URL: {downloadUrl}");
SaveDownloadStatus(false); SaveDownloadStatus(false);
await DownloadFile(downloadUrl, $"{updatesFolderPath}\\Ink.Canvas.Annotation.V{version}.Setup.exe"); string zipFilePath = Path.Combine(updatesFolderPath, $"InkCanvasForClass.CE.{version}.zip");
SaveDownloadStatus(true); LogHelper.WriteLogToFile($"AutoUpdate | Target file path: {zipFilePath}");
LogHelper.WriteLogToFile("AutoUpdate | Setup file successfully downloaded."); bool downloadSuccess = await DownloadFile(downloadUrl, zipFilePath);
return true;
if (downloadSuccess)
{
SaveDownloadStatus(true);
LogHelper.WriteLogToFile("AutoUpdate | Setup file successfully downloaded.");
return true;
}
else
{
LogHelper.WriteLogToFile("AutoUpdate | Failed to download the update file.", LogHelper.LogType.Error);
return false;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.WriteLogToFile($"AutoUpdate | Error downloading and installing update: {ex.Message}", LogHelper.LogType.Error); LogHelper.WriteLogToFile($"AutoUpdate | Error downloading update: {ex.Message}", LogHelper.LogType.Error);
if (ex.InnerException != null)
{
LogHelper.WriteLogToFile($"AutoUpdate | Inner exception: {ex.InnerException.Message}", LogHelper.LogType.Error);
}
SaveDownloadStatus(false); SaveDownloadStatus(false);
return false; return false;
} }
} }
private static async Task DownloadFile(string fileUrl, string destinationPath) private static async Task<bool> DownloadFile(string fileUrl, string destinationPath)
{ {
using (HttpClient client = new HttpClient()) using (HttpClient client = new HttpClient())
{ {
try try
{ {
HttpResponseMessage response = await client.GetAsync(fileUrl); // Configure client
response.EnsureSuccessStatusCode(); client.Timeout = TimeSpan.FromMinutes(5); // Longer timeout for downloading larger files
client.DefaultRequestHeaders.Add("User-Agent", "ICC-CE Auto Updater");
using (FileStream fileStream = File.Create(destinationPath))
LogHelper.WriteLogToFile($"AutoUpdate | Downloading from: {fileUrl}");
// 创建临时文件路径
string tempFilePath = destinationPath + ".tmp";
// 确保目标目录存在
string directory = Path.GetDirectoryName(destinationPath);
if (!Directory.Exists(directory))
{ {
await response.Content.CopyToAsync(fileStream); Directory.CreateDirectory(directory);
fileStream.Close(); LogHelper.WriteLogToFile($"AutoUpdate | Created directory: {directory}");
} }
// 删除可能存在的临时文件
if (File.Exists(tempFilePath))
{
File.Delete(tempFilePath);
LogHelper.WriteLogToFile($"AutoUpdate | Deleted existing temp file");
}
// 使用流式下载而不是一次性加载到内存
LogHelper.WriteLogToFile($"AutoUpdate | Starting download...");
// 获取响应但不读取内容
HttpResponseMessage response = await client.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead);
response.EnsureSuccessStatusCode();
// 获取文件大小(如果服务器提供)
long? totalBytes = response.Content.Headers.ContentLength;
LogHelper.WriteLogToFile($"AutoUpdate | Expected file size: {(totalBytes.HasValue ? totalBytes.Value.ToString() : "unknown")} bytes");
// 使用流式方式下载文件
using (var contentStream = await response.Content.ReadAsStreamAsync())
using (var fileStream = new FileStream(tempFilePath, FileMode.Create, FileAccess.Write, FileShare.None, 8192, true))
{
byte[] buffer = new byte[8192];
int bytesRead;
long totalBytesRead = 0;
int progressPercent = 0;
while ((bytesRead = await contentStream.ReadAsync(buffer, 0, buffer.Length)) > 0)
{
await fileStream.WriteAsync(buffer, 0, bytesRead);
totalBytesRead += bytesRead;
// 报告进度(每10%
if (totalBytes.HasValue)
{
int newProgressPercent = (int)((totalBytesRead * 100) / totalBytes.Value);
if (newProgressPercent >= progressPercent + 10)
{
progressPercent = newProgressPercent;
LogHelper.WriteLogToFile($"AutoUpdate | Download progress: {progressPercent}%");
}
}
}
// 确保所有数据都写入到文件
await fileStream.FlushAsync();
}
// 检查临时文件大小
if (new FileInfo(tempFilePath).Length == 0)
{
LogHelper.WriteLogToFile($"AutoUpdate | Downloaded file is empty", LogHelper.LogType.Error);
if (File.Exists(tempFilePath)) File.Delete(tempFilePath);
return false;
}
// 如果目标文件已存在,先删除
if (File.Exists(destinationPath))
{
File.Delete(destinationPath);
LogHelper.WriteLogToFile($"AutoUpdate | Deleted existing destination file");
}
// 将临时文件移动到最终位置
File.Move(tempFilePath, destinationPath);
LogHelper.WriteLogToFile($"AutoUpdate | File saved to: {destinationPath}");
return true;
} }
catch (HttpRequestException ex) catch (HttpRequestException ex)
{ {
Console.WriteLine($"AutoUpdate | HTTP request error: {ex.Message}"); LogHelper.WriteLogToFile($"AutoUpdate | HTTP request error: {ex.Message}", LogHelper.LogType.Error);
throw; if (ex.InnerException != null)
{
LogHelper.WriteLogToFile($"AutoUpdate | Inner exception: {ex.InnerException.Message}", LogHelper.LogType.Error);
}
return false;
}
catch (TaskCanceledException ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | Download timed out: {ex.Message}", LogHelper.LogType.Error);
return false;
}
catch (IOException ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | IO error while downloading: {ex.Message}", LogHelper.LogType.Error);
if (ex.InnerException != null)
{
LogHelper.WriteLogToFile($"AutoUpdate | Inner exception: {ex.InnerException.Message}", LogHelper.LogType.Error);
}
return false;
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine($"AutoUpdate | Error: {ex.Message}"); LogHelper.WriteLogToFile($"AutoUpdate | Error downloading file: {ex.Message}", LogHelper.LogType.Error);
throw; if (ex.InnerException != null)
{
LogHelper.WriteLogToFile($"AutoUpdate | Inner exception: {ex.InnerException.Message}", LogHelper.LogType.Error);
}
return false;
} }
} }
} }
@@ -155,17 +332,238 @@ namespace Ink_Canvas.Helpers
{ {
try try
{ {
string setupFilePath = Path.Combine(updatesFolderPath, $"Ink.Canvas.Annotation.V{version}.Setup.exe"); string zipFilePath = Path.Combine(updatesFolderPath, $"InkCanvasForClass.CE.{version}.zip");
LogHelper.WriteLogToFile($"AutoUpdate | Checking for ZIP file: {zipFilePath}");
if (!File.Exists(setupFilePath)) if (!File.Exists(zipFilePath))
{ {
LogHelper.WriteLogToFile($"AutoUpdate | Setup file not found: {setupFilePath}", LogHelper.LogType.Error); LogHelper.WriteLogToFile($"AutoUpdate | ZIP file not found: {zipFilePath}", LogHelper.LogType.Error);
return; return;
} }
string InstallCommand = $"\"{setupFilePath}\" /SILENT"; // Verify ZIP file size and validity
if (isInSilence) InstallCommand += " /VERYSILENT"; FileInfo fileInfo = new FileInfo(zipFilePath);
ExecuteCommandLine(InstallCommand); if (fileInfo.Length == 0)
{
LogHelper.WriteLogToFile($"AutoUpdate | ZIP file is empty, cannot continue", LogHelper.LogType.Error);
return;
}
LogHelper.WriteLogToFile($"AutoUpdate | ZIP file size: {fileInfo.Length} bytes");
// 获取当前应用程序路径和进程ID
string currentAppDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
int currentProcessId = Process.GetCurrentProcess().Id;
string appPath = Assembly.GetExecutingAssembly().Location;
LogHelper.WriteLogToFile($"AutoUpdate | Current application directory: {currentAppDir}");
LogHelper.WriteLogToFile($"AutoUpdate | Current process ID: {currentProcessId}");
// 创建批处理文件来执行更新操作
string batchFilePath = Path.Combine(Path.GetTempPath(), "UpdateICC_" + Guid.NewGuid().ToString().Substring(0, 8) + ".bat");
LogHelper.WriteLogToFile($"AutoUpdate | Creating update batch file: {batchFilePath}");
// 构建批处理文件内容
StringBuilder batchContent = new StringBuilder();
batchContent.AppendLine("@echo off");
// 使窗口隐藏(使用VBS脚本运行隐藏窗口)
batchContent.AppendLine("echo Set objShell = CreateObject(\"WScript.Shell\") > \"%temp%\\hideme.vbs\"");
batchContent.AppendLine("echo objShell.Run \"cmd /c \"\"\" ^& WScript.Arguments(0) ^& \"\"\"\", 0, True >> \"%temp%\\hideme.vbs\"");
batchContent.AppendLine($"echo Wscript.Sleep 100 >> \"%temp%\\hideme.vbs\"");
// 创建真正的更新批处理文件
string updateBatPath = Path.Combine(Path.GetTempPath(), "ICCUpdate_" + Guid.NewGuid().ToString().Substring(0, 8) + ".bat");
batchContent.AppendLine($"echo @echo off > \"{updateBatPath}\"");
// 写入等待进程退出的代码到更新批处理文件
batchContent.AppendLine($"echo set PROC_ID={currentProcessId} >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo :CHECK_PROCESS >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo tasklist /fi \"PID eq %PROC_ID%\" ^| find \"%PROC_ID%\" ^> nul >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo if %%ERRORLEVEL%% == 0 ( >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo timeout /t 1 /nobreak ^> nul >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo goto CHECK_PROCESS >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo ) >> \"{updateBatPath}\"");
// 应用程序已关闭,开始更新操作
batchContent.AppendLine($"echo echo Application closed, starting update process... >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo timeout /t 2 /nobreak ^> nul >> \"{updateBatPath}\"");
// 创建临时解压目录
string extractPath = Path.Combine(updatesFolderPath, $"Extract_{version}");
batchContent.AppendLine($"echo echo Extracting update files... >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo if exist \"{extractPath}\" rd /s /q \"{extractPath}\" >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo mkdir \"{extractPath}\" >> \"{updateBatPath}\"");
// PowerShell解压ZIP文件(因为批处理不直接支持ZIP解压)
batchContent.AppendLine($"echo powershell -command \"Expand-Archive -Path '{zipFilePath.Replace("'", "''")}' -DestinationPath '{extractPath.Replace("'", "''")}' -Force\" >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo if %%ERRORLEVEL%% neq 0 ( >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo goto ERROR_EXIT >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo ) >> \"{updateBatPath}\"");
// 复制文件到应用程序目录
batchContent.AppendLine($"echo echo Copying updated files to application directory... >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo xcopy /s /y /e \"{extractPath}\\*\" \"{currentAppDir}\\\" >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo if %%ERRORLEVEL%% neq 0 ( >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo goto ERROR_EXIT >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo ) >> \"{updateBatPath}\"");
// 清理临时文件
batchContent.AppendLine($"echo echo Cleaning up temporary files... >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo if exist \"{extractPath}\" rd /s /q \"{extractPath}\" >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo if exist \"{zipFilePath}\" del /f /q \"{zipFilePath}\" >> \"{updateBatPath}\"");
// 启动更新后的应用程序
batchContent.AppendLine($"echo echo Update completed successfully! >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo :: 检查应用程序是否已经在运行 >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo tasklist /FI \"IMAGENAME eq Ink Canvas.exe\" | find /i \"Ink Canvas.exe\" > nul >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo if %%ERRORLEVEL%% neq 0 ( >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo echo 启动应用程序... >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo start \"\" \"{appPath}\" >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo ) else ( >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo echo 应用程序已经在运行,不再重复启动 >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo ) >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo exit /b 0 >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo goto EXIT >> \"{updateBatPath}\"");
// 错误退出处理
batchContent.AppendLine($"echo :ERROR_EXIT >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo start \"\" cmd /c \"echo Update failed! ^& pause\" >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo exit /b 1 >> \"{updateBatPath}\"");
// 删除批处理文件自身
batchContent.AppendLine($"echo :EXIT >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo del \"{updateBatPath}\" >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo exit >> \"{updateBatPath}\"");
// 使用VBS脚本执行更新批处理文件(隐藏窗口)
batchContent.AppendLine($"wscript \"%temp%\\hideme.vbs\" \"{updateBatPath}\"");
batchContent.AppendLine("del \"%temp%\\hideme.vbs\"");
batchContent.AppendLine("exit");
// 写入批处理文件
File.WriteAllText(batchFilePath, batchContent.ToString());
LogHelper.WriteLogToFile($"AutoUpdate | Created update batch file");
// 启动批处理文件(隐藏窗口)
Process.Start(new ProcessStartInfo
{
FileName = batchFilePath,
CreateNoWindow = true,
UseShellExecute = true,
WindowStyle = ProcessWindowStyle.Hidden
});
LogHelper.WriteLogToFile($"AutoUpdate | Started update batch process with hidden window");
// 应用程序将由用户手动关闭或由MainWindow中的代码关闭
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | Error preparing update installation: {ex.Message}", LogHelper.LogType.Error);
if (ex.InnerException != null)
{
LogHelper.WriteLogToFile($"AutoUpdate | Inner exception: {ex.InnerException.Message}", LogHelper.LogType.Error);
}
}
}
private static bool CopyDirectory(string sourceDir, string destinationDir)
{
bool allCopiesSuccessful = true;
try
{
// 创建目标目录(如果不存在)
Directory.CreateDirectory(destinationDir);
LogHelper.WriteLogToFile($"AutoUpdate | Created/verified destination directory: {destinationDir}");
// 复制所有文件
foreach (string filePath in Directory.GetFiles(sourceDir))
{
string fileName = Path.GetFileName(filePath);
string destPath = Path.Combine(destinationDir, fileName);
try
{
LogHelper.WriteLogToFile($"AutoUpdate | Copying file: {fileName}");
// 如果目标文件存在,先删除
if (File.Exists(destPath))
{
File.Delete(destPath);
}
File.Copy(filePath, destPath);
}
catch (Exception ex)
{
allCopiesSuccessful = false;
LogHelper.WriteLogToFile($"AutoUpdate | Error copying file {fileName}: {ex.Message}", LogHelper.LogType.Error);
}
}
// 递归复制所有子目录
foreach (string subDirPath in Directory.GetDirectories(sourceDir))
{
string subDirName = Path.GetFileName(subDirPath);
string destSubDir = Path.Combine(destinationDir, subDirName);
bool subDirCopyResult = CopyDirectory(subDirPath, destSubDir);
if (!subDirCopyResult)
{
allCopiesSuccessful = false;
}
}
return allCopiesSuccessful;
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | Error copying directory {sourceDir}: {ex.Message}", LogHelper.LogType.Error);
return false;
}
}
private static void RestartApplication()
{
try
{
string appPath = Assembly.GetExecutingAssembly().Location;
LogHelper.WriteLogToFile($"AutoUpdate | Restarting application: {appPath}");
// Create a batch file to wait briefly and then start the application
// This allows the current process to fully exit before starting the new instance
string batchFilePath = Path.Combine(Path.GetTempPath(), "RestartICC_" + Guid.NewGuid().ToString().Substring(0, 8) + ".bat");
string batchContent =
"@echo off\r\n" +
"timeout /t 2 /nobreak >nul\r\n" +
":: 检查应用程序是否已经在运行\r\n" +
"tasklist /FI \"IMAGENAME eq Ink Canvas.exe\" | find /i \"Ink Canvas.exe\" > nul\r\n" +
"if %ERRORLEVEL% neq 0 (\r\n" +
" echo 启动应用程序...\r\n" +
$" start \"\" \"{appPath}\"\r\n" +
") else (\r\n" +
" echo 应用程序已经在运行,不再重复启动\r\n" +
")\r\n" +
"timeout /t 1 /nobreak >nul\r\n" +
"del \"%~f0\"\r\n" +
"exit\r\n"; // 确保批处理进程结束
File.WriteAllText(batchFilePath, batchContent);
// Start the batch file
Process.Start(new ProcessStartInfo
{
FileName = "cmd.exe",
Arguments = $"/c start \"\" \"{batchFilePath}\"",
CreateNoWindow = true,
UseShellExecute = false
});
LogHelper.WriteLogToFile($"AutoUpdate | Created restart script at {batchFilePath}");
// Shutdown the application
LogHelper.WriteLogToFile($"AutoUpdate | Shutting down application for restart");
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {
Application.Current.Shutdown(); Application.Current.Shutdown();
@@ -173,11 +571,37 @@ namespace Ink_Canvas.Helpers
} }
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.WriteLogToFile($"AutoUpdate | Error installing update: {ex.Message}", LogHelper.LogType.Error); LogHelper.WriteLogToFile($"AutoUpdate | Error restarting application: {ex.Message}", LogHelper.LogType.Error);
// Fallback direct restart approach
try
{
string appPath = Assembly.GetExecutingAssembly().Location;
LogHelper.WriteLogToFile($"AutoUpdate | Attempting direct restart: {appPath}");
// 检查是否已有实例运行
Process[] processes = Process.GetProcessesByName("Ink Canvas");
if (processes.Length <= 1) // 只有当前进程
{
Process.Start(appPath);
}
else
{
LogHelper.WriteLogToFile($"AutoUpdate | Application already running, not starting a new instance");
}
Application.Current.Dispatcher.Invoke(() =>
{
Application.Current.Shutdown();
});
}
catch (Exception fallbackEx)
{
LogHelper.WriteLogToFile($"AutoUpdate | Fallback restart also failed: {fallbackEx.Message}", LogHelper.LogType.Error);
}
} }
} }
private static void ExecuteCommandLine(string command) private static void ExecuteCommandLine(string command)
{ {
try try
@@ -185,7 +609,7 @@ namespace Ink_Canvas.Helpers
ProcessStartInfo processStartInfo = new ProcessStartInfo ProcessStartInfo processStartInfo = new ProcessStartInfo
{ {
FileName = "cmd.exe", FileName = "cmd.exe",
Arguments = $"/c {command}", Arguments = $"/c {command} & exit", // 添加exit确保cmd进程退出
RedirectStandardOutput = true, RedirectStandardOutput = true,
RedirectStandardError = true, RedirectStandardError = true,
UseShellExecute = false, UseShellExecute = false,
@@ -195,12 +619,20 @@ namespace Ink_Canvas.Helpers
using (Process process = new Process { StartInfo = processStartInfo }) using (Process process = new Process { StartInfo = processStartInfo })
{ {
process.Start(); process.Start();
// 设置一个超时时间
bool exited = process.WaitForExit(500); // 等待500毫秒
if (!exited)
{
// 不等待进程完成,让它在后台运行
LogHelper.WriteLogToFile($"AutoUpdate | Command is running in background");
}
Application.Current.Shutdown(); Application.Current.Shutdown();
/*process.WaitForExit();
int exitCode = process.ExitCode;*/
} }
} }
catch { } catch (Exception ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | Error executing command: {ex.Message}", LogHelper.LogType.Error);
}
} }
public static void DeleteUpdatesFolder() public static void DeleteUpdatesFolder()
@@ -209,12 +641,53 @@ namespace Ink_Canvas.Helpers
{ {
if (Directory.Exists(updatesFolderPath)) if (Directory.Exists(updatesFolderPath))
{ {
Directory.Delete(updatesFolderPath, true); // Try to delete all files first in case of locking issues
foreach (string file in Directory.GetFiles(updatesFolderPath, "*", SearchOption.AllDirectories))
{
try
{
File.Delete(file);
LogHelper.WriteLogToFile($"AutoUpdate | Deleted file: {file}");
}
catch (Exception fileEx)
{
LogHelper.WriteLogToFile($"AutoUpdate | Could not delete file {file}: {fileEx.Message}", LogHelper.LogType.Warning);
}
}
// Then try to delete subdirectories
foreach (string dir in Directory.GetDirectories(updatesFolderPath))
{
try
{
Directory.Delete(dir, true);
LogHelper.WriteLogToFile($"AutoUpdate | Deleted directory: {dir}");
}
catch (Exception dirEx)
{
LogHelper.WriteLogToFile($"AutoUpdate | Could not delete directory {dir}: {dirEx.Message}", LogHelper.LogType.Warning);
}
}
// Finally try to delete the main directory
try
{
Directory.Delete(updatesFolderPath, true);
LogHelper.WriteLogToFile($"AutoUpdate | Deleted updates folder: {updatesFolderPath}");
}
catch (Exception mainDirEx)
{
LogHelper.WriteLogToFile($"AutoUpdate | Could not completely delete updates folder: {mainDirEx.Message}", LogHelper.LogType.Warning);
}
}
else
{
LogHelper.WriteLogToFile($"AutoUpdate | Updates folder does not exist: {updatesFolderPath}");
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.WriteLogToFile($"AutoUpdate clearing| Error deleting updates folder: {ex.Message}", LogHelper.LogType.Error); LogHelper.WriteLogToFile($"AutoUpdate | Error deleting updates folder: {ex.Message}", LogHelper.LogType.Error);
} }
} }
} }
@@ -256,3 +729,4 @@ namespace Ink_Canvas.Helpers
} }
} }
} }
+209
View File
@@ -0,0 +1,209 @@
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Forms;
namespace Ink_Canvas.Helpers
{
/// <summary>
/// 防止窗口进入全屏状态的辅助类
/// </summary>
public static partial class AvoidFullScreenHelper
{
private static readonly DependencyProperty IsAvoidFullScreenEnabledProperty =
DependencyProperty.RegisterAttached(
"IsAvoidFullScreenEnabled",
typeof(bool),
typeof(AvoidFullScreenHelper));
private static bool _isBoardMode = false;
public static void SetBoardMode(bool isBoardMode)
{
_isBoardMode = isBoardMode;
}
public static void StartAvoidFullScreen(Window window)
{
if (window == null)
throw new ArgumentNullException(nameof(window));
if (!(bool)window.GetValue(IsAvoidFullScreenEnabledProperty))
{
var hwndSource = PresentationSource.FromVisual(window) as HwndSource;
if (hwndSource != null)
{
hwndSource.AddHook(KeepInWorkingAreaHook);
window.SetValue(IsAvoidFullScreenEnabledProperty, true);
}
}
}
public static void StopAvoidFullScreen(Window window)
{
if (window == null)
throw new ArgumentNullException(nameof(window));
if ((bool)window.GetValue(IsAvoidFullScreenEnabledProperty))
{
var hwndSource = PresentationSource.FromVisual(window) as HwndSource;
if (hwndSource != null)
{
hwndSource.RemoveHook(KeepInWorkingAreaHook);
window.ClearValue(IsAvoidFullScreenEnabledProperty);
}
}
}
public static bool GetIsAvoidFullScreenEnabled(DependencyObject obj) => (bool)obj.GetValue(IsAvoidFullScreenEnabledProperty);
public static void SetIsAvoidFullScreenEnabled(DependencyObject obj, bool value) => obj.SetValue(IsAvoidFullScreenEnabledProperty, value);
private static IntPtr KeepInWorkingAreaHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
// 只拦截主画布窗口的全屏(最大化)操作
var window = HwndSource.FromHwnd(hwnd)?.RootVisual as Window;
if (window == null) return IntPtr.Zero;
// 这里假设主画布窗口类名为MainWindow(如有不同请调整)
if (window.GetType().Name != "MainWindow") return IntPtr.Zero;
if (_isBoardMode)
{
// 画板模式下允许全屏/最大化,不拦截
return IntPtr.Zero;
}
const int WM_WINDOWPOSCHANGING = 0x0046;
const int WM_SYSCOMMAND = 0x0112;
const int SC_MAXIMIZE = 0xF030;
if (msg == WM_SYSCOMMAND && wParam.ToInt32() == SC_MAXIMIZE)
{
// 拦截最大化命令,强制还原窗口并调整到工作区
window.WindowState = WindowState.Normal;
var workingArea = GetWorkingArea(new Rect(window.Left, window.Top, window.Width, window.Height));
window.Left = workingArea.Left;
window.Top = workingArea.Top;
window.Width = workingArea.Width;
window.Height = workingArea.Height;
handled = true;
return IntPtr.Zero;
}
if (msg != WM_WINDOWPOSCHANGING)
return IntPtr.Zero;
try
{
var pos = (WindowPosition)Marshal.PtrToStructure(lParam, typeof(WindowPosition));
if ((pos.Flags & (WindowPositionFlags.SWP_NOMOVE | WindowPositionFlags.SWP_NOSIZE)) != 0)
return IntPtr.Zero;
// 只处理主画布窗口
// 计算目标矩形
var targetRect = new Rect(
(pos.Flags & WindowPositionFlags.SWP_NOMOVE) == 0 ? pos.X : window.Left,
(pos.Flags & WindowPositionFlags.SWP_NOMOVE) == 0 ? pos.Y : window.Top,
(pos.Flags & WindowPositionFlags.SWP_NOSIZE) == 0 ? pos.Width : window.Width,
(pos.Flags & WindowPositionFlags.SWP_NOSIZE) == 0 ? pos.Height : window.Height);
var workingArea = GetWorkingArea(targetRect);
var adjustedRect = AdjustRectToWorkingArea(targetRect, workingArea);
pos.X = (int)adjustedRect.Left;
pos.Y = (int)adjustedRect.Top;
pos.Width = (int)adjustedRect.Width;
pos.Height = (int)adjustedRect.Height;
pos.Flags &= ~(WindowPositionFlags.SWP_NOSIZE | WindowPositionFlags.SWP_NOMOVE | WindowPositionFlags.SWP_NOREDRAW);
pos.Flags |= WindowPositionFlags.SWP_NOCOPYBITS;
Marshal.StructureToPtr(pos, lParam, false);
}
catch (Exception ex)
{
Console.WriteLine($"窗口位置调整失败: {ex.Message}");
}
return IntPtr.Zero;
}
private static Rect GetWorkingArea(Rect windowRect)
{
// 获取所有显示器
var screens = System.Windows.Forms.Screen.AllScreens;
// 确定窗口主要位于哪个显示器上
System.Windows.Forms.Screen targetScreen = null;
double maxIntersection = 0;
foreach (var screen in screens)
{
var screenRect = new Rect(
screen.WorkingArea.X,
screen.WorkingArea.Y,
screen.WorkingArea.Width,
screen.WorkingArea.Height);
var intersection = Rect.Intersect(windowRect, screenRect);
if (intersection.Width * intersection.Height > maxIntersection)
{
maxIntersection = intersection.Width * intersection.Height;
targetScreen = screen;
}
}
// 如果没找到,使用主显示器
if (targetScreen == null)
targetScreen = System.Windows.Forms.Screen.PrimaryScreen;
return new Rect(
targetScreen.WorkingArea.X,
targetScreen.WorkingArea.Y,
targetScreen.WorkingArea.Width,
targetScreen.WorkingArea.Height);
}
private static Rect AdjustRectToWorkingArea(Rect windowRect, Rect workingArea)
{
// 调整尺寸以适应工作区域
if (windowRect.Width > workingArea.Width)
windowRect.Width = workingArea.Width;
if (windowRect.Height > workingArea.Height)
windowRect.Height = workingArea.Height;
// 调整位置以确保窗口完全在工作区域内
if (windowRect.Left < workingArea.Left)
windowRect.X = workingArea.Left;
else if (windowRect.Right > workingArea.Right)
windowRect.X = workingArea.Right - windowRect.Width;
if (windowRect.Top < workingArea.Top)
windowRect.Y = workingArea.Top;
else if (windowRect.Bottom > workingArea.Bottom)
windowRect.Y = workingArea.Bottom - windowRect.Height;
return windowRect;
}
}
// 使用WPF原生类型替代Win32结构
[StructLayout(LayoutKind.Sequential)]
internal struct WindowPosition
{
public IntPtr Hwnd;
public IntPtr HwndInsertAfter;
public int X;
public int Y;
public int Width;
public int Height;
public WindowPositionFlags Flags;
}
[Flags]
internal enum WindowPositionFlags : uint
{
SWP_NOSIZE = 0x0001,
SWP_NOMOVE = 0x0002,
SWP_NOZORDER = 0x0004,
SWP_NOREDRAW = 0x0008,
SWP_NOACTIVATE = 0x0010,
SWP_FRAMECHANGED = 0x0020,
SWP_SHOWWINDOW = 0x0040,
SWP_HIDEWINDOW = 0x0080,
SWP_NOCOPYBITS = 0x0100,
SWP_NOOWNERZORDER = 0x0200,
SWP_NOSENDCHANGING = 0x0400,
}
}
-13
View File
@@ -1,17 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualBasic;
using System.Collections;
using System.Data;
using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
+104
View File
@@ -23,6 +23,44 @@ namespace Ink_Canvas.Helpers
[DllImport("user32.dll")] [DllImport("user32.dll")]
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
[DllImport("shell32.dll")]
private static extern IntPtr SHAppBarMessage(uint dwMessage, ref APPBARDATA pData);
[DllImport("user32.dll")]
private static extern int SystemParametersInfo(uint uiAction, uint uiParam, IntPtr pvParam, uint fWinIni);
[DllImport("user32.dll")]
private static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi);
[DllImport("user32.dll")]
private static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags);
private const uint ABM_GETTASKBARPOS = 0x00000005;
private const uint ABM_GETSTATE = 0x00000004;
private const int SPI_GETWORKAREA = 0x0030;
private const uint MONITOR_DEFAULTTOPRIMARY = 1;
private const int ABS_AUTOHIDE = 0x0000001;
[StructLayout(LayoutKind.Sequential)]
private struct MONITORINFO
{
public int cbSize;
public RECT rcMonitor;
public RECT rcWork;
public uint dwFlags;
}
[StructLayout(LayoutKind.Sequential)]
private struct APPBARDATA
{
public int cbSize;
public IntPtr hWnd;
public uint uCallbackMessage;
public uint uEdge;
public RECT rc;
public IntPtr lParam;
}
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct RECT { public struct RECT {
public int Left; public int Left;
@@ -34,6 +72,72 @@ namespace Ink_Canvas.Helpers
public int Height => Bottom - Top; public int Height => Bottom - Top;
} }
/// <summary>
/// 获取Windows任务栏的高度(仅计算任务栏,不包括其他应用的停靠栏)
/// </summary>
/// <param name="screen">当前屏幕</param>
/// <param name="dpiScaleY">DPI缩放Y值</param>
/// <returns>任务栏高度</returns>
public static double GetTaskbarHeight(System.Windows.Forms.Screen screen, double dpiScaleY)
{
try
{
// 创建APPBARDATA结构
var abd = new APPBARDATA();
abd.cbSize = Marshal.SizeOf(abd);
// 获取任务栏状态
IntPtr state = SHAppBarMessage(ABM_GETSTATE, ref abd);
bool isAutoHide = (state.ToInt32() & ABS_AUTOHIDE) == ABS_AUTOHIDE;
// 如果任务栏是自动隐藏的,返回0
if (isAutoHide)
{
LogHelper.WriteLogToFile("任务栏处于自动隐藏状态", LogHelper.LogType.Info);
return 0;
}
// 获取任务栏信息
IntPtr result = SHAppBarMessage(ABM_GETTASKBARPOS, ref abd);
if (result != IntPtr.Zero)
{
// 获取当前屏幕的工作区
RECT workArea = new RECT();
SystemParametersInfo(SPI_GETWORKAREA, 0, Marshal.AllocHGlobal(Marshal.SizeOf(workArea)), 0);
// 根据任务栏位置计算高度
int taskbarHeight = 0;
// 任务栏的uEdge: 0=左, 1=上, 2=右, 3=下
switch (abd.uEdge)
{
case 1: // 上
taskbarHeight = abd.rc.Height;
break;
case 3: // 下
taskbarHeight = abd.rc.Height;
break;
case 0: // 左
case 2: // 右
// 水平任务栏不影响高度
taskbarHeight = 0;
break;
}
// 考虑DPI缩放
return taskbarHeight / dpiScaleY;
}
}
catch (Exception ex)
{
Debug.WriteLine($"获取任务栏高度出错: {ex.Message}");
LogHelper.WriteLogToFile($"获取任务栏高度出错: {ex.Message}", LogHelper.LogType.Error);
}
// 如果获取失败,回退到通用方法
return (screen.Bounds.Height - screen.WorkingArea.Height) / dpiScaleY;
}
public static string WindowTitle() { public static string WindowTitle() {
IntPtr foregroundWindowHandle = GetForegroundWindow(); IntPtr foregroundWindowHandle = GetForegroundWindow();
+29 -18
View File
@@ -1,5 +1,7 @@
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Threading;
namespace Ink_Canvas.Helpers namespace Ink_Canvas.Helpers
{ {
@@ -14,24 +16,19 @@ namespace Ink_Canvas.Helpers
public static void NewLog(Exception ex) public static void NewLog(Exception ex)
{ {
if (ex == null) return;
var stackTrace = ex.StackTrace ?? "<no stack trace>";
var msg = $"[Exception] Type: {ex.GetType().FullName}\nMessage: {ex.Message}\nStackTrace: {stackTrace}";
if (ex.InnerException != null)
{
msg += $"\nInnerException: {ex.InnerException.GetType().FullName} - {ex.InnerException.Message}\n{ex.InnerException.StackTrace}";
}
WriteLogToFile(msg, LogType.Error);
} }
public static void WriteLogToFile(string str, LogType logType = LogType.Info) public static void WriteLogToFile(string str, LogType logType = LogType.Info)
{ {
string strLogType = "Info"; string strLogType = logType.ToString();
switch (logType)
{
case LogType.Event:
strLogType = "Event";
break;
case LogType.Trace:
strLogType = "Trace";
break;
case LogType.Error:
strLogType = "Error";
break;
}
try try
{ {
var file = App.RootPath + LogFile; var file = App.RootPath + LogFile;
@@ -39,16 +36,30 @@ namespace Ink_Canvas.Helpers
{ {
Directory.CreateDirectory(App.RootPath); Directory.CreateDirectory(App.RootPath);
} }
StreamWriter sw = new StreamWriter(file, true); var threadId = Thread.CurrentThread.ManagedThreadId;
sw.WriteLine(string.Format("{0} [{1}] {2}", DateTime.Now.ToString("O"), strLogType, str)); var callingMethod = new StackTrace(2, true).GetFrame(0);
sw.Close(); string callerInfo = "<unknown>";
if (callingMethod != null)
{
var method = callingMethod.GetMethod();
if (method != null)
{
var className = method.DeclaringType != null ? method.DeclaringType.FullName : "<no class>";
callerInfo = $"{className}.{method.Name}";
}
}
string logLine = string.Format("{0} [T{1}] [{2}] [{3}] {4}", DateTime.Now.ToString("O"), threadId, strLogType, callerInfo, str);
using (StreamWriter sw = new StreamWriter(file, true))
{
sw.WriteLine(logLine);
}
} }
catch { } catch { }
} }
internal static void WriteLogToFile(string v, object warning) internal static void WriteLogToFile(string v, object warning)
{ {
throw new NotImplementedException(); WriteLogToFile($"[Warning] {v}", LogType.Warning);
} }
public enum LogType public enum LogType
+601 -61
View File
@@ -53,9 +53,72 @@
<RoutedUICommand x:Key="HotKey_ChangeToPen3" Text=" " /> <RoutedUICommand x:Key="HotKey_ChangeToPen3" Text=" " />
<RoutedUICommand x:Key="HotKey_ChangeToPen4" Text=" " /> <RoutedUICommand x:Key="HotKey_ChangeToPen4" Text=" " />
<RoutedUICommand x:Key="HotKey_ChangeToPen5" Text=" " /> <RoutedUICommand x:Key="HotKey_ChangeToPen5" Text=" " />
<RoutedUICommand x:Key="HotKey_DrawLine" Text=" " /> <RoutedUICommand x:Key="HotKey_DrawLine" Text=" " />
<RoutedUICommand x:Key="NothingWillHappened" Text=" " /> <RoutedUICommand x:Key="NothingWillHappened" Text=" " />
</Window.Resources>
<!-- Navigation Button Style -->
<Style x:Key="NavButton" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#27272a"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#3b82f6"/>
</Trigger>
<!-- 使用多个DataTrigger替代动态绑定 -->
<DataTrigger Binding="{Binding Tag}" Value="startup">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="canvas">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="gesture">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="inkrecognition">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="crashaction">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="ppt">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="advanced">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="automation">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="randomwindow">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="theme">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="shortcuts">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
<DataTrigger Binding="{Binding Tag}" Value="about">
<Setter Property="Background" Value="#3b82f6"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<!--输入命令绑定--> <!--输入命令绑定-->
<Window.InputBindings> <Window.InputBindings>
<KeyBinding Gesture="Escape" Command="{StaticResource KeyExit}" /> <KeyBinding Gesture="Escape" Command="{StaticResource KeyExit}" />
@@ -109,13 +172,301 @@
<!--// 设置界面 //--> <!--// 设置界面 //-->
<Grid Panel.ZIndex="999" x:Name="BorderSettingsMask" MouseDown="SettingsOverlayClick" IsHitTestVisible="False" <Grid Panel.ZIndex="999" x:Name="BorderSettingsMask" MouseDown="SettingsOverlayClick" IsHitTestVisible="False"
Margin="0,0,0,0"> Margin="0,0,0,0">
<Border Name="BorderSettings" Background="#ee18181b" ui:ThemeManager.RequestedTheme="Dark" Width="440" <Border Name="BorderSettings" Background="#ee18181b" ui:ThemeManager.RequestedTheme="Dark" Width="490"
HorizontalAlignment="Left" Margin="300,150,0,350" Visibility="Visible"> HorizontalAlignment="Left" Margin="300,150,0,350" Visibility="Visible">
<Grid> <Grid>
<ui:ScrollViewerEx Margin="0,80,0,50" VerticalScrollBarVisibility="Auto" <Grid.ColumnDefinitions>
PanningMode="VerticalOnly" ui:ThemeManager.RequestedTheme="Dark" <ColumnDefinition Width="50"/>
ManipulationBoundaryFeedback="SCManipulationBoundaryFeedback" <ColumnDefinition Width="*"/>
Name="SettingsPanelScrollViewer"> </Grid.ColumnDefinitions>
<!-- Navigation Sidebar -->
<Border Grid.Column="0" Background="#1e1e1e" BorderBrush="#27272a" BorderThickness="0,0,1,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 顶部Logo区域 -->
<Border Grid.Row="0" Height="50" Background="#2d2d30" BorderBrush="#3f3f46" BorderThickness="0,0,0,1">
<Image Width="30" Height="30" Source="/Resources/icc.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
</Border>
<!-- 主要导航按钮 -->
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel>
<!-- Startup -->
<Button Width="40" Height="40" Margin="0,10,0,0" Style="{StaticResource NavButton}"
Click="NavStartup_Click" Tag="startup" ToolTip="启动设置">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M2.81,14.12L5.64,11.29L8.17,10.79C11.39,6.41 17.55,4.22 19.78,4.22C19.78,6.45 17.59,12.61 13.21,15.83L12.71,18.36L9.88,21.19L9.17,17.66C7.76,17.66 7.76,17.66 7.05,16.95C6.34,16.24 6.34,16.24 6.34,14.83L2.81,14.12M5.64,16.95L7.05,18.36L4.39,21.03H2.97V19.61L5.64,16.95M4.22,15.54L5.46,15.71L3,18.16V16.74L4.22,15.54M8.29,18.54L8.46,19.78L7.26,21H5.84L8.29,18.54M13,9.5A1.5,1.5 0 0,0 11.5,11A1.5,1.5 0 0,0 13,12.5A1.5,1.5 0 0,0 14.5,11A1.5,1.5 0 0,0 13,9.5Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- Canvas -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavCanvas_Click" Tag="canvas" ToolTip="画布设置">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M19,1L17.74,3.75L15,5L17.74,6.26L19,9L20.25,6.26L23,5L20.25,3.75M9,4L6.5,9.5L1,12L6.5,14.5L9,20L11.5,14.5L17,12L11.5,9.5"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- Gesture -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavGesture_Click" Tag="gesture" ToolTip="手势设置">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- Ink Recognition -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavInkRecognition_Click" Tag="inkrecognition" ToolTip="墨迹识别">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- Crash Action -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavCrashAction_Click" Tag="crashaction" ToolTip="崩溃处理">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- PPT -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavPPT_Click" Tag="ppt" ToolTip="PPT设置">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M2 2H22V4H2V2M2 8H22V10H2V8M2 14H22V16H2V14M2 20H22V22H2V20Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- Advanced -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavAdvanced_Click" Tag="advanced" ToolTip="高级设置">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- Automation -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavAutomation_Click" Tag="automation" ToolTip="自动化设置">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M12,0C8.96,0 6.21,1.23 4.22,3.22L5.63,4.63C7.24,3.01 9.5,2 12,2C14.5,2 16.76,3.01 18.36,4.63L19.77,3.22C17.79,1.23 15.04,0 12,0M7.05,6.05L8.46,7.46C9.37,6.56 10.62,6 12,6C13.38,6 14.63,6.56 15.54,7.46L16.95,6.05C15.68,4.78 13.93,4 12,4C10.07,4 8.32,4.78 7.05,6.05M12,15A2,2 0 0,1 10,13A2,2 0 0,1 12,11A2,2 0 0,1 14,13A2,2 0 0,1 12,15M15,9H9A1,1 0 0,0 8,10V22A1,1 0 0,0 9,23H15A1,1 0 0,0 16,22V10A1,1 0 0,0 15,9Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- Random Window -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavRandomWindow_Click" Tag="randomwindow" ToolTip="随机窗口设置">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H16L12,22L8,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M4,4V16H8.83L12,19.17L15.17,16H20V4H4M6,7H18V9H6V7M6,11H16V13H6V11Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- 新增:个性化设置 -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavTheme_Click" Tag="theme" ToolTip="个性化设置">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M12,18V6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- 新增:快捷键设置 -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavShortcuts_Click" Tag="shortcuts" ToolTip="快捷键设置">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M20,5H4A2,2 0 0,0 2,7V17A2,2 0 0,0 4,19H20A2,2 0 0,0 22,17V7A2,2 0 0,0 20,5M20,17H4V7H20V17M5,8H7V10H5V8M8,8H10V10H8V8M11,8H13V10H11V8M14,8H16V10H14V8M17,8H19V10H17V8M5,11H7V13H5V11M8,11H10V13H8V11M11,11H13V13H11V11M14,11H16V13H14V11M17,11H19V13H17V11M8,14H16V16H8V14Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<!-- About -->
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
Click="NavAbout_Click" Tag="about" ToolTip="关于">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
</StackPanel>
</ScrollViewer>
<!-- 底部操作按钮 -->
<StackPanel Grid.Row="2" Margin="0,5,0,10">
<Separator Background="#3f3f46" Margin="5,0,5,10"/>
<!-- 折叠侧边栏按钮 -->
<Button Width="40" Height="40" Style="{StaticResource NavButton}"
Click="CollapseNavSidebar_Click" ToolTip="折叠侧边栏">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
</StackPanel>
</Grid>
</Border>
<!-- Content Area -->
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="80"/>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<!-- 标题栏 -->
<Grid ClipToBounds="True" Grid.Row="0" Margin="0,0,0,0" Height="80" VerticalAlignment="Top">
<Border Background="#18181b" CornerRadius="0" Margin="-1,-1,-1,0">
<ui:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center">
<!-- 显示侧边栏按钮 -->
<Button Width="40" Height="40" Margin="10,0,0,0" Style="{StaticResource NavButton}"
Click="ShowNavSidebar_Click" ToolTip="显示侧边栏">
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="White"
Geometry="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"/>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<TextBlock Foreground="White" Margin="15,-2,0,0" Text="设置" FontWeight="Bold"
FontSize="32" />
</ui:SimpleStackPanel>
</Border>
<Canvas>
<Image Canvas.Top="12" Canvas.Right="-16" Width="98" Height="98" Opacity="0.4">
<Image.RenderTransform>
<!-- giving the transform a name tells the framework not to freeze it -->
<RotateTransform CenterX="49" CenterY="49" />
</Image.RenderTransform>
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V257 H257 V0 H0 Z">
<GeometryDrawing Brush="GhostWhite"
Geometry="F0 M257,257z M0,0z M93.339,256.594L88.2444,215.634C85.4849,214.567 82.8846,213.287 80.4434,211.794 78.0023,210.301 75.6142,208.701 73.2793,206.994L35.3887,222.994 0.363831,162.194 33.1598,137.234C32.9476,135.741,32.8414,134.301,32.8414,132.914L32.8414,124.274C32.8414,122.887,32.9476,121.447,33.1598,119.954L0.363831,94.9941 35.3887,34.1941 73.2793,50.1941C75.6142,48.4874 78.0554,46.8874 80.6026,45.3941 83.1499,43.9007 85.6972,42.6207 88.2444,41.5541L93.339,0.594055 163.389,0.594055 168.483,41.5541C171.243,42.6207 173.843,43.9007 176.284,45.3941 178.725,46.8874 181.113,48.4874 183.448,50.1941L221.339,34.1941 256.364,94.9941 223.568,119.954C223.78,121.447,223.886,122.887,223.886,124.274L223.886,132.914C223.886,134.301,223.674,135.741,223.249,137.234L256.045,162.194 221.021,222.994 183.448,206.994C181.113,208.701 178.672,210.301 176.125,211.794 173.578,213.287 171.031,214.567 168.483,215.634L163.389,256.594 93.339,256.594z M160.523,160.274C151.82,169.021 141.312,173.394 129.001,173.394 116.477,173.394 105.916,169.021 97.3191,160.274 88.722,151.527 84.4235,140.967 84.4235,128.594 84.4235,116.221 88.722,105.661 97.3191,96.9141 105.916,88.1674 116.477,83.7941 129.001,83.7941 141.312,83.7941 151.82,88.1674 160.523,96.9141 169.226,105.661 173.578,116.221 173.578,128.594 173.578,140.967 169.226,151.527 160.523,160.274z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
<Image.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetProperty="(Image.RenderTransform).(RotateTransform.Angle)"
To="-360" Duration="0:0:3" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
</Canvas>
</Grid>
<!-- 内容区域 -->
<ui:ScrollViewerEx Grid.Row="1" Margin="0,0,0,0" VerticalScrollBarVisibility="Auto"
PanningMode="VerticalOnly" ui:ThemeManager.RequestedTheme="Dark"
ManipulationBoundaryFeedback="SCManipulationBoundaryFeedback"
Name="SettingsPanelScrollViewer">
<StackPanel Margin="20,20,20,20"> <StackPanel Margin="20,20,20,20">
<Border Margin="0,0,0,10" Height="100" CornerRadius="5" BorderBrush="#a1a1aa" <Border Margin="0,0,0,10" Height="100" CornerRadius="5" BorderBrush="#a1a1aa"
@@ -221,6 +572,80 @@
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</Border> </Border>
<Border Margin="0,0,0,10" Height="100" CornerRadius="5" BorderBrush="#a1a1aa"
BorderThickness="1">
<ui:SimpleStackPanel VerticalAlignment="Center">
<TextBlock Foreground="#fafafa" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="15" Margin="0,0,0,10"
Text="开发中...请不要点击,可能会导致ICC异常崩溃" />
<ui:SimpleStackPanel Spacing="5">
<ui:SimpleStackPanel Spacing="5" Orientation="Horizontal"
HorizontalAlignment="Center">
<Button Width="116" Height="45" FontFamily="Microsoft YaHei UI"
Click="BtnRestart_Click">
<Button.Resources>
</Button.Resources>
<ui:SimpleStackPanel Orientation="Horizontal"
VerticalAlignment="Center"
HorizontalAlignment="Center" Spacing="0">
<Image RenderOptions.BitmapScalingMode="HighQuality"
Margin="0,0,6,0" Height="20" Width="20">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="White"
Geometry="F1 M24,24z M0,0z M6.34315,6.34315C7.84299,4.8433 9.87707,4.0005 11.9981,4 14.2527,4.00897 16.4167,4.88785 18.039,6.45324L18.5858,7 16,7C15.4477,7 15,7.44772 15,8 15,8.55228 15.4477,9 16,9L21,9C21.1356,9 21.2649,8.97301 21.3828,8.92412 21.5007,8.87532 21.6112,8.80298 21.7071,8.70711 21.8902,8.52405 21.9874,8.28768 21.9989,8.04797 21.9996,8.03199 22,8.016 22,8L22,3C22,2.44772 21.5523,2 21,2 20.4477,2 20,2.44772 20,3L20,5.58579 19.4471,5.03289 19.435,5.02103C17.4405,3.09289,14.7779,2.01044,12.0038,2L12,2C9.34784,2 6.8043,3.05357 4.92893,4.92893 3.05357,6.8043 2,9.34784 2,12 2,12.5523 2.44772,13 3,13 3.55228,13 4,12.5523 4,12 4,9.87827 4.84285,7.84344 6.34315,6.34315z" />
<GeometryDrawing Brush="White"
Geometry="F1 M24,24z M0,0z M22,12C22,14.6522 20.9464,17.1957 19.0711,19.0711 17.1957,20.9464 14.6522,22 12,22L11.9962,22C9.22213,21.9896,6.55946,20.9071,4.56496,18.979L4.55289,18.9671 4,18.4142 4,21C4,21.5523 3.55228,22 3,22 2.44772,22 2,21.5523 2,21L2,16.0002C2,15.8646 2.02699,15.7351 2.07588,15.6172 2.12432,15.5001 2.19595,15.3904 2.29078,15.295 2.29219,15.2936 2.2936,15.2922 2.29502,15.2908 2.48924,15.0977 2.74301,15.0008 2.997,15 2.998,15 2.999,15 3,15L8,15C8.55228,15 9,15.4477 9,16 9,16.5523 8.55228,17 8,17L5.41421,17 5.96095,17.5467C7.5833,19.1122 9.74736,19.9911 12.002,20 14.123,19.9995 16.157,19.1567 17.6569,17.6569 19.1571,16.1566 20,14.1217 20,12 20,11.4477 20.4477,11 21,11 21.5523,11 22,11.4477 22,12z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<Label FontSize="16" Foreground="#fafafa"
VerticalAlignment="Center" FontFamily="Microsoft YaHei UI"
FontWeight="Bold">
测试
</Label>
</ui:SimpleStackPanel>
</Button>
<Button Width="116" Height="45" FontFamily="Microsoft YaHei UI"
Click="BtnResetToSuggestion_Click"
Margin="0,0,0,0">
<ui:SimpleStackPanel Orientation="Horizontal"
VerticalAlignment="Center"
HorizontalAlignment="Center" Spacing="0">
<Image
Margin="0,0,4,0" RenderOptions.BitmapScalingMode="HighQuality"
Height="20" Width="20">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="White"
Geometry="F1 M24,24z M0,0z M2,6C2,5.44772,2.44772,5,3,5L21,5C21.5523,5 22,5.44772 22,6 22,6.55228 21.5523,7 21,7L3,7C2.44772,7,2,6.55228,2,6z" />
<GeometryDrawing Brush="White"
Geometry="F1 M24,24z M0,0z M2,12C2,11.4477,2.44772,11,3,11L7,11C7.55228,11 8,11.4477 8,12 8,12.5523 7.55228,13 7,13L3,13C2.44772,13,2,12.5523,2,12z" />
<GeometryDrawing Brush="White"
Geometry="F1 M24,24z M0,0z M3,17C2.44772,17 2,17.4477 2,18 2,18.5523 2.44772,19 3,19L7,19C7.55228,19 8,18.5523 8,18 8,17.4477 7.55228,17 7,17L3,17z" />
<GeometryDrawing Brush="White"
Geometry="F1 M24,24z M0,0z M12.3829,11.2029C13.4335,10.1522 14.8952,9.5 16.5,9.5 17.9587,9.5 19.3576,10.0795 20.3891,11.1109 21.4205,12.1424 22,13.5413 22,15 22,16.2593 21.6038,17.4867 20.8675,18.5083 20.1311,19.5299 19.092,20.2939 17.8974,20.6921 16.7027,21.0903 15.413,21.1026 14.211,20.7271 13.009,20.3516 11.9556,19.6074 11.2,18.6 10.8686,18.1582 10.9582,17.5314 11.4,17.2 11.8418,16.8686 12.4686,16.9582 12.8,17.4 13.3037,18.0716 14.006,18.5677 14.8073,18.8181 15.6087,19.0684 16.4685,19.0602 17.2649,18.7947 18.0614,18.5292 18.7541,18.0199 19.245,17.3388 19.7359,16.6578 20,15.8395 20,15 20,14.0717 19.6313,13.1815 18.9749,12.5251 18.3185,11.8687 17.4283,11.5 16.5,11.5 15.4448,11.5 14.4865,11.9278 13.7971,12.6171L13.4142,13 15,13C15.5523,13 16,13.4477 16,14 16,14.5523 15.5523,15 15,15L11.0007,15C10.9997,15 10.998,15 10.997,15 10.8625,14.9996 10.7343,14.9727 10.6172,14.9241 10.5001,14.8757 10.3904,14.804 10.295,14.7092 10.2936,14.7078 10.2922,14.7064 10.2908,14.705 10.196,14.6096 10.1243,14.4999 10.0759,14.3828 10.027,14.2649 10,14.1356 10,14L10,10C10,9.44772 10.4477,9 11,9 11.5523,9 12,9.44772 12,10L12,11.5858 12.3829,11.2029z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<Label Margin="2,0,0,0" FontSize="16" VerticalAlignment="Center"
FontFamily="Microsoft YaHei UI">
测试
</Label>
</ui:SimpleStackPanel>
</Button>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</Border>
<GroupBox> <GroupBox>
<GroupBox.Header> <GroupBox.Header>
<TextBlock Margin="0,12,0,0" Text="启动" FontWeight="Bold" Foreground="#fafafa" <TextBlock Margin="0,12,0,0" Text="启动" FontWeight="Bold" Foreground="#fafafa"
@@ -303,6 +728,23 @@
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchShowCursor_Toggled" /> Toggled="ToggleSwitchShowCursor_Toggled" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="启用压感触屏模式" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchEnablePressureTouchMode"
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchEnablePressureTouchMode_Toggled" />
</ui:SimpleStackPanel>
<TextBlock Text="# 开启后,触屏设备也将支持压感效果,适用于部分支持压感但无法被系统识别的触屏设备。" TextWrapping="Wrap" Foreground="#a1a1aa" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="屏蔽压感" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchDisablePressure"
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchDisablePressure_Toggled" />
</ui:SimpleStackPanel>
<TextBlock Text="# 开启后,将忽略所有设备的压感信息,使所有笔画具有统一的粗细。与压感触屏模式互斥。" TextWrapping="Wrap" Foreground="#a1a1aa" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="橡皮大小" VerticalAlignment="Center" <TextBlock Foreground="#fafafa" Text="橡皮大小" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" /> FontSize="14" Margin="0,0,16,0" />
@@ -361,6 +803,25 @@
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</GroupBox> </GroupBox>
<!-- 新增:崩溃后操作设置 -->
<GroupBox>
<GroupBox.Header>
<TextBlock Margin="0,12,0,0" Text="崩溃后操作" FontWeight="Bold" Foreground="#fafafa"
FontSize="26" />
</GroupBox.Header>
<ui:SimpleStackPanel Spacing="6">
<TextBlock Text="请选择软件发生未处理异常时的自动操作:" Foreground="#a1a1aa" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,4,0,0">
<RadioButton x:Name="RadioCrashSilentRestart" GroupName="CrashAction"
Content="静默重启软件" FontSize="14" Margin="0,0,24,0"
Checked="RadioCrashAction_Checked"/>
<RadioButton x:Name="RadioCrashNoAction" GroupName="CrashAction"
Content="无操作" FontSize="14"
Checked="RadioCrashAction_Checked"/>
</StackPanel>
<TextBlock Text="# 静默重启:崩溃后自动重启软件,无提示。无操作:崩溃后仅记录日志,不自动重启。" Foreground="#a1a1aa" />
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox> <GroupBox>
<GroupBox.Header> <GroupBox.Header>
<TextBlock Margin="0,12,0,0" Text="手势" FontWeight="Bold" Foreground="#fafafa" <TextBlock Margin="0,12,0,0" Text="手势" FontWeight="Bold" Foreground="#fafafa"
@@ -460,7 +921,56 @@
</CheckBox> </CheckBox>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="直线自动拉直" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchAutoStraightenLine"
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchAutoStraightenLine_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"
Visibility="{Binding ElementName=ToggleSwitchAutoStraightenLine, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock Foreground="#fafafa" Text="长度阈值" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<Slider Name="AutoStraightenLineThresholdSlider" Width="150" Minimum="30" Maximum="300"
Value="30" TickFrequency="30" IsSnapToTickEnabled="True"
ValueChanged="AutoStraightenLineThresholdSlider_ValueChanged" />
<TextBlock Foreground="#fafafa" Text="{Binding ElementName=AutoStraightenLineThresholdSlider, Path=Value, StringFormat={}{0:0}}"
VerticalAlignment="Center" FontSize="14" Margin="16,0,0,0" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"
Visibility="{Binding ElementName=ToggleSwitchAutoStraightenLine, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock Foreground="#fafafa" Text="灵敏度" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<Slider Name="LineStraightenSensitivitySlider" Width="150" Minimum="0.05" Maximum="0.75"
Value="0.10" TickFrequency="0.05" IsSnapToTickEnabled="True"
ValueChanged="LineStraightenSensitivitySlider_ValueChanged" />
<TextBlock Foreground="#fafafa" Text="{Binding ElementName=LineStraightenSensitivitySlider, Path=Value, StringFormat={}{0:F2}}"
VerticalAlignment="Center" FontSize="14" Margin="16,0,0,0" />
</ui:SimpleStackPanel>
<TextBlock Text="# 开启后,当绘制的直线超过设定长度阈值时,将自动调整为完美直线。灵敏度范围0.05-0.75,越小要求越严格,弯曲的线条越不容易被拉直;值越大越容易识别为直线。" TextWrapping="Wrap" Foreground="#a1a1aa" />
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="直线端点吸附" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchLineEndpointSnapping"
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchLineEndpointSnapping_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"
Visibility="{Binding ElementName=ToggleSwitchLineEndpointSnapping, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock Foreground="#fafafa" Text="吸附距离" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<Slider Name="LineEndpointSnappingThresholdSlider" Width="150" Minimum="5" Maximum="50"
Value="15" TickFrequency="5" IsSnapToTickEnabled="True"
ValueChanged="LineEndpointSnappingThresholdSlider_ValueChanged" />
<TextBlock Foreground="#fafafa" Text="{Binding ElementName=LineEndpointSnappingThresholdSlider, Path=Value, StringFormat={}{0:0}}"
VerticalAlignment="Center" FontSize="14" Margin="16,0,0,0" />
</ui:SimpleStackPanel>
<TextBlock Text="# 开启后,当绘制的直线端点靠近其他直线端点时,将自动吸附连接。" TextWrapping="Wrap" Foreground="#a1a1aa" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</GroupBox> </GroupBox>
<GroupBox Name="GroupBoxAppearanceNewUI"> <GroupBox Name="GroupBoxAppearanceNewUI">
@@ -475,8 +985,8 @@
<ComboBox Name="ComboBoxFloatingBarImg" FontFamily="Microsoft YaHei UI" <ComboBox Name="ComboBoxFloatingBarImg" FontFamily="Microsoft YaHei UI"
SelectedIndex="0" SelectedIndex="0"
SelectionChanged="ComboBoxFloatingBarImg_SelectionChanged"> SelectionChanged="ComboBoxFloatingBarImg_SelectionChanged">
<ComboBoxItem Content="“icc!”默认蓝色" FontFamily="Microsoft YaHei UI" /> <ComboBoxItem Content="“ICC-CE”默认" FontFamily="Microsoft YaHei UI" />
<ComboBoxItem Content="“icc!”黑色透明版" FontFamily="Microsoft YaHei UI" /> <ComboBoxItem Content="“ICC-CE”黑色透明版" FontFamily="Microsoft YaHei UI" />
<ComboBoxItem Content="酷安斗鸡眼滑稽" FontFamily="Microsoft YaHei UI" /> <ComboBoxItem Content="酷安斗鸡眼滑稽" FontFamily="Microsoft YaHei UI" />
<ComboBoxItem Content="酷安受虐滑稽" FontFamily="Microsoft YaHei UI" /> <ComboBoxItem Content="酷安受虐滑稽" FontFamily="Microsoft YaHei UI" />
<ComboBoxItem Content="酷安呲牙笑" FontFamily="Microsoft YaHei UI" /> <ComboBoxItem Content="酷安呲牙笑" FontFamily="Microsoft YaHei UI" />
@@ -1207,6 +1717,40 @@
<TextBlock TextWrapping="Wrap" Foreground="#a1a1aa" <TextBlock TextWrapping="Wrap" Foreground="#a1a1aa"
Text="# 感谢lindexi大佬提供的FullScreenHelper,可以减少任务栏弹出的问题,且支持多显示器自动全屏(虽然对icc来说没什么用就是了),如果遇到一些玄学问题,可以关闭该功能,重启icc后生效。" /> Text="# 感谢lindexi大佬提供的FullScreenHelper,可以减少任务栏弹出的问题,且支持多显示器自动全屏(虽然对icc来说没什么用就是了),如果遇到一些玄学问题,可以关闭该功能,重启icc后生效。" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="启用AvoidFullScreenHelper"
VerticalAlignment="Center"
FontSize="14" Margin="0,0,6,0" />
<Border Height="20" CornerRadius="3" Background="#7f1d1d" Margin="0,0,12,0"
Padding="4,0">
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="3"
VerticalAlignment="Center">
<Image Width="15" Height="15" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#fca5a5"
Geometry="F1 M24,24z M0,0z M20.1758,20.0951L15.1058,9.97512C15.0358,9.83512,14.9958,9.68512,14.9958,9.52512L14.9958,2.99512 15.4958,2.99512C16.0458,2.99512 16.4958,2.54512 16.4958,1.99512 16.4958,1.44512 16.0458,0.995117 15.4958,0.995117L8.49582,0.995117C7.94582,0.995117 7.49582,1.44512 7.49582,1.99512 7.49582,2.54512 7.94582,2.99512 8.49582,2.99512L8.99582,2.99512 8.99582,9.52512C8.99582,9.67512,8.95582,9.83512,8.89582,9.97512L3.82582,20.0951C3.67582,20.4051 3.59582,20.7451 3.61582,21.0851 3.62582,21.4251 3.73582,21.7651 3.91582,22.0551 4.09582,22.3451 4.34582,22.5851 4.64582,22.7551 4.94582,22.9151 5.27582,23.0051 5.60582,23.0051L18.3758,23.0051C18.7558,23.0051 19.0558,22.9251 19.3558,22.7551 19.6558,22.5851 19.9058,22.3451 20.0858,22.0551 20.2658,21.7651 20.3658,21.4351 20.3858,21.0851 20.3958,20.7451 20.3258,20.4051 20.1758,20.1051L20.1758,20.0951z M10.6858,10.8651C10.8958,10.4451,11.0058,9.98512,11.0058,9.52512L11.0058,2.99512 13.0058,2.99512 13.0058,9.52512C13.0058,9.98512,13.1158,10.4551,13.3258,10.8651L15.3858,14.9951 8.62582,14.9951 10.6958,10.8651 10.6858,10.8651z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Foreground="#fca5a5" Text="实验性选项" FontSize="12"
VerticalAlignment="Center">
</TextBlock>
</ui:SimpleStackPanel>
</Border>
<ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchIsEnableAvoidFullScreenHelper"
Toggled="ToggleSwitchIsEnableAvoidFullScreenHelper_OnToggled"
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" />
</ui:SimpleStackPanel>
<TextBlock TextWrapping="Wrap" Foreground="#a1a1aa"
Text="# 避免画布全屏,重启icc后生效。" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="启用EdgeGestureUtil" <TextBlock Foreground="#fafafa" Text="启用EdgeGestureUtil"
VerticalAlignment="Center" VerticalAlignment="Center"
FontSize="14" Margin="0,0,6,0" /> FontSize="14" Margin="0,0,6,0" />
@@ -1690,7 +2234,7 @@
<Image Source="/Resources/Icons-png/InkCanvas.png" Margin="0,0,6,0" <Image Source="/Resources/Icons-png/InkCanvas.png" Margin="0,0,6,0"
Width="28" Width="28"
Height="28" VerticalAlignment="Center" /> Height="28" VerticalAlignment="Center" />
<TextBlock Foreground="#fafafa" Text="自动查杀 Ink Canvas" <TextBlock Foreground="#fafafa" Text="自动查杀 Ink Canvas 和 IC+"
VerticalAlignment="Center" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" /> FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent="" <ui:ToggleSwitch OnContent="" OffContent=""
@@ -1714,7 +2258,7 @@
<Image Source="/Resources/Icons-png/idt.png" Margin="0,0,6,0" <Image Source="/Resources/Icons-png/idt.png" Margin="0,0,6,0"
Width="28" Width="28"
Height="28" VerticalAlignment="Center" /> Height="28" VerticalAlignment="Center" />
<TextBlock Foreground="#fafafa" Text="自动查杀智绘教" VerticalAlignment="Center" <TextBlock Foreground="#fafafa" Text="自动查杀 智绘教Inkeys(仅限新版)" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" /> FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent="" <ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchAutoKillIDT" Name="ToggleSwitchAutoKillIDT"
@@ -1768,7 +2312,8 @@
<TextBlock Foreground="#fafafa" Text="墨迹与截图的保存路径" VerticalAlignment="Center" <TextBlock Foreground="#fafafa" Text="墨迹与截图的保存路径" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" /> FontSize="14" Margin="0,0,16,0" />
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="10"> <ui:SimpleStackPanel Orientation="Horizontal" Spacing="10">
<TextBox Width="320" x:Name="AutoSavedStrokesLocation" Text="D:\Ink Canvas" <TextBox Width="320" x:Name="AutoSavedStrokesLocation"
Text="{Binding AppDomain.CurrentDomain.BaseDirectory, StringFormat={}Saves}"
TextWrapping="Wrap" TextWrapping="Wrap"
TextChanged="AutoSavedStrokesLocationTextBox_TextChanged" /> TextChanged="AutoSavedStrokesLocationTextBox_TextChanged" />
<Button Name="AutoSavedStrokesLocationButton" Content="浏览" <Button Name="AutoSavedStrokesLocationButton" Content="浏览"
@@ -1837,6 +2382,15 @@
FontWeight="Bold" FontWeight="Bold"
Toggled="ToggleSwitchDisplayRandWindowNamesInputBtn_OnToggled" /> Toggled="ToggleSwitchDisplayRandWindowNamesInputBtn_OnToggled" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="启用随机抽和单次抽按钮"
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchShowRandomAndSingleDraw"
IsOn="True" FontFamily="Microsoft YaHei UI"
FontWeight="Bold"
Toggled="ToggleSwitchShowRandomAndSingleDraw_Toggled" />
</ui:SimpleStackPanel>
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" <Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" /> Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
@@ -1878,7 +2432,7 @@
<ui:SimpleStackPanel Orientation="Horizontal"> <ui:SimpleStackPanel Orientation="Horizontal">
<TextBlock FontSize="18" FontWeight="Bold" Text="Version" /> <TextBlock FontSize="18" FontWeight="Bold" Text="Version" />
<TextBlock x:Name="AppVersionTextBlock" FontSize="18" FontWeight="Bold" <TextBlock x:Name="AppVersionTextBlock" FontSize="18" FontWeight="Bold"
Text="5.X.X.X" /> Text="1.X.X.X" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<TextBlock <TextBlock
Text="# 使用和分发本软件前,请您应当且务必知晓相关开源协议,且您应当知晓本软件基于 https://github.com/WXRIW/Ink-Canvas 修改而成。" Text="# 使用和分发本软件前,请您应当且务必知晓相关开源协议,且您应当知晓本软件基于 https://github.com/WXRIW/Ink-Canvas 修改而成。"
@@ -2192,55 +2746,41 @@
</GroupBox> </GroupBox>
</StackPanel> </StackPanel>
</ui:ScrollViewerEx> </ui:ScrollViewerEx>
<Grid ClipToBounds="True" Margin="0,0,0,0" Height="80" VerticalAlignment="Top">
<Border Background="#18181b" CornerRadius="0" Margin="-1,-1,-1,0"> <!-- 底部按钮区域 -->
<ui:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center"> <Grid Grid.Row="2" VerticalAlignment="Bottom" Height="50">
<TextBlock Foreground="White" Margin="25,-2,0,0" Text="设置" FontWeight="Bold" <Button FontFamily="Microsoft YaHei UI"
FontSize="32" />
</ui:SimpleStackPanel>
</Border>
<Canvas>
<Image Canvas.Top="12" Canvas.Right="-16" Width="98" Height="98" Opacity="0.4">
<Image.RenderTransform>
<!-- giving the transform a name tells the framework not to freeze it -->
<RotateTransform CenterX="49" CenterY="49" />
</Image.RenderTransform>
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V257 H257 V0 H0 Z">
<GeometryDrawing Brush="GhostWhite"
Geometry="F0 M257,257z M0,0z M93.339,256.594L88.2444,215.634C85.4849,214.567 82.8846,213.287 80.4434,211.794 78.0023,210.301 75.6142,208.701 73.2793,206.994L35.3887,222.994 0.363831,162.194 33.1598,137.234C32.9476,135.741,32.8414,134.301,32.8414,132.914L32.8414,124.274C32.8414,122.887,32.9476,121.447,33.1598,119.954L0.363831,94.9941 35.3887,34.1941 73.2793,50.1941C75.6142,48.4874 78.0554,46.8874 80.6026,45.3941 83.1499,43.9007 85.6972,42.6207 88.2444,41.5541L93.339,0.594055 163.389,0.594055 168.483,41.5541C171.243,42.6207 173.843,43.9007 176.284,45.3941 178.725,46.8874 181.113,48.4874 183.448,50.1941L221.339,34.1941 256.364,94.9941 223.568,119.954C223.78,121.447,223.886,122.887,223.886,124.274L223.886,132.914C223.886,134.301,223.674,135.741,223.249,137.234L256.045,162.194 221.021,222.994 183.448,206.994C181.113,208.701 178.672,210.301 176.125,211.794 173.578,213.287 171.031,214.567 168.483,215.634L163.389,256.594 93.339,256.594z M160.523,160.274C151.82,169.021 141.312,173.394 129.001,173.394 116.477,173.394 105.916,169.021 97.3191,160.274 88.722,151.527 84.4235,140.967 84.4235,128.594 84.4235,116.221 88.722,105.661 97.3191,96.9141 105.916,88.1674 116.477,83.7941 129.001,83.7941 141.312,83.7941 151.82,88.1674 160.523,96.9141 169.226,105.661 173.578,116.221 173.578,128.594 173.578,140.967 169.226,151.527 160.523,160.274z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
<Image.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetProperty="(Image.RenderTransform).(RotateTransform.Angle)"
To="-360" Duration="0:0:3" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
</Canvas>
</Grid>
<Grid VerticalAlignment="Bottom" Height="50">
<Button FontFamily="Microsoft YaHei UI"
Width="120" Margin="10" Width="120" Margin="10"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Content="关闭" Click="BtnCloseSettings_Click">
Click="BtnSettings_Click" /> <ui:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center"
</Grid> HorizontalAlignment="Center" Spacing="0">
</Grid> <Image RenderOptions.BitmapScalingMode="HighQuality"
Margin="0,0,6,0" Height="20" Width="20">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="White"
Geometry="M19,6.41 L17.59,5 L12,10.59 L6.41,5 L5,6.41 L10.59,12 L5,17.59 L6.41,19 L12,13.41 L17.59,19 L19,17.59 L13.41,12 Z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<Label FontSize="16" Foreground="#fafafa" VerticalAlignment="Center"
FontFamily="Microsoft YaHei UI" FontWeight="Bold">
关闭
</Label>
</ui:SimpleStackPanel>
</Button>
</Grid>
</Grid></Grid>
</Border> </Border>
</Grid> </Grid>
<!--// 黑/白 板幕布 //--> <!--// 黑/白 板幕布 //-->
<Grid Name="GridBackgroundCoverHolder"> <Grid Name="GridBackgroundCoverHolder">
<Grid Name="GridBackgroundCover" Visibility="Collapsed" Background="#1F1F1F"> <Grid Name="GridBackgroundCover" Visibility="Collapsed" Background="#1F1F1F">
@@ -2253,7 +2793,7 @@
<Grid Name="GridTransparencyFakeBackground" Opacity="0" /> <Grid Name="GridTransparencyFakeBackground" Opacity="0" />
<Label Name="Label" Visibility="Collapsed" Foreground="Gray" Content="0" /> <Label Name="Label" Visibility="Collapsed" Foreground="Gray" Content="0" />
<Grid Name="InkCanvasGridForInkReplay"> <Grid Name="InkCanvasGridForInkReplay">
<InkCanvas x:Name="inkCanvas" ForceCursor="False" <InkCanvas x:Name="inkCanvas" ForceCursor="True" UseCustomCursor="True"
TouchUp="Main_Grid_TouchUp" TouchDown="Main_Grid_TouchDown" TouchUp="Main_Grid_TouchUp" TouchDown="Main_Grid_TouchDown"
TouchMove="inkCanvas_TouchMove" TouchMove="inkCanvas_TouchMove"
ManipulationDelta="Main_Grid_ManipulationDelta" ManipulationDelta="Main_Grid_ManipulationDelta"
@@ -4258,7 +4798,7 @@
<Label Content="计时器" FontSize="8" <Label Content="计时器" FontSize="8"
HorizontalAlignment="Center" /> HorizontalAlignment="Center" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel MouseDown="Border_MouseDown" <ui:SimpleStackPanel x:Name="RandomDrawPanel" Visibility="Collapsed" MouseDown="Border_MouseDown"
MouseUp="SymbolIconRand_MouseUp" MouseUp="SymbolIconRand_MouseUp"
Margin="0,0,0,0" Height="38" Width="32" Margin="0,0,0,0" Height="38" Width="32"
Orientation="Vertical"> Orientation="Vertical">
@@ -4278,7 +4818,7 @@
<Label Content="随机抽" FontSize="8" <Label Content="随机抽" FontSize="8"
HorizontalAlignment="Center" /> HorizontalAlignment="Center" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel MouseDown="Border_MouseDown" <ui:SimpleStackPanel x:Name="SingleDrawPanel" Visibility="Collapsed" MouseDown="Border_MouseDown"
MouseUp="SymbolIconRandOne_MouseUp" MouseUp="SymbolIconRandOne_MouseUp"
Margin="0,0,0,0" Height="38" Width="32" Margin="0,0,0,0" Height="38" Width="32"
Orientation="Vertical"> Orientation="Vertical">
+460 -22
View File
@@ -17,6 +17,11 @@ using System.Drawing;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Win32; using Microsoft.Win32;
using System.Windows.Input;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media.Animation;
using System.Reflection;
namespace Ink_Canvas { namespace Ink_Canvas {
public partial class MainWindow : Window { public partial class MainWindow : Window {
@@ -47,8 +52,11 @@ namespace Ink_Canvas {
ViewBoxStackPanelMain.Visibility = Visibility.Collapsed; ViewBoxStackPanelMain.Visibility = Visibility.Collapsed;
ViewBoxStackPanelShapes.Visibility = Visibility.Collapsed; ViewBoxStackPanelShapes.Visibility = Visibility.Collapsed;
ViewboxFloatingBar.Margin = new Thickness((SystemParameters.WorkArea.Width - 284) / 2, var workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;
SystemParameters.WorkArea.Height - 60, -2000, -200); ViewboxFloatingBar.Margin = new Thickness(
(workingArea.Width - 284) / 2,
workingArea.Bottom - 60 - workingArea.Top,
-2000, -200);
ViewboxFloatingBarMarginAnimation(100, true); ViewboxFloatingBarMarginAnimation(100, true);
try { try {
@@ -95,6 +103,12 @@ namespace Ink_Canvas {
CheckColorTheme(true); CheckColorTheme(true);
CheckPenTypeUIState(); CheckPenTypeUIState();
// 注册输入事件
inkCanvas.PreviewMouseDown += inkCanvas_PreviewMouseDown;
inkCanvas.StylusDown += inkCanvas_StylusDown;
inkCanvas.TouchDown += inkCanvas_TouchDown;
inkCanvas.TouchUp += inkCanvas_TouchUp;
} }
#endregion #endregion
@@ -144,14 +158,9 @@ namespace Ink_Canvas {
private void inkCanvas_EditingModeChanged(object sender, RoutedEventArgs e) { private void inkCanvas_EditingModeChanged(object sender, RoutedEventArgs e) {
var inkCanvas1 = sender as InkCanvas; var inkCanvas1 = sender as InkCanvas;
if (inkCanvas1 == null) return; if (inkCanvas1 == null) return;
if (Settings.Canvas.IsShowCursor) {
if (inkCanvas1.EditingMode == InkCanvasEditingMode.Ink || drawingShapeMode != 0) // 使用辅助方法设置光标
inkCanvas1.ForceCursor = true; SetCursorBasedOnEditingMode(inkCanvas1);
else
inkCanvas1.ForceCursor = false;
} else {
inkCanvas1.ForceCursor = false;
}
if (inkCanvas1.EditingMode == InkCanvasEditingMode.Ink) forcePointEraser = !forcePointEraser; if (inkCanvas1.EditingMode == InkCanvasEditingMode.Ink) forcePointEraser = !forcePointEraser;
} }
@@ -199,6 +208,17 @@ namespace Ink_Canvas {
} }
SystemEvents.DisplaySettingsChanged += SystemEventsOnDisplaySettingsChanged; SystemEvents.DisplaySettingsChanged += SystemEventsOnDisplaySettingsChanged;
// 自动收纳到侧边栏
if (Settings.Startup.IsFoldAtStartup)
{
FoldFloatingBar_MouseUp(null, null);
}
// 恢复崩溃后操作设置
if (App.CrashAction == App.CrashActionType.SilentRestart)
RadioCrashSilentRestart.IsChecked = true;
else
RadioCrashNoAction.IsChecked = true;
} }
private void SystemEventsOnDisplaySettingsChanged(object sender, EventArgs e) { private void SystemEventsOnDisplaySettingsChanged(object sender, EventArgs e) {
@@ -265,7 +285,7 @@ namespace Ink_Canvas {
[DllImport("user32.dll", SetLastError = true)] [DllImport("user32.dll", SetLastError = true)]
public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
private void MainWindow_OnSizeChanged(object sender, SizeChangedEventArgs e) { private void MainWindow_OnSizeChanged(object sender, SizeChangedEventArgs e) {
if (Settings.Advanced.IsEnableForceFullScreen) { if (Settings.Advanced.IsEnableForceFullScreen) {
if (isLoaded) ShowNotification( if (isLoaded) ShowNotification(
@@ -277,34 +297,452 @@ namespace Ink_Canvas {
} }
} }
private void Window_Closed(object sender, EventArgs e) { private void Window_Closed(object sender, EventArgs e) {
SystemEvents.DisplaySettingsChanged -= SystemEventsOnDisplaySettingsChanged; SystemEvents.DisplaySettingsChanged -= SystemEventsOnDisplaySettingsChanged;
LogHelper.WriteLogToFile("Ink Canvas closed", LogHelper.LogType.Event); LogHelper.WriteLogToFile("Ink Canvas closed", LogHelper.LogType.Event);
// 检查是否有待安装的更新
CheckPendingUpdates();
}
private void CheckPendingUpdates()
{
try
{
// 如果有可用的更新版本且启用了自动更新
if (AvailableLatestVersion != null && Settings.Startup.IsAutoUpdate)
{
// 检查更新文件是否已下载
string updatesFolderPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "AutoUpdate");
string statusFilePath = Path.Combine(updatesFolderPath, $"DownloadV{AvailableLatestVersion}Status.txt");
if (File.Exists(statusFilePath) && File.ReadAllText(statusFilePath).Trim().ToLower() == "true")
{
LogHelper.WriteLogToFile($"AutoUpdate | Installing pending update v{AvailableLatestVersion} on application close");
// 设置为用户主动退出,避免被看门狗判定为崩溃
App.IsAppExitByUser = true;
// 创建批处理脚本并启动,软件关闭后会执行更新操作
AutoUpdateHelper.InstallNewVersionApp(AvailableLatestVersion, true);
}
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | Error checking pending updates: {ex.Message}", LogHelper.LogType.Error);
}
} }
private async void AutoUpdate() { private async void AutoUpdate() {
AvailableLatestVersion = await AutoUpdateHelper.CheckForUpdates(); AvailableLatestVersion = await AutoUpdateHelper.CheckForUpdates();
if (AvailableLatestVersion != null) { if (AvailableLatestVersion != null) {
var IsDownloadSuccessful = false; // 打开更新提示窗口
IsDownloadSuccessful = await AutoUpdateHelper.DownloadSetupFileAndSaveStatus(AvailableLatestVersion); LogHelper.WriteLogToFile($"AutoUpdate | New version available: {AvailableLatestVersion}");
// 获取当前版本和发布日期
string currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
string releaseDate = DateTime.Now.ToString("yyyy年MM月dd日");
// 创建更新说明内容(可以从服务器获取或直接在此处设置)
string releaseNotes = $@"# InkCanvasForClass v{AvailableLatestVersion}更新
你好,此次更新包含了一系列新功能和改进:
if (IsDownloadSuccessful) { 1. 修复了一些已知的bug
if (!Settings.Startup.IsAutoUpdateWithSilence) { 2. 优化了程序性能
if (MessageBox.Show("InkCanvasForClass 新版本安装包已下载完成,是否立即更新?", 3. 改进了用户界面
"InkCanvasForClass New Version Available", MessageBoxButton.YesNo, 4. 添加了新的功能
MessageBoxImage.Question) ==
MessageBoxResult.Yes) AutoUpdateHelper.InstallNewVersionApp(AvailableLatestVersion, false); 感谢您使用InkCanvasForClass CE";
} else {
timerCheckAutoUpdateWithSilence.Start(); // 创建并显示更新窗口
} HasNewUpdateWindow updateWindow = new HasNewUpdateWindow(currentVersion, AvailableLatestVersion, releaseDate, releaseNotes);
bool? dialogResult = updateWindow.ShowDialog();
// 如果窗口被关闭但没有点击按钮,视为"稍后更新"
if (dialogResult != true) {
LogHelper.WriteLogToFile("AutoUpdate | Update dialog closed without selection");
return;
}
// 更新自动更新设置并保存
Settings.Startup.IsAutoUpdate = updateWindow.IsAutoUpdateEnabled;
Settings.Startup.IsAutoUpdateWithSilence = updateWindow.IsSilentUpdateEnabled;
SaveSettingsToFile();
// 声明下载结果变量
bool isDownloadSuccessful;
// 根据用户选择处理更新
switch (updateWindow.Result) {
case HasNewUpdateWindow.UpdateResult.UpdateNow:
// 立即更新:显示下载进度,下载完成后立即安装
LogHelper.WriteLogToFile("AutoUpdate | User chose to update now");
// 显示下载进度提示
MessageBox.Show("开始下载更新,请稍候...", "正在更新", MessageBoxButton.OK, MessageBoxImage.Information);
// 下载更新文件
isDownloadSuccessful = await AutoUpdateHelper.DownloadSetupFileAndSaveStatus(AvailableLatestVersion);
if (isDownloadSuccessful) {
// 下载成功,提示用户准备安装
MessageBoxResult result = MessageBox.Show("更新已下载完成,点击确定后将关闭软件并安装新版本!", "安装更新", MessageBoxButton.OKCancel, MessageBoxImage.Information);
// 只有当用户点击确定按钮后才关闭软件
if (result == MessageBoxResult.OK) {
// 设置为用户主动退出,避免被看门狗判定为崩溃
App.IsAppExitByUser = true;
// 准备批处理脚本
AutoUpdateHelper.InstallNewVersionApp(AvailableLatestVersion, false);
// 关闭软件,让安装程序接管
Application.Current.Shutdown();
} else {
LogHelper.WriteLogToFile("AutoUpdate | User cancelled update installation");
}
} else {
// 下载失败
MessageBox.Show("更新下载失败,请检查网络连接后重试。", "下载失败", MessageBoxButton.OK, MessageBoxImage.Error);
}
break;
case HasNewUpdateWindow.UpdateResult.UpdateLater:
// 稍后更新:静默下载,在软件关闭时自动安装
LogHelper.WriteLogToFile("AutoUpdate | User chose to update later");
// 不管设置如何,都进行下载
isDownloadSuccessful = await AutoUpdateHelper.DownloadSetupFileAndSaveStatus(AvailableLatestVersion);
if (isDownloadSuccessful) {
LogHelper.WriteLogToFile("AutoUpdate | Update downloaded successfully, will install when application closes");
// 设置标志,在应用程序关闭时安装
Settings.Startup.IsAutoUpdate = true;
Settings.Startup.IsAutoUpdateWithSilence = true;
// 启动检查定时器
timerCheckAutoUpdateWithSilence.Start();
// 通知用户
MessageBox.Show("更新已下载完成,将在软件关闭时自动安装。", "更新已准备就绪", MessageBoxButton.OK, MessageBoxImage.Information);
} else {
LogHelper.WriteLogToFile("AutoUpdate | Update download failed", LogHelper.LogType.Error);
MessageBox.Show("更新下载失败,请检查网络连接后重试。", "下载失败", MessageBoxButton.OK, MessageBoxImage.Error);
}
break;
case HasNewUpdateWindow.UpdateResult.SkipVersion:
// 跳过该版本:记录到设置中
LogHelper.WriteLogToFile($"AutoUpdate | User chose to skip version {AvailableLatestVersion}");
// 可以在设置中添加"已跳过的版本"列表
break;
} }
} else { } else {
AutoUpdateHelper.DeleteUpdatesFolder(); AutoUpdateHelper.DeleteUpdatesFolder();
} }
} }
// 新增:崩溃后操作设置按钮事件
private void RadioCrashAction_Checked(object sender, RoutedEventArgs e)
{
if (RadioCrashSilentRestart != null && RadioCrashSilentRestart.IsChecked == true)
{
App.CrashAction = App.CrashActionType.SilentRestart;
}
else if (RadioCrashNoAction != null && RadioCrashNoAction.IsChecked == true)
{
App.CrashAction = App.CrashActionType.NoAction;
}
SaveSettingsToFile();
}
// 添加一个辅助方法,根据当前编辑模式设置光标
private void SetCursorBasedOnEditingMode(InkCanvas canvas)
{
if (Settings.Canvas.IsShowCursor) {
canvas.UseCustomCursor = true;
canvas.ForceCursor = true;
// 根据编辑模式设置不同的光标
if (canvas.EditingMode == InkCanvasEditingMode.EraseByPoint) {
canvas.Cursor = Cursors.Cross;
} else if (canvas.EditingMode == InkCanvasEditingMode.Ink) {
var sri = Application.GetResourceStream(new Uri("Resources/Cursors/Pen.cur", UriKind.Relative));
if (sri != null)
canvas.Cursor = new Cursor(sri.Stream);
} else if (canvas.EditingMode == InkCanvasEditingMode.Select) {
canvas.Cursor = Cursors.Cross;
}
System.Windows.Forms.Cursor.Show();
} else {
canvas.UseCustomCursor = false;
canvas.ForceCursor = false;
System.Windows.Forms.Cursor.Show();
}
}
// 鼠标输入
private void inkCanvas_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
// 使用辅助方法设置光标
SetCursorBasedOnEditingMode(inkCanvas);
}
// 手写笔输入
private void inkCanvas_StylusDown(object sender, StylusDownEventArgs e)
{
// 使用辅助方法设置光标
SetCursorBasedOnEditingMode(inkCanvas);
}
// 触摸输入,不隐藏光标
private void inkCanvas_TouchDown(object sender, TouchEventArgs e)
{
// 使用辅助方法设置光标
SetCursorBasedOnEditingMode(inkCanvas);
}
// 触摸结束,恢复光标
private void inkCanvas_TouchUp(object sender, TouchEventArgs e)
{
// 使用辅助方法设置光标
SetCursorBasedOnEditingMode(inkCanvas);
// 确保光标可见
if (Settings.Canvas.IsShowCursor) {
inkCanvas.ForceCursor = true;
inkCanvas.UseCustomCursor = true;
System.Windows.Forms.Cursor.Show();
}
}
#endregion Definations and Loading #endregion Definations and Loading
#region Navigation Sidebar Methods
// 侧边栏导航按钮事件处理
private void NavStartup_Click(object sender, RoutedEventArgs e)
{
// 切换到启动设置页面
ShowSettingsSection("startup");
}
private void NavCanvas_Click(object sender, RoutedEventArgs e)
{
// 切换到画布设置页面
ShowSettingsSection("canvas");
}
private void NavGesture_Click(object sender, RoutedEventArgs e)
{
// 切换到手势设置页面
ShowSettingsSection("gesture");
}
private void NavInkRecognition_Click(object sender, RoutedEventArgs e)
{
// 切换到墨迹识别设置页面
ShowSettingsSection("inkrecognition");
}
private void NavCrashAction_Click(object sender, RoutedEventArgs e)
{
// 切换到崩溃处理设置页面
ShowSettingsSection("crashaction");
}
private void NavPPT_Click(object sender, RoutedEventArgs e)
{
// 切换到PPT设置页面
ShowSettingsSection("ppt");
}
private void NavAdvanced_Click(object sender, RoutedEventArgs e)
{
// 切换到高级设置页面
ShowSettingsSection("advanced");
}
private void NavAutomation_Click(object sender, RoutedEventArgs e)
{
// 切换到自动化设置页面
ShowSettingsSection("automation");
}
private void NavRandomWindow_Click(object sender, RoutedEventArgs e)
{
// 切换到随机窗口设置页面
ShowSettingsSection("randomwindow");
}
private void NavAbout_Click(object sender, RoutedEventArgs e)
{
// 切换到关于页面
ShowSettingsSection("about");
}
// 新增:个性化设置
private void NavTheme_Click(object sender, RoutedEventArgs e)
{
// 切换到个性化设置页面
ShowSettingsSection("theme");
}
// 新增:快捷键设置
private void NavShortcuts_Click(object sender, RoutedEventArgs e)
{
// 切换到快捷键设置页面
ShowSettingsSection("shortcuts");
// 如果设置部分尚未快捷键
MessageBox.Show("设置功能正在开发中", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
}
private void BtnCloseSettings_Click(object sender, RoutedEventArgs e)
{
// 关闭设置面板
BorderSettings.Visibility = Visibility.Collapsed;
BorderSettingsMask.IsHitTestVisible = false;
}
// 新增:折叠侧边栏
private void CollapseNavSidebar_Click(object sender, RoutedEventArgs e)
{
// 折叠/展开侧边栏
var columnDefinitions = ((Grid)BorderSettings.Child).ColumnDefinitions;
if (columnDefinitions[0].Width.Value == 50)
{
// 折叠侧边栏
columnDefinitions[0].Width = new GridLength(0);
}
else
{
// 展开侧边栏
columnDefinitions[0].Width = new GridLength(50);
}
}
// 新增:显示侧边栏
private void ShowNavSidebar_Click(object sender, RoutedEventArgs e)
{
// 确保侧边栏展开
var columnDefinitions = ((Grid)BorderSettings.Child).ColumnDefinitions;
columnDefinitions[0].Width = new GridLength(50);
}
// 辅助方法:显示指定的设置部分
private void ShowSettingsSection(string sectionTag)
{
// 显示设置面板
BorderSettings.Visibility = Visibility.Visible;
BorderSettingsMask.IsHitTestVisible = true;
// 获取SettingsPanelScrollViewer中的所有GroupBox
var stackPanel = SettingsPanelScrollViewer.Content as StackPanel;
if (stackPanel == null) return;
// 首先隐藏所有GroupBox
foreach (var child in stackPanel.Children)
{
if (child is GroupBox groupBox)
{
groupBox.Visibility = Visibility.Collapsed;
}
}
// 根据传入的sectionTag显示相应的设置部分
switch (sectionTag.ToLower())
{
case "startup":
// 显示启动设置
ShowGroupBoxByHeader(stackPanel, "启动");
break;
case "canvas":
// 显示画板和墨迹设置
ShowGroupBoxByHeader(stackPanel, "画板和墨迹");
break;
case "gesture":
// 显示手势设置
ShowGroupBoxByHeader(stackPanel, "手势");
break;
case "inkrecognition":
// 显示墨迹纠正设置
ShowGroupBoxByHeader(stackPanel, "墨迹纠正");
if (GroupBoxInkRecognition != null)
GroupBoxInkRecognition.Visibility = Visibility.Visible;
break;
case "crashaction":
// 显示崩溃后操作设置
ShowGroupBoxByHeader(stackPanel, "崩溃后操作");
break;
case "ppt":
// 显示PPT联动设置
ShowGroupBoxByHeader(stackPanel, "PPT联动");
break;
case "advanced":
// 显示高级设置
// 这里可能需要根据实际情况调整
break;
case "automation":
// 显示自动化设置
// 这里可能需要根据实际情况调整
break;
case "randomwindow":
// 显示随机窗口设置
if (GroupBoxRandWindow != null)
GroupBoxRandWindow.Visibility = Visibility.Visible;
break;
case "theme":
// 显示主题设置
if (GroupBoxAppearanceNewUI != null)
GroupBoxAppearanceNewUI.Visibility = Visibility.Visible;
break;
case "shortcuts":
// 显示快捷键设置
// 快捷键设置部分可能尚未实现
break;
case "about":
// 显示关于页面
ShowGroupBoxByHeader(stackPanel, "关于");
break;
default:
// 默认显示第一个GroupBox
if (stackPanel.Children.Count > 0 && stackPanel.Children[0] is GroupBox firstGroupBox)
{
firstGroupBox.Visibility = Visibility.Visible;
}
break;
}
// 滚动到顶部
SettingsPanelScrollViewer.ScrollToTop();
}
// 根据Header文本查找并显示GroupBox
private void ShowGroupBoxByHeader(StackPanel parent, string headerText)
{
foreach (var child in parent.Children)
{
if (child is GroupBox groupBox)
{
// 查找GroupBox的Header
if (groupBox.Header is TextBlock headerTextBlock &&
headerTextBlock.Text != null &&
headerTextBlock.Text.Contains(headerText))
{
groupBox.Visibility = Visibility.Visible;
return;
}
}
}
}
#endregion Navigation Sidebar Methods
} }
} }
+1 -1
View File
@@ -54,7 +54,7 @@ namespace Ink_Canvas {
// FloatingBarIcons_MouseUp_New(sender); // FloatingBarIcons_MouseUp_New(sender);
if (sender == null) if (sender == null)
foldFloatingBarByUser = false; foldFloatingBarByUser = true;
else else
foldFloatingBarByUser = true; foldFloatingBarByUser = true;
unfoldFloatingBarByUser = false; unfoldFloatingBarByUser = false;
+16 -44
View File
@@ -107,6 +107,7 @@ namespace Ink_Canvas {
if (Settings.Automation.IsAutoSaveStrokesAtClear && if (Settings.Automation.IsAutoSaveStrokesAtClear &&
inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber) SaveScreenShot(true); inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber) SaveScreenShot(true);
if (CurrentWhiteboardIndex >= WhiteboardTotalCount) { if (CurrentWhiteboardIndex >= WhiteboardTotalCount) {
// 在最后一页时,点击“新页面”按钮直接新增一页
BtnWhiteBoardAdd_Click(sender, e); BtnWhiteBoardAdd_Click(sender, e);
return; return;
} }
@@ -166,64 +167,35 @@ namespace Ink_Canvas {
TextBlockWhiteBoardIndexInfo.Text = TextBlockWhiteBoardIndexInfo.Text =
$"{CurrentWhiteboardIndex}/{WhiteboardTotalCount}"; $"{CurrentWhiteboardIndex}/{WhiteboardTotalCount}";
if (CurrentWhiteboardIndex == WhiteboardTotalCount) { bool isLastPage = CurrentWhiteboardIndex == WhiteboardTotalCount;
var newImageSource = new BitmapImage(); bool isMaxPage = WhiteboardTotalCount >= 99;
newImageSource.BeginInit();
newImageSource.UriSource = new Uri("/Resources/Icons-Fluent/ic_fluent_add_circle_24_regular.png", // 设置按钮文本
UriKind.RelativeOrAbsolute); BtnLeftWhiteBoardSwitchNextLabel.Text = isLastPage ? "新页面" : "下一页";
newImageSource.EndInit(); BtnRightWhiteBoardSwitchNextLabel.Text = isLastPage ? "新页面" : "下一页";
//BoardLeftPannelNextPage.Source = newImageSource;
//BoardRightPannelNextPage.Source = newImageSource; // 始终允许点击“下一页/新页面”按钮(除非已达最大页数)
//BoardRightPannelNextPageTextBlock.Text = "加页"; BtnWhiteBoardSwitchNext.IsEnabled = !isMaxPage;
//BoardLeftPannelNextPageTextBlock.Text = "加页";
} else { // 保持按钮常亮(高亮)
var newImageSource = new BitmapImage(); BtnLeftWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
newImageSource.BeginInit(); BtnLeftWhiteBoardSwitchNextLabel.Opacity = 1;
newImageSource.UriSource = BtnRightWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
new Uri("/Resources/Icons-Fluent/ic_fluent_arrow_circle_right_24_regular.png", BtnRightWhiteBoardSwitchNextLabel.Opacity = 1;
UriKind.RelativeOrAbsolute);
newImageSource.EndInit();
//BoardLeftPannelNextPage.Source = newImageSource;
//BoardRightPannelNextPage.Source = newImageSource;
//BoardRightPannelNextPageTextBlock.Text = "下一页";
//BoardLeftPannelNextPageTextBlock.Text = "下一页";
}
BtnWhiteBoardSwitchPrevious.IsEnabled = true; BtnWhiteBoardSwitchPrevious.IsEnabled = true;
BtnWhiteBoardSwitchNext.IsEnabled = true;
if (CurrentWhiteboardIndex == 1) { if (CurrentWhiteboardIndex == 1) {
BtnWhiteBoardSwitchPrevious.IsEnabled = false; BtnWhiteBoardSwitchPrevious.IsEnabled = false;
BtnLeftWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27)); BtnLeftWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
BtnLeftWhiteBoardSwitchPreviousLabel.Opacity = 0.5; BtnLeftWhiteBoardSwitchPreviousLabel.Opacity = 0.5;
BtnLeftWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
BtnLeftWhiteBoardSwitchNextLabel.Opacity = 1;
BtnRightWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27)); BtnRightWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
BtnRightWhiteBoardSwitchPreviousLabel.Opacity = 0.5; BtnRightWhiteBoardSwitchPreviousLabel.Opacity = 0.5;
BtnRightWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
BtnRightWhiteBoardSwitchNextLabel.Opacity = 1;
} else { } else {
BtnLeftWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27)); BtnLeftWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
BtnLeftWhiteBoardSwitchPreviousLabel.Opacity = 1; BtnLeftWhiteBoardSwitchPreviousLabel.Opacity = 1;
BtnRightWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27)); BtnRightWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
BtnRightWhiteBoardSwitchPreviousLabel.Opacity = 1; BtnRightWhiteBoardSwitchPreviousLabel.Opacity = 1;
if (CurrentWhiteboardIndex == WhiteboardTotalCount) {
BtnLeftWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
BtnLeftWhiteBoardSwitchNextLabel.Opacity = 0.5;
BtnRightWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
BtnRightWhiteBoardSwitchNextLabel.Opacity = 0.5;
BtnWhiteBoardSwitchNext.IsEnabled = false;
} else {
BtnLeftWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
BtnLeftWhiteBoardSwitchNextLabel.Opacity = 1;
BtnRightWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
BtnRightWhiteBoardSwitchNextLabel.Opacity = 1;
}
} }
BtnWhiteBoardDelete.IsEnabled = WhiteboardTotalCount != 1; BtnWhiteBoardDelete.IsEnabled = WhiteboardTotalCount != 1;
+88 -33
View File
@@ -29,7 +29,7 @@ namespace Ink_Canvas {
#region #region
/// <summary> /// <summary>
/// 用於浮動工具欄的手勢按鈕和白板工具欄的手勢按鈕的點擊事件 /// 用於浮動工具欄的"手勢"按鈕和白板工具欄的"手勢"按鈕的點擊事件
/// </summary> /// </summary>
private void TwoFingerGestureBorder_MouseUp(object sender, RoutedEventArgs e) { private void TwoFingerGestureBorder_MouseUp(object sender, RoutedEventArgs e) {
if (TwoFingerGestureBorder.Visibility == Visibility.Visible) { if (TwoFingerGestureBorder.Visibility == Visibility.Visible) {
@@ -63,7 +63,7 @@ namespace Ink_Canvas {
} }
/// <summary> /// <summary>
/// 用於更新浮動工具欄的手勢按鈕和白板工具欄的手勢按鈕的樣式(開啟和關閉狀態) /// 用於更新浮動工具欄的"手勢"按鈕和白板工具欄的"手勢"按鈕的樣式(開啟和關閉狀態)
/// </summary> /// </summary>
private void CheckEnableTwoFingerGestureBtnColorPrompt() { private void CheckEnableTwoFingerGestureBtnColorPrompt() {
if (ToggleSwitchEnableMultiTouchMode.IsOn) { if (ToggleSwitchEnableMultiTouchMode.IsOn) {
@@ -111,7 +111,7 @@ namespace Ink_Canvas {
} }
/// <summary> /// <summary>
/// 控制是否顯示浮動工具欄的手勢按鈕 /// 控制是否顯示浮動工具欄的"手勢"按鈕
/// </summary> /// </summary>
private void CheckEnableTwoFingerGestureBtnVisibility(bool isVisible) { private void CheckEnableTwoFingerGestureBtnVisibility(bool isVisible) {
if (StackPanelCanvasControls.Visibility != Visibility.Visible if (StackPanelCanvasControls.Visibility != Visibility.Visible
@@ -128,7 +128,7 @@ namespace Ink_Canvas {
} }
} }
#endregion #endregion "手勢"
#region #region
@@ -217,22 +217,22 @@ namespace Ink_Canvas {
/// </para> /// </para>
/// <list type="number"> /// <list type="number">
/// <item> /// <item>
/// 隱藏浮動工具欄和白板模式下的更多功能面板 /// 隱藏浮動工具欄和白板模式下的"更多功能"面板
/// </item> /// </item>
/// <item> /// <item>
/// 隱藏白板模式下和浮動工具欄的畫筆調色盤 /// 隱藏白板模式下和浮動工具欄的畫筆調色盤
/// </item> /// </item>
/// <item> /// <item>
/// 隱藏白板模式下的清屏按鈕(已作廢) /// 隱藏白板模式下的"清屏"按鈕(已作廢)
/// </item> /// </item>
/// <item> /// <item>
/// 負責給Settings設置面板做隱藏動畫 /// 負責給Settings設置面板做隱藏動畫
/// </item> /// </item>
/// <item> /// <item>
/// 隱藏白板模式下和浮動工具欄的手勢面板 /// 隱藏白板模式下和浮動工具欄的"手勢"面板
/// </item> /// </item>
/// <item> /// <item>
/// 當<c>ToggleSwitchDrawShapeBorderAutoHide</c>開啟時,會自動隱藏白板模式下和浮動工具欄的形狀面板 /// 當<c>ToggleSwitchDrawShapeBorderAutoHide</c>開啟時,會自動隱藏白板模式下和浮動工具欄的"形狀"面板
/// </item> /// </item>
/// <item> /// <item>
/// 按需高亮指定的浮動工具欄和白板工具欄中的按鈕,通過param<paramref name="mode"/> 來指定 /// 按需高亮指定的浮動工具欄和白板工具欄中的按鈕,通過param<paramref name="mode"/> 來指定
@@ -254,16 +254,16 @@ namespace Ink_Canvas {
/// 當<c><paramref name="mode"/>!="clear"</c>時,會先取消高亮所有工具欄按鈕,然後根據下面的情況進行高亮處理 /// 當<c><paramref name="mode"/>!="clear"</c>時,會先取消高亮所有工具欄按鈕,然後根據下面的情況進行高亮處理
/// </item> /// </item>
/// <item> /// <item>
/// 當<c><paramref name="mode"/>=="color" || <paramref name="mode"/>=="pen"</c>時,會高亮浮動工具欄和白板工具欄中的批註”,“筆”按鈕 /// 當<c><paramref name="mode"/>=="color" || <paramref name="mode"/>=="pen"</c>時,會高亮浮動工具欄和白板工具欄中的"批註""筆"按鈕
/// </item> /// </item>
/// <item> /// <item>
/// 當<c><paramref name="mode"/>=="eraser"</c>時,會高亮白板工具欄中的橡皮和浮動工具欄中的面積擦按鈕 /// 當<c><paramref name="mode"/>=="eraser"</c>時,會高亮白板工具欄中的"橡皮"和浮動工具欄中的"面積擦"按鈕
/// </item> /// </item>
/// <item> /// <item>
/// 當<c><paramref name="mode"/>=="eraserByStrokes"</c>時,會高亮白板工具欄中的橡皮和浮動工具欄中的墨跡擦按鈕 /// 當<c><paramref name="mode"/>=="eraserByStrokes"</c>時,會高亮白板工具欄中的"橡皮"和浮動工具欄中的"墨跡擦"按鈕
/// </item> /// </item>
/// <item> /// <item>
/// 當<c><paramref name="mode"/>=="select"</c>時,會高亮浮動工具欄和白板工具欄中的選擇”,“套索選按鈕 /// 當<c><paramref name="mode"/>=="select"</c>時,會高亮浮動工具欄和白板工具欄中的"選擇""套索選"按鈕
/// </item> /// </item>
/// </list> /// </list>
/// </param> /// </param>
@@ -485,7 +485,7 @@ namespace Ink_Canvas {
RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
//入黑板 //入黑板
/* /*
if (Not_Enter_Blackboard_fir_Mouse_Click) {// BUG-Fixed_tmp:程序启动后直接进入白板会导致后续撤销功能、退出白板无法恢复墨迹 if (Not_Enter_Blackboard_fir_Mouse_Click) {// BUG-Fixed_tmp:程序启动后直接进入白板会导致后续撤销功能、退出白板无法恢复墨迹
@@ -501,7 +501,6 @@ namespace Ink_Canvas {
Application.Current.Dispatcher.Invoke(() => { ViewboxFloatingBarMarginAnimation(60); }); Application.Current.Dispatcher.Invoke(() => { ViewboxFloatingBarMarginAnimation(60); });
})).Start(); })).Start();
HideSubPanels();
if (GridTransparencyFakeBackground.Background == Brushes.Transparent) if (GridTransparencyFakeBackground.Background == Brushes.Transparent)
{ {
if (currentMode == 1) if (currentMode == 1)
@@ -514,6 +513,11 @@ namespace Ink_Canvas {
} }
BtnHideInkCanvas_Click(BtnHideInkCanvas, null); BtnHideInkCanvas_Click(BtnHideInkCanvas, null);
HideSubPanels();
}
else
{
HideSubPanels();
} }
if (Settings.Gesture.AutoSwitchTwoFingerGesture) // 自动关闭多指书写、开启双指移动 if (Settings.Gesture.AutoSwitchTwoFingerGesture) // 自动关闭多指书写、开启双指移动
@@ -574,6 +578,15 @@ namespace Ink_Canvas {
if (dopsc[2] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(LeftSidePanelForPPTNavigation); if (dopsc[2] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(LeftSidePanelForPPTNavigation);
if (dopsc[3] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(RightSidePanelForPPTNavigation); if (dopsc[3] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(RightSidePanelForPPTNavigation);
} }
// 修复PPT放映时点击白板按钮后翻页按钮不显示的问题
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible)
{
// 强制显示PPT翻页按钮
LeftBottomPanelForPPTNavigation.Visibility = Visibility.Visible;
RightBottomPanelForPPTNavigation.Visibility = Visibility.Visible;
LeftSidePanelForPPTNavigation.Visibility = Visibility.Visible;
RightSidePanelForPPTNavigation.Visibility = Visibility.Visible;
}
if (Settings.Automation.IsAutoSaveStrokesAtClear && if (Settings.Automation.IsAutoSaveStrokesAtClear &&
inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber) SaveScreenShot(true); inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber) SaveScreenShot(true);
@@ -664,7 +677,7 @@ namespace Ink_Canvas {
#region #region
/// <summary> /// <summary>
/// 浮動工具欄的套索選按鈕事件,重定向到舊UI的<c>BtnSelect_Click</c>方法 /// 浮動工具欄的"套索選"按鈕事件,重定向到舊UI的<c>BtnSelect_Click</c>方法
/// </summary> /// </summary>
/// <param name="sender">sender</param> /// <param name="sender">sender</param>
/// <param name="e">MouseButtonEventArgs</param> /// <param name="e">MouseButtonEventArgs</param>
@@ -727,9 +740,11 @@ namespace Ink_Canvas {
} }
private void SymbolIconRand_MouseUp(object sender, MouseButtonEventArgs e) { private void SymbolIconRand_MouseUp(object sender, MouseButtonEventArgs e) {
// 如果控件被隐藏,不处理事件
if (RandomDrawPanel.Visibility != Visibility.Visible) return;
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed; LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed; RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
if (lastBorderMouseDownObject != sender) return;
AnimationsHelper.HideWithSlideAndFade(BorderTools); AnimationsHelper.HideWithSlideAndFade(BorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools); AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
@@ -795,18 +810,20 @@ namespace Ink_Canvas {
} }
private void SymbolIconRandOne_MouseUp(object sender, MouseButtonEventArgs e) { private void SymbolIconRandOne_MouseUp(object sender, MouseButtonEventArgs e) {
// 如果控件被隐藏,不处理事件
if (SingleDrawPanel.Visibility != Visibility.Visible) return;
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed; LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed; RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
if (lastBorderMouseDownObject != sender) return;
AnimationsHelper.HideWithSlideAndFade(BorderTools); AnimationsHelper.HideWithSlideAndFade(BorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools); AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
new RandWindow(Settings,true).ShowDialog(); new RandWindow(Settings, true).ShowDialog();
} }
private void GridInkReplayButton_MouseUp(object sender, MouseButtonEventArgs e) { private void GridInkReplayButton_MouseUp(object sender, MouseButtonEventArgs e) {
if (lastBorderMouseDownObject != sender) return; //if (lastBorderMouseDownObject != sender) return;
AnimationsHelper.HideWithSlideAndFade(BorderTools); AnimationsHelper.HideWithSlideAndFade(BorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools); AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
@@ -1061,15 +1078,38 @@ namespace Ink_Canvas {
var windowHandle = new WindowInteropHelper(this).Handle; var windowHandle = new WindowInteropHelper(this).Handle;
var screen = System.Windows.Forms.Screen.FromHandle(windowHandle); var screen = System.Windows.Forms.Screen.FromHandle(windowHandle);
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY; double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight - // 仅计算Windows任务栏高度,不考虑其他程序对工作区的影响
SystemParameters.WindowCaptionHeight; var toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY);
pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2; pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2;
if (PosXCaculatedWithTaskbarHeight == false) if (PosXCaculatedWithTaskbarHeight == false)
pos.Y = screenHeight - MarginFromEdge * ViewboxFloatingBarScaleTransform.ScaleY; {
// 如果任务栏高度为0(隐藏状态),则使用固定边距
if (toolbarHeight == 0)
{
pos.Y = screenHeight - MarginFromEdge * ViewboxFloatingBarScaleTransform.ScaleY;
LogHelper.WriteLogToFile($"任务栏隐藏,使用固定边距: {MarginFromEdge}", LogHelper.LogType.Info);
}
else
{
pos.Y = screenHeight - MarginFromEdge * ViewboxFloatingBarScaleTransform.ScaleY;
}
}
else if (PosXCaculatedWithTaskbarHeight == true) else if (PosXCaculatedWithTaskbarHeight == true)
pos.Y = screenHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY - {
toolbarHeight - ViewboxFloatingBarScaleTransform.ScaleY * 3; // 如果任务栏高度为0(隐藏状态),则使用固定高度
if (toolbarHeight == 0)
{
pos.Y = screenHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY -
3 * ViewboxFloatingBarScaleTransform.ScaleY;
LogHelper.WriteLogToFile($"任务栏隐藏,使用固定高度: {ViewboxFloatingBar.ActualHeight}", LogHelper.LogType.Info);
}
else
{
pos.Y = screenHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY -
toolbarHeight - ViewboxFloatingBarScaleTransform.ScaleY * 3;
}
}
if (MarginFromEdge != -60) { if (MarginFromEdge != -60) {
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) { if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) {
@@ -1124,12 +1164,22 @@ namespace Ink_Canvas {
var windowHandle = new WindowInteropHelper(this).Handle; var windowHandle = new WindowInteropHelper(this).Handle;
var screen = System.Windows.Forms.Screen.FromHandle(windowHandle); var screen = System.Windows.Forms.Screen.FromHandle(windowHandle);
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY; double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight - // 仅计算Windows任务栏高度,不考虑其他程序对工作区的影响
SystemParameters.WindowCaptionHeight; var toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY);
pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2; pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2;
pos.Y = screenHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY - // 如果任务栏高度为0(隐藏状态),则使用固定边距
toolbarHeight - ViewboxFloatingBarScaleTransform.ScaleY * 3; if (toolbarHeight == 0)
{
pos.Y = screenHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY -
3 * ViewboxFloatingBarScaleTransform.ScaleY;
LogHelper.WriteLogToFile($"任务栏隐藏,使用固定高度: {ViewboxFloatingBar.ActualHeight}", LogHelper.LogType.Info);
}
else
{
pos.Y = screenHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY -
toolbarHeight - ViewboxFloatingBarScaleTransform.ScaleY * 3;
}
if (pointDesktop.X != -1 || pointDesktop.Y != -1) pointDesktop = pos; if (pointDesktop.X != -1 || pointDesktop.Y != -1) pointDesktop = pos;
@@ -1167,8 +1217,8 @@ namespace Ink_Canvas {
var windowHandle = new WindowInteropHelper(this).Handle; var windowHandle = new WindowInteropHelper(this).Handle;
var screen = System.Windows.Forms.Screen.FromHandle(windowHandle); var screen = System.Windows.Forms.Screen.FromHandle(windowHandle);
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY; double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight - // 仅计算Windows任务栏高度,不考虑其他程序对工作区的影响
SystemParameters.WindowCaptionHeight; var toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY);
pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2; pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2;
pos.Y = screenHeight - 55 * ViewboxFloatingBarScaleTransform.ScaleY; pos.Y = screenHeight - 55 * ViewboxFloatingBarScaleTransform.ScaleY;
@@ -1564,13 +1614,15 @@ namespace Ink_Canvas {
public static bool CloseIsFromButton = false; public static bool CloseIsFromButton = false;
public void BtnExit_Click(object sender, RoutedEventArgs e) { public void BtnExit_Click(object sender, RoutedEventArgs e) {
CloseIsFromButton = true; App.IsAppExitByUser = true;
Close(); Application.Current.Shutdown();
// CloseIsFromButton = true;
// Close();
} }
public void BtnRestart_Click(object sender, RoutedEventArgs e) { public void BtnRestart_Click(object sender, RoutedEventArgs e) {
Process.Start(System.Windows.Forms.Application.ExecutablePath, "-m"); Process.Start(System.Windows.Forms.Application.ExecutablePath, "-m");
App.IsAppExitByUser = true;
CloseIsFromButton = true; CloseIsFromButton = true;
Application.Current.Shutdown(); Application.Current.Shutdown();
} }
@@ -1891,5 +1943,8 @@ namespace Ink_Canvas {
} }
#endregion #endregion
} }
} }
File diff suppressed because it is too large Load Diff
+45 -11
View File
@@ -1,4 +1,4 @@
using Ink_Canvas.Helpers; using Ink_Canvas.Helpers;
using Microsoft.Win32; using Microsoft.Win32;
using System; using System;
using System.IO; using System.IO;
@@ -20,21 +20,56 @@ namespace Ink_Canvas {
SaveInkCanvasStrokes(true, true); SaveInkCanvasStrokes(true, true);
} }
private void SaveInkCanvasStrokes(bool newNotice = true, bool saveByUser = false) { private void SaveInkCanvasStrokes(Boolean newNotice, Boolean saveByUser) {
try { try {
var savePath = Settings.Automation.AutoSavedStrokesLocation // 修改保存路径为软件根目录下的Saves文件夹
+ (saveByUser ? @"\User Saved - " : @"\Auto Saved - ") string appDirectory = AppDomain.CurrentDomain.BaseDirectory;
+ (currentMode == 0 ? "Annotation Strokes" : "BlackBoard Strokes"); if (string.IsNullOrEmpty(appDirectory))
{
appDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
}
string savePath = Path.Combine(appDirectory, "Saves",
(saveByUser ? @"User Saved - " : @"Auto Saved - ") +
(currentMode == 0 ? "Annotation Strokes" : "BlackBoard Strokes"));
if (!Directory.Exists(savePath)) Directory.CreateDirectory(savePath); if (!Directory.Exists(savePath)) Directory.CreateDirectory(savePath);
string savePathWithName; string savePathWithName;
if (currentMode != 0) // 黑板模式下 if (currentMode != 0) // 黑板模式下
savePathWithName = savePath + @"\" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss-fff") + " Page-" + savePathWithName = savePath + @"\" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss-fff") + " Page-" +
CurrentWhiteboardIndex + " StrokesCount-" + inkCanvas.Strokes.Count + ".icstk"; CurrentWhiteboardIndex + " StrokesCount-" + inkCanvas.Strokes.Count + ".icstk";
else else
//savePathWithName = savePath + @"\" + DateTime.Now.ToString("u").Replace(':', '-') + ".icstk";
savePathWithName = savePath + @"\" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss-fff") + ".icstk"; savePathWithName = savePath + @"\" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss-fff") + ".icstk";
var fs = new FileStream(savePathWithName, FileMode.Create);
inkCanvas.Strokes.Save(fs); try {
using (FileStream fs = new FileStream(savePathWithName, FileMode.Create)) {
inkCanvas.Strokes.Save(fs);
}
}
catch (Exception ex) when (ex is UnauthorizedAccessException || ex is DirectoryNotFoundException) {
// 修改异常处理中的备用路径为软件根目录下的Saves文件夹
string fallbackPath = Path.Combine(appDirectory, "Saves");
Directory.CreateDirectory(fallbackPath);
string fileName = Path.GetFileNameWithoutExtension(savePathWithName) + "_retry.icstk";
string newPath = Path.Combine(fallbackPath, fileName);
try {
using (FileStream fs = new FileStream(newPath, FileMode.Create)) {
inkCanvas.Strokes.Save(fs);
savePathWithName = newPath;
}
}
catch (Exception fallbackEx) {
ShowNotification($"墨迹保存失败: {fallbackEx.Message}");
return;
}
}
catch (Exception ex) {
ShowNotification($"墨迹保存失败: {ex.Message}");
return;
}
if (newNotice) ShowNotification("墨迹成功保存至 " + savePathWithName); if (newNotice) ShowNotification("墨迹成功保存至 " + savePathWithName);
} }
catch (Exception ex) { catch (Exception ex) {
@@ -49,7 +84,6 @@ namespace Ink_Canvas {
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools); AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
var openFileDialog = new OpenFileDialog(); var openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = Settings.Automation.AutoSavedStrokesLocation;
openFileDialog.Title = "打开墨迹文件"; openFileDialog.Title = "打开墨迹文件";
openFileDialog.Filter = "Ink Canvas Strokes File (*.icstk)|*.icstk"; openFileDialog.Filter = "Ink Canvas Strokes File (*.icstk)|*.icstk";
if (openFileDialog.ShowDialog() != true) return; if (openFileDialog.ShowDialog() != true) return;
+68 -19
View File
@@ -1,6 +1,7 @@
using System; using System;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
namespace Ink_Canvas { namespace Ink_Canvas {
@@ -35,42 +36,90 @@ namespace Ink_Canvas {
using (var memoryGraphics = System.Drawing.Graphics.FromImage(bitmap)) { using (var memoryGraphics = System.Drawing.Graphics.FromImage(bitmap)) {
memoryGraphics.CopyFromScreen(rc.X, rc.Y, 0, 0, rc.Size, System.Drawing.CopyPixelOperation.SourceCopy); memoryGraphics.CopyFromScreen(rc.X, rc.Y, 0, 0, rc.Size, System.Drawing.CopyPixelOperation.SourceCopy);
// 确保目录存在
var directory = Path.GetDirectoryName(savePath); var directory = Path.GetDirectoryName(savePath);
if (!Directory.Exists(directory)) { if (!Directory.Exists(directory)) {
Directory.CreateDirectory(directory); Directory.CreateDirectory(directory);
} }
bitmap.Save(savePath, ImageFormat.Png); try {
// 新增双重目录检查
Directory.CreateDirectory(directory); // 防止多线程场景下的竞争条件
bitmap.Save(savePath, ImageFormat.Png);
}
catch (Exception ex) when (ex is IOException ||
ex is UnauthorizedAccessException ||
ex is ExternalException) { // 新增GDI+异常捕获
// 改进备用路径处理
var docPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
"Auto Saved - Screenshots",
DateTime.Now.ToString("yyyyMMdd"),
Path.GetFileNameWithoutExtension(savePath) + "_retry.png"); // 添加重试后缀
try {
var docDir = Path.GetDirectoryName(docPath);
Directory.CreateDirectory(docDir);
bitmap.Save(docPath, ImageFormat.Png);
savePath = docPath;
}
catch (Exception fallbackEx) {
// 最终错误处理
if (!isHideNotification) {
ShowNotification($"截图保存失败: {fallbackEx.Message}");
}
return;
}
}
} }
if (!isHideNotification) { if (!isHideNotification) {
ShowNotification($"截图成功保存至 {savePath}"); try {
ShowNotification($"截图成功保存至 {savePath}");
}
catch {
// 防止通知系统自身异常导致崩溃
}
} }
} }
// 获取日期文件夹路径 // 获取日期文件夹路径
private string GetDateFolderPath(string fileName) { private string GetDateFolderPath(string fileName) {
if (string.IsNullOrWhiteSpace(fileName)) { var basePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Saves");
fileName = DateTime.Now.ToString("HH-mm-ss"); var dateFolder = DateTime.Now.ToString("yyyyMMdd");
var fullPath = Path.Combine(basePath, "Auto Saved - Screenshots", dateFolder);
try {
if (!Directory.Exists(fullPath)) {
Directory.CreateDirectory(fullPath);
}
}
catch (Exception ex) when
(ex is IOException ||
ex is UnauthorizedAccessException)
{
// 如果创建失败则使用软件根目录作为最终备选
basePath = AppDomain.CurrentDomain.BaseDirectory;
fullPath = Path.Combine(basePath, "Auto Saved - Screenshots", dateFolder);
Directory.CreateDirectory(fullPath);
} }
var basePath = Settings.Automation.AutoSavedStrokesLocation; return Path.Combine(fullPath, $"{fileName}.png");
var dateFolder = DateTime.Now.ToString("yyyyMMdd");
return Path.Combine(
basePath,
"Auto Saved - Screenshots",
dateFolder,
$"{fileName}.png");
} }
// 获取默认文件夹路径
private string GetDefaultFolderPath() { private string GetDefaultFolderPath() {
var basePath = Settings.Automation.AutoSavedStrokesLocation; var basePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Saves");
var screenshotsFolder = Path.Combine(basePath, "Auto Saved - Screenshots"); var screenshotsFolder = Path.Combine(basePath, "Auto Saved - Screenshots");
if (!Directory.Exists(screenshotsFolder)) { try {
if (!Directory.Exists(screenshotsFolder)) {
Directory.CreateDirectory(screenshotsFolder);
}
}
catch (Exception) {
// 如果创建失败则使用文档目录
basePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
screenshotsFolder = Path.Combine(basePath, "Auto Saved - Screenshots");
Directory.CreateDirectory(screenshotsFolder); Directory.CreateDirectory(screenshotsFolder);
} }
@@ -1,4 +1,4 @@
using iNKORE.UI.WPF.Modern.Controls; using iNKORE.UI.WPF.Modern.Controls;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows; using System.Windows;
@@ -17,6 +17,13 @@ namespace Ink_Canvas {
private object lastBorderMouseDownObject; private object lastBorderMouseDownObject;
private void Border_MouseDown(object sender, MouseButtonEventArgs e) { private void Border_MouseDown(object sender, MouseButtonEventArgs e) {
// 如果发送者是 RandomDrawPanel 或 SingleDrawPanel,且它们被隐藏,则不处理事件
if (sender is SimpleStackPanel panel) {
if ((panel == RandomDrawPanel || panel == SingleDrawPanel) &&
panel.Visibility != Visibility.Visible) {
return;
}
}
lastBorderMouseDownObject = sender; lastBorderMouseDownObject = sender;
} }
@@ -380,6 +387,11 @@ namespace Ink_Canvas {
isProgramChangeStrokeSelection = false; isProgramChangeStrokeSelection = false;
inkCanvas.Strokes.Add(StrokesSelectionClone); inkCanvas.Strokes.Add(StrokesSelectionClone);
} }
else {
// 新增:启动套索选择模式
inkCanvas.EditingMode = InkCanvasEditingMode.Select;
inkCanvas.Select(new StrokeCollection());
}
} }
} }
+105 -3
View File
@@ -1,4 +1,4 @@
using Ink_Canvas.Helpers; using Ink_Canvas.Helpers;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Diagnostics; using System.Diagnostics;
@@ -694,6 +694,69 @@ namespace Ink_Canvas {
SaveSettingsToFile(); SaveSettingsToFile();
} }
private void ToggleSwitchEnablePressureTouchMode_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Canvas.EnablePressureTouchMode = ToggleSwitchEnablePressureTouchMode.IsOn;
// 如果启用了压感触屏模式,则自动关闭屏蔽压感
if (Settings.Canvas.EnablePressureTouchMode && Settings.Canvas.DisablePressure) {
Settings.Canvas.DisablePressure = false;
ToggleSwitchDisablePressure.IsOn = false;
}
SaveSettingsToFile();
}
private void ToggleSwitchDisablePressure_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Canvas.DisablePressure = ToggleSwitchDisablePressure.IsOn;
// 如果启用了屏蔽压感,则自动关闭压感触屏模式
if (Settings.Canvas.DisablePressure && Settings.Canvas.EnablePressureTouchMode) {
Settings.Canvas.EnablePressureTouchMode = false;
ToggleSwitchEnablePressureTouchMode.IsOn = false;
}
SaveSettingsToFile();
}
private void ToggleSwitchAutoStraightenLine_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Canvas.AutoStraightenLine = ToggleSwitchAutoStraightenLine.IsOn;
SaveSettingsToFile();
}
private void AutoStraightenLineThresholdSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) {
if (!isLoaded) return;
Settings.Canvas.AutoStraightenLineThreshold = (int)e.NewValue;
SaveSettingsToFile();
}
private void ToggleSwitchLineEndpointSnapping_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Canvas.LineEndpointSnapping = ToggleSwitchLineEndpointSnapping.IsOn;
SaveSettingsToFile();
}
private void LineEndpointSnappingThresholdSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) {
if (!isLoaded) return;
Settings.Canvas.LineEndpointSnappingThreshold = (int)e.NewValue;
SaveSettingsToFile();
}
private void LineStraightenSensitivitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) {
if (!isLoaded) return;
Settings.InkToShape.LineStraightenSensitivity = e.NewValue;
SaveSettingsToFile();
}
#endregion #endregion
#region Canvas #region Canvas
@@ -1218,7 +1281,10 @@ namespace Ink_Canvas {
} }
private void SetAutoSavedStrokesLocationToDiskDButton_Click(object sender, RoutedEventArgs e) { private void SetAutoSavedStrokesLocationToDiskDButton_Click(object sender, RoutedEventArgs e) {
AutoSavedStrokesLocation.Text = @"D:\Ink Canvas"; // 修改默认路径为软件根目录下的 Saves 文件夹
string appDirectory = AppDomain.CurrentDomain.BaseDirectory;
string savesPath = System.IO.Path.Combine(appDirectory, "Saves");
AutoSavedStrokesLocation.Text = savesPath;
} }
private void SetAutoSavedStrokesLocationToDocumentFolderButton_Click(object sender, RoutedEventArgs e) { private void SetAutoSavedStrokesLocationToDocumentFolderButton_Click(object sender, RoutedEventArgs e) {
@@ -1362,6 +1428,7 @@ namespace Ink_Canvas {
Settings.Advanced.IsEnableEdgeGestureUtil = false; Settings.Advanced.IsEnableEdgeGestureUtil = false;
Settings.Advanced.EdgeGestureUtilOnlyAffectBlackboardMode = false; Settings.Advanced.EdgeGestureUtilOnlyAffectBlackboardMode = false;
Settings.Advanced.IsEnableFullScreenHelper = false; Settings.Advanced.IsEnableFullScreenHelper = false;
Settings.Advanced.IsEnableAvoidFullScreenHelper = false;
Settings.Advanced.IsEnableForceFullScreen = false; Settings.Advanced.IsEnableForceFullScreen = false;
Settings.Advanced.IsEnableDPIChangeDetection = false; Settings.Advanced.IsEnableDPIChangeDetection = false;
Settings.Advanced.IsEnableResolutionChangeDetection = false; Settings.Advanced.IsEnableResolutionChangeDetection = false;
@@ -1408,7 +1475,7 @@ namespace Ink_Canvas {
Settings.Automation.IsAutoKillVComYouJiao = false; Settings.Automation.IsAutoKillVComYouJiao = false;
Settings.Automation.IsAutoKillInkCanvas = false; Settings.Automation.IsAutoKillInkCanvas = false;
Settings.Automation.IsAutoKillICA = false; Settings.Automation.IsAutoKillICA = false;
Settings.Automation.IsAutoKillIDT = true; Settings.Automation.IsAutoKillIDT = false;
Settings.Automation.IsAutoKillSeewoLauncher2DesktopAnnotation = false; Settings.Automation.IsAutoKillSeewoLauncher2DesktopAnnotation = false;
Settings.Automation.IsSaveScreenshotsInDateFolders = false; Settings.Automation.IsSaveScreenshotsInDateFolders = false;
Settings.Automation.IsAutoSaveStrokesAtScreenshot = true; Settings.Automation.IsAutoSaveStrokesAtScreenshot = true;
@@ -1443,6 +1510,12 @@ namespace Ink_Canvas {
Settings.Canvas.HideStrokeWhenSelecting = false; Settings.Canvas.HideStrokeWhenSelecting = false;
Settings.Canvas.ClearCanvasAndClearTimeMachine = false; Settings.Canvas.ClearCanvasAndClearTimeMachine = false;
Settings.Canvas.FitToCurve = true; Settings.Canvas.FitToCurve = true;
Settings.Canvas.EnablePressureTouchMode = false;
Settings.Canvas.DisablePressure = false;
Settings.Canvas.AutoStraightenLine = true;
Settings.Canvas.AutoStraightenLineThreshold = 30;
Settings.Canvas.LineEndpointSnapping = true;
Settings.Canvas.LineEndpointSnappingThreshold = 15;
Settings.Canvas.UsingWhiteboard = false; Settings.Canvas.UsingWhiteboard = false;
Settings.Canvas.HyperbolaAsymptoteOption = 0; Settings.Canvas.HyperbolaAsymptoteOption = 0;
@@ -1573,6 +1646,20 @@ namespace Ink_Canvas {
SaveSettingsToFile(); SaveSettingsToFile();
} }
private void ToggleSwitchIsEnableAvoidFullScreenHelper_OnToggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Advanced.IsEnableAvoidFullScreenHelper = ToggleSwitchIsEnableAvoidFullScreenHelper.IsOn;
SaveSettingsToFile();
if (ToggleSwitchIsEnableAvoidFullScreenHelper.IsOn)
{
AvoidFullScreenHelper.StartAvoidFullScreen(this);
}
else
{
AvoidFullScreenHelper.StopAvoidFullScreen(this);
}
}
private void ToggleSwitchIsEnableEdgeGestureUtil_Toggled(object sender, RoutedEventArgs e) { private void ToggleSwitchIsEnableEdgeGestureUtil_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Advanced.IsEnableEdgeGestureUtil = ToggleSwitchIsEnableEdgeGestureUtil.IsOn; Settings.Advanced.IsEnableEdgeGestureUtil = ToggleSwitchIsEnableEdgeGestureUtil.IsOn;
@@ -1672,6 +1759,21 @@ namespace Ink_Canvas {
SaveSettingsToFile(); SaveSettingsToFile();
} }
private void ToggleSwitchShowRandomAndSingleDraw_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
// 获取开关状态并保存到设置中
bool isToggled = ToggleSwitchShowRandomAndSingleDraw.IsOn;
Settings.RandSettings.ShowRandomAndSingleDraw = isToggled;
// 更新UI显示
RandomDrawPanel.Visibility = isToggled ? Visibility.Visible : Visibility.Collapsed;
SingleDrawPanel.Visibility = isToggled ? Visibility.Visible : Visibility.Collapsed;
// 保存设置到文件
SaveSettingsToFile();
}
#endregion #endregion
public static void SaveSettingsToFile() { public static void SaveSettingsToFile() {
+43 -3
View File
@@ -70,8 +70,17 @@ namespace Ink_Canvas {
BoundsWidth = Settings.Advanced.FingerModeBoundsWidth; BoundsWidth = Settings.Advanced.FingerModeBoundsWidth;
} }
if (Settings.Startup.IsAutoUpdate) { // Always show update setting in UI based on stored preference
ToggleSwitchIsAutoUpdate.IsOn = true; ToggleSwitchIsAutoUpdate.IsOn = Settings.Startup.IsAutoUpdate;
// Always check for updates at startup, regardless of the setting
if (isStartup) {
LogHelper.WriteLogToFile("AutoUpdate | Running auto-update check at startup");
AutoUpdate();
}
// Call auto-update when setting is changed (not at startup)
else if (Settings.Startup.IsAutoUpdate) {
LogHelper.WriteLogToFile("AutoUpdate | Running auto-update check after settings change");
AutoUpdate(); AutoUpdate();
} }
@@ -434,6 +443,12 @@ namespace Ink_Canvas {
inkCanvas.ForceCursor = false; inkCanvas.ForceCursor = false;
} }
// 初始化压感触屏模式开关状态
ToggleSwitchEnablePressureTouchMode.IsOn = Settings.Canvas.EnablePressureTouchMode;
// 初始化屏蔽压感开关状态
ToggleSwitchDisablePressure.IsOn = Settings.Canvas.DisablePressure;
ComboBoxPenStyle.SelectedIndex = Settings.Canvas.InkStyle; ComboBoxPenStyle.SelectedIndex = Settings.Canvas.InkStyle;
BoardComboBoxPenStyle.SelectedIndex = Settings.Canvas.InkStyle; BoardComboBoxPenStyle.SelectedIndex = Settings.Canvas.InkStyle;
@@ -500,6 +515,14 @@ namespace Ink_Canvas {
ToggleSwitchFitToCurve.IsOn = false; ToggleSwitchFitToCurve.IsOn = false;
drawingAttributes.FitToCurve = false; drawingAttributes.FitToCurve = false;
} }
// 初始化直线自动拉直相关设置
ToggleSwitchAutoStraightenLine.IsOn = Settings.Canvas.AutoStraightenLine;
AutoStraightenLineThresholdSlider.Value = Settings.Canvas.AutoStraightenLineThreshold;
// 初始化直线端点吸附相关设置
ToggleSwitchLineEndpointSnapping.IsOn = Settings.Canvas.LineEndpointSnapping;
LineEndpointSnappingThresholdSlider.Value = Settings.Canvas.LineEndpointSnappingThreshold;
} else { } else {
Settings.Canvas = new Canvas(); Settings.Canvas = new Canvas();
} }
@@ -527,6 +550,12 @@ namespace Ink_Canvas {
FullScreenHelper.MarkFullscreenWindowTaskbarList(new WindowInteropHelper(this).Handle, true); FullScreenHelper.MarkFullscreenWindowTaskbarList(new WindowInteropHelper(this).Handle, true);
} }
ToggleSwitchIsEnableAvoidFullScreenHelper.IsOn = Settings.Advanced.IsEnableAvoidFullScreenHelper;
if (Settings.Advanced.IsEnableAvoidFullScreenHelper)
{
AvoidFullScreenHelper.StartAvoidFullScreen(this);
}
ToggleSwitchIsEnableEdgeGestureUtil.IsOn = Settings.Advanced.IsEnableEdgeGestureUtil; ToggleSwitchIsEnableEdgeGestureUtil.IsOn = Settings.Advanced.IsEnableEdgeGestureUtil;
if (Settings.Advanced.IsEnableEdgeGestureUtil) { if (Settings.Advanced.IsEnableEdgeGestureUtil) {
if (OSVersion.GetOperatingSystem() >= OperatingSystem.Windows10) if (OSVersion.GetOperatingSystem() >= OperatingSystem.Windows10)
@@ -558,12 +587,22 @@ namespace Ink_Canvas {
ToggleCheckboxEnableInkToShapeRectangle.IsChecked = Settings.InkToShape.IsInkToShapeRectangle; ToggleCheckboxEnableInkToShapeRectangle.IsChecked = Settings.InkToShape.IsInkToShapeRectangle;
ToggleCheckboxEnableInkToShapeRounded.IsChecked = Settings.InkToShape.IsInkToShapeRounded; ToggleCheckboxEnableInkToShapeRounded.IsChecked = Settings.InkToShape.IsInkToShapeRounded;
// 初始化直线拉直灵敏度
LineStraightenSensitivitySlider.Value = Settings.InkToShape.LineStraightenSensitivity;
} else { } else {
Settings.InkToShape = new InkToShape(); Settings.InkToShape = new InkToShape();
} }
// RandSettings // RandSettings
if (Settings.RandSettings != null) { } else { if (Settings.RandSettings != null) {
ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn = Settings.RandSettings.DisplayRandWindowNamesInputBtn;
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
ToggleSwitchShowRandomAndSingleDraw.IsOn = Settings.RandSettings.ShowRandomAndSingleDraw;
RandomDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
SingleDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
} else {
Settings.RandSettings = new RandSettings(); Settings.RandSettings = new RandSettings();
ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn = Settings.RandSettings.DisplayRandWindowNamesInputBtn; ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn = Settings.RandSettings.DisplayRandWindowNamesInputBtn;
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency; RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
@@ -613,6 +652,7 @@ namespace Ink_Canvas {
SettingsShowCanvasAtNewSlideShowStackPanel.Opacity = 0.5; SettingsShowCanvasAtNewSlideShowStackPanel.Opacity = 0.5;
SettingsShowCanvasAtNewSlideShowStackPanel.IsHitTestVisible = false; SettingsShowCanvasAtNewSlideShowStackPanel.IsHitTestVisible = false;
} }
ToggleSwitchAutoFoldInPPTSlideShow.IsOn = Settings.Automation.IsAutoFoldInPPTSlideShow; ToggleSwitchAutoFoldInPPTSlideShow.IsOn = Settings.Automation.IsAutoFoldInPPTSlideShow;
+91 -7
View File
@@ -56,7 +56,7 @@ namespace Ink_Canvas {
#endregion Floating Bar Control #endregion Floating Bar Control
private int drawingShapeMode = 0; private int drawingShapeMode = 0;
private bool isLongPressSelected = false; // 用于存是否是选中状态,便于后期抬笔后不做切换到笔的处理 private bool isLongPressSelected = false; // 用于存是否是"选中"状态,便于后期抬笔后不做切换到笔的处理
#region Buttons #region Buttons
@@ -429,6 +429,8 @@ namespace Ink_Canvas {
private void inkCanvas_TouchMove(object sender, TouchEventArgs e) { private void inkCanvas_TouchMove(object sender, TouchEventArgs e) {
if (isSingleFingerDragMode) return; if (isSingleFingerDragMode) return;
// 处理形状绘制模式
if (drawingShapeMode != 0) { if (drawingShapeMode != 0) {
if (isLastTouchEraser) return; if (isLastTouchEraser) return;
//EraserContainer.Background = null; //EraserContainer.Background = null;
@@ -443,15 +445,82 @@ namespace Ink_Canvas {
catch { catch {
Trace.WriteLine("lastTempStrokeCollection failed."); Trace.WriteLine("lastTempStrokeCollection failed.");
} }
return; return;
} }
if (inkCanvas.EditingMode != InkCanvasEditingMode.None)
inkCanvas.EditingMode = InkCanvasEditingMode.None;
} }
MouseTouchMove(e.GetTouchPoint(inkCanvas).Position); // 触摸移动时保持自定义光标显示
if (Settings.Canvas.IsShowCursor) {
inkCanvas.ForceCursor = true;
inkCanvas.UseCustomCursor = true; // 确保使用自定义光标
System.Windows.Forms.Cursor.Show();
}
if (NeedUpdateIniP()) iniP = e.GetTouchPoint(inkCanvas).Position;
if (drawingShapeMode == 9 && isFirstTouchCuboid == false) MouseTouchMove(iniP);
inkCanvas.Opacity = 1;
double boundsWidth = GetTouchBoundWidth(e), eraserMultiplier = 1.0;
if (!Settings.Advanced.EraserBindTouchMultiplier && Settings.Advanced.IsSpecialScreen)
eraserMultiplier = 1 / Settings.Advanced.TouchMultiplier;
if (boundsWidth > BoundsWidth) {
isLastTouchEraser = true;
if (drawingShapeMode == 0 && forceEraser) return;
if (boundsWidth > BoundsWidth * 2.5) {
double k = 1;
switch (Settings.Canvas.EraserSize) {
case 0:
k = 0.5;
break;
case 1:
k = 0.8;
break;
case 3:
k = 1.25;
break;
case 4:
k = 1.8;
break;
}
inkCanvas.EraserShape = new EllipseStylusShape(boundsWidth * k * eraserMultiplier,
boundsWidth * k * eraserMultiplier);
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
// 立即应用光标设置
if (Settings.Canvas.IsShowCursor) {
inkCanvas.Cursor = Cursors.Cross;
System.Windows.Forms.Cursor.Show();
}
}
else {
if (StackPanelPPTControls.Visibility == Visibility.Visible && inkCanvas.Strokes.Count == 0 &&
Settings.PowerPointSettings.IsEnableFingerGestureSlideShowControl) {
isLastTouchEraser = false;
inkCanvas.EditingMode = InkCanvasEditingMode.GestureOnly;
inkCanvas.Opacity = 0.1;
}
else {
inkCanvas.EraserShape = new EllipseStylusShape(5, 5);
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
}
}
}
else {
isLastTouchEraser = false;
// 修复面积擦时不显示橡皮形状:无论 forcePointEraser 状态,均显示 50x50 橡皮
inkCanvas.EraserShape = new EllipseStylusShape(50, 50);
if (forceEraser) return;
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
}
if (inkCanvas.EditingMode != InkCanvasEditingMode.None)
return;
if (e.TouchDevice == null) {
System.Windows.Forms.Cursor.Show();
} else {
System.Windows.Forms.Cursor.Hide();
}
} }
private int drawMultiStepShapeCurrentStep = 0; //多笔完成的图形 当前所处在的笔画 private int drawMultiStepShapeCurrentStep = 0; //多笔完成的图形 当前所处在的笔画
@@ -1607,9 +1676,24 @@ namespace Ink_Canvas {
private void MainWindow_OnMouseMove(object sender, MouseEventArgs e) { private void MainWindow_OnMouseMove(object sender, MouseEventArgs e) {
if (e.StylusDevice == null) { if (e.StylusDevice == null) {
// 鼠标移动时保持光标可见
System.Windows.Forms.Cursor.Show(); System.Windows.Forms.Cursor.Show();
// 如果用户设置了显示光标,则确保光标显示正确
if (Settings.Canvas.IsShowCursor && inkCanvas != null) {
inkCanvas.ForceCursor = true;
inkCanvas.UseCustomCursor = true;
}
} else { } else {
System.Windows.Forms.Cursor.Hide(); // 只有当用户未设置显示光标时才隐藏
if (!Settings.Canvas.IsShowCursor) {
System.Windows.Forms.Cursor.Hide();
} else if (inkCanvas != null) {
// 如果用户设置了显示光标,则确保光标显示正确
inkCanvas.ForceCursor = true;
inkCanvas.UseCustomCursor = true;
System.Windows.Forms.Cursor.Show();
}
} }
} }
} }
@@ -13,12 +13,154 @@ namespace Ink_Canvas {
public partial class MainWindow : Window { public partial class MainWindow : Window {
private StrokeCollection newStrokes = new StrokeCollection(); private StrokeCollection newStrokes = new StrokeCollection();
private List<Circle> circles = new List<Circle>(); private List<Circle> circles = new List<Circle>();
private const double SNAP_THRESHOLD = 15.0; // Distance threshold for endpoint snapping
private const double LINE_STRAIGHTEN_THRESHOLD = 0.10; // 降低阈值,让直线检测更严格
private void inkCanvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e) { private void inkCanvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e) {
if (Settings.Canvas.FitToCurve == true) drawingAttributes.FitToCurve = false; if (Settings.Canvas.FitToCurve == true) drawingAttributes.FitToCurve = false;
try { try {
inkCanvas.Opacity = 1; inkCanvas.Opacity = 1;
// 应用屏蔽压感功能 - 如果启用,所有笔画都使用统一粗细
if (Settings.Canvas.DisablePressure) {
var uniformPoints = new StylusPointCollection();
foreach (StylusPoint point in e.Stroke.StylusPoints) {
StylusPoint newPoint = new StylusPoint(point.X, point.Y, 0.5f); // 统一压感值为0.5
uniformPoints.Add(newPoint);
}
e.Stroke.StylusPoints = uniformPoints;
}
// 应用压感触屏模式 - 如果启用并且检测到触屏输入
else if (Settings.Canvas.EnablePressureTouchMode) {
bool isTouchInput = true;
foreach (StylusPoint point in e.Stroke.StylusPoints) {
// 检测是否为压感笔输入(压感笔的PressureFactor不等于0.5或0
if ((point.PressureFactor > 0.501 || point.PressureFactor < 0.5) && point.PressureFactor != 0) {
isTouchInput = false;
break;
}
}
// 如果是触屏输入,则应用模拟压感
if (isTouchInput) {
switch (Settings.Canvas.InkStyle) {
case 1:
if (penType == 0)
try {
var stylusPoints = new StylusPointCollection();
var n = e.Stroke.StylusPoints.Count - 1;
for (var i = 0; i <= n; i++) {
var speed = GetPointSpeed(e.Stroke.StylusPoints[Math.Max(i - 1, 0)].ToPoint(),
e.Stroke.StylusPoints[i].ToPoint(),
e.Stroke.StylusPoints[Math.Min(i + 1, n)].ToPoint());
var point = new StylusPoint();
if (speed >= 0.25)
point.PressureFactor = (float)(0.5 - 0.3 * (Math.Min(speed, 1.5) - 0.3) / 1.2);
else if (speed >= 0.05)
point.PressureFactor = (float)0.5;
else
point.PressureFactor = (float)(0.5 + 0.4 * (0.05 - speed) / 0.05);
point.X = e.Stroke.StylusPoints[i].X;
point.Y = e.Stroke.StylusPoints[i].Y;
stylusPoints.Add(point);
}
e.Stroke.StylusPoints = stylusPoints;
}
catch { }
break;
case 0:
if (penType == 0)
try {
var stylusPoints = new StylusPointCollection();
var n = e.Stroke.StylusPoints.Count - 1;
var pressure = 0.1;
var x = 10;
if (n == 1) return;
if (n >= x) {
for (var i = 0; i < n - x; i++) {
var point = new StylusPoint();
point.PressureFactor = (float)0.5;
point.X = e.Stroke.StylusPoints[i].X;
point.Y = e.Stroke.StylusPoints[i].Y;
stylusPoints.Add(point);
}
for (var i = n - x; i <= n; i++) {
var point = new StylusPoint();
point.PressureFactor = (float)((0.5 - pressure) * (n - i) / x + pressure);
point.X = e.Stroke.StylusPoints[i].X;
point.Y = e.Stroke.StylusPoints[i].Y;
stylusPoints.Add(point);
}
}
else {
for (var i = 0; i <= n; i++) {
var point = new StylusPoint();
point.PressureFactor = (float)(0.4 * (n - i) / n + pressure);
point.X = e.Stroke.StylusPoints[i].X;
point.Y = e.Stroke.StylusPoints[i].Y;
stylusPoints.Add(point);
}
}
e.Stroke.StylusPoints = stylusPoints;
}
catch { }
break;
}
}
}
// Apply line straightening and endpoint snapping if ink-to-shape is enabled
if (Settings.InkToShape.IsInkToShapeEnabled) {
// Check if this stroke could be a straight line
if (IsPotentialStraightLine(e.Stroke)) {
// Get start and end points of the stroke
Point startPoint = e.Stroke.StylusPoints[0].ToPoint();
Point endPoint = e.Stroke.StylusPoints[e.Stroke.StylusPoints.Count - 1].ToPoint();
// Try to snap endpoints to existing strokes
bool snapped = false;
if (Settings.InkToShape.IsInkToShapeRectangle || Settings.InkToShape.IsInkToShapeTriangle) {
Point[] snappedPoints = GetSnappedEndpoints(startPoint, endPoint);
if (snappedPoints != null) {
startPoint = snappedPoints[0];
endPoint = snappedPoints[1];
snapped = true;
}
}
// Create straight line stroke
if (snapped || ShouldStraightenLine(e.Stroke)) {
StylusPointCollection straightLinePoints = CreateStraightLine(startPoint, endPoint);
Stroke straightStroke = new Stroke(straightLinePoints) {
DrawingAttributes = inkCanvas.DefaultDrawingAttributes.Clone()
};
// Replace the original stroke with the straightened one
SetNewBackupOfStroke();
_currentCommitType = CommitReason.ShapeRecognition;
inkCanvas.Strokes.Remove(e.Stroke);
inkCanvas.Strokes.Add(straightStroke);
_currentCommitType = CommitReason.UserInput;
// We can't modify e.Stroke directly, but we need to update newStrokes
// to ensure proper shape recognition for the straightened line
if (newStrokes.Contains(e.Stroke)) {
newStrokes.Remove(e.Stroke);
newStrokes.Add(straightStroke);
}
}
}
}
if (Settings.InkToShape.IsInkToShapeEnabled && !Environment.Is64BitProcess) { if (Settings.InkToShape.IsInkToShapeEnabled && !Environment.Is64BitProcess) {
void InkToShapeProcess() { void InkToShapeProcess() {
try { try {
@@ -422,6 +564,203 @@ namespace Ink_Canvas {
if (Settings.Canvas.FitToCurve == true) drawingAttributes.FitToCurve = true; if (Settings.Canvas.FitToCurve == true) drawingAttributes.FitToCurve = true;
} }
// New method: Checks if a stroke is potentially a straight line
private bool IsPotentialStraightLine(Stroke stroke) {
// 确保有足够的点来进行线条分析
if (stroke.StylusPoints.Count < 5)
return false;
Point start = stroke.StylusPoints.First().ToPoint();
Point end = stroke.StylusPoints.Last().ToPoint();
double lineLength = GetDistance(start, end);
// 线条必须足够长才考虑拉直,至少30像素
if (lineLength < 30)
return false;
// 获取用户设置的灵敏度值
double sensitivity = Settings.InkToShape.LineStraightenSensitivity;
// 快速检查使用略宽松的阈值
double quickThreshold = Math.Min(sensitivity * 1.5, 0.20);
// 快速检查:计算几个关键点与直线的距离
if (stroke.StylusPoints.Count >= 10) {
// 取中点和1/4、3/4位置的点,快速检查偏差
int quarterIdx = stroke.StylusPoints.Count / 4;
int midIdx = stroke.StylusPoints.Count / 2;
int threeQuarterIdx = quarterIdx * 3;
Point quarterPoint = stroke.StylusPoints[quarterIdx].ToPoint();
Point midPoint = stroke.StylusPoints[midIdx].ToPoint();
Point threeQuarterPoint = stroke.StylusPoints[threeQuarterIdx].ToPoint();
double quarterDeviation = DistanceFromLineToPoint(start, end, quarterPoint);
double midDeviation = DistanceFromLineToPoint(start, end, midPoint);
double threeQuarterDeviation = DistanceFromLineToPoint(start, end, threeQuarterPoint);
// 如果任一点偏离太大,直接排除
double quickRelativeThreshold = lineLength * quickThreshold;
if (quarterDeviation > quickRelativeThreshold ||
midDeviation > quickRelativeThreshold ||
threeQuarterDeviation > quickRelativeThreshold) {
return false;
}
}
return true;
}
// New method: Determines if a stroke should be straightened into a line
private bool ShouldStraightenLine(Stroke stroke) {
// Basic implementation: check if points roughly follow a straight line
Point start = stroke.StylusPoints.First().ToPoint();
Point end = stroke.StylusPoints.Last().ToPoint();
// Calculate max deviation from the straight line between start and end
double maxDeviation = 0;
double lineLength = GetDistance(start, end);
// 如果线条太短,不进行拉直处理
if (lineLength < 50) {
return false;
}
// 获取用户设置的灵敏度值
double sensitivity = Settings.InkToShape.LineStraightenSensitivity;
// 计算点与直线的偏差
double totalDeviation = 0;
int pointCount = 0;
// Calculate deviation for each point
foreach (StylusPoint sp in stroke.StylusPoints) {
Point p = sp.ToPoint();
double deviation = DistanceFromLineToPoint(start, end, p);
maxDeviation = Math.Max(maxDeviation, deviation);
totalDeviation += deviation;
pointCount++;
}
// 计算平均偏差
double avgDeviation = totalDeviation / pointCount;
// 检查点分布的一致性 - 如果有些点偏离很大而其他点很接近直线,表明线条有明显弯曲
double deviationVariance = 0;
foreach (StylusPoint sp in stroke.StylusPoints) {
Point p = sp.ToPoint();
double deviation = DistanceFromLineToPoint(start, end, p);
deviationVariance += Math.Pow(deviation - avgDeviation, 2);
}
deviationVariance /= pointCount;
// 如果最大偏差超过线长的阈值比例,或者偏差方差较大(表示不均匀弯曲),则不拉直
if ((maxDeviation / lineLength) > sensitivity) {
return false;
}
// 如果偏差方差大,说明线条弯曲不均匀
if (deviationVariance > (sensitivity * lineLength * 0.05)) {
return false;
}
// 检查中点偏离情况 - 针对弧形线条特别有效
if (stroke.StylusPoints.Count > 10) {
int midIndex = stroke.StylusPoints.Count / 2;
Point midPoint = stroke.StylusPoints[midIndex].ToPoint();
double midDeviation = DistanceFromLineToPoint(start, end, midPoint);
// 如果中点偏离过大,不拉直
if (midDeviation > (lineLength * sensitivity * 0.8)) {
return false;
}
}
return true;
}
// New method: Creates a straight line stroke between two points
private StylusPointCollection CreateStraightLine(Point start, Point end) {
StylusPointCollection points = new StylusPointCollection();
// Create a more natural pressure profile for the line
if (Settings.InkToShape.IsInkToShapeNoFakePressureRectangle == true || penType == 1) {
points.Add(new StylusPoint(start.X, start.Y));
points.Add(new StylusPoint(end.X, end.Y));
} else {
points.Add(new StylusPoint(start.X, start.Y, 0.4f));
// Add a middle point with higher pressure
Point midPoint = new Point((start.X + end.X) / 2, (start.Y + end.Y) / 2);
points.Add(new StylusPoint(midPoint.X, midPoint.Y, 0.8f));
points.Add(new StylusPoint(end.X, end.Y, 0.4f));
}
return points;
}
// New method: Gets distance from point to a line defined by two points
private double DistanceFromLineToPoint(Point lineStart, Point lineEnd, Point point) {
// Calculate distance from point to line defined by lineStart and lineEnd
double lineLength = GetDistance(lineStart, lineEnd);
if (lineLength == 0) return GetDistance(point, lineStart);
// Calculate the cross product to get the perpendicular distance
double distance = Math.Abs((lineEnd.Y - lineStart.Y) * point.X -
(lineEnd.X - lineStart.X) * point.Y +
lineEnd.X * lineStart.Y - lineEnd.Y * lineStart.X) / lineLength;
return distance;
}
// New method: Attempts to snap endpoints to existing stroke endpoints
private Point[] GetSnappedEndpoints(Point start, Point end) {
bool startSnapped = false;
bool endSnapped = false;
Point snappedStart = start;
Point snappedEnd = end;
// Check all strokes in canvas for potential snap points
foreach (Stroke stroke in inkCanvas.Strokes) {
if (stroke.StylusPoints.Count == 0) continue;
// Get stroke endpoints
Point strokeStart = stroke.StylusPoints.First().ToPoint();
Point strokeEnd = stroke.StylusPoints.Last().ToPoint();
// Check if start point should snap to an endpoint
if (!startSnapped) {
if (GetDistance(start, strokeStart) < SNAP_THRESHOLD) {
snappedStart = strokeStart;
startSnapped = true;
} else if (GetDistance(start, strokeEnd) < SNAP_THRESHOLD) {
snappedStart = strokeEnd;
startSnapped = true;
}
}
// Check if end point should snap to an endpoint
if (!endSnapped) {
if (GetDistance(end, strokeStart) < SNAP_THRESHOLD) {
snappedEnd = strokeStart;
endSnapped = true;
} else if (GetDistance(end, strokeEnd) < SNAP_THRESHOLD) {
snappedEnd = strokeEnd;
endSnapped = true;
}
}
// If both endpoints are snapped, we're done
if (startSnapped && endSnapped) break;
}
// Return snapped points if any snapping occurred
if (startSnapped || endSnapped) {
return new Point[] { snappedStart, snappedEnd };
}
return null;
}
private void SetNewBackupOfStroke() { private void SetNewBackupOfStroke() {
lastTouchDownStrokeCollection = inkCanvas.Strokes.Clone(); lastTouchDownStrokeCollection = inkCanvas.Strokes.Clone();
var whiteboardIndex = CurrentWhiteboardIndex; var whiteboardIndex = CurrentWhiteboardIndex;
+5 -5
View File
@@ -122,8 +122,8 @@ namespace Ink_Canvas {
} }
if (Settings.Automation.IsAutoKillIDT) { if (Settings.Automation.IsAutoKillIDT) {
var processes = Process.GetProcessesByName("智绘教"); var processes = Process.GetProcessesByName("Inkeys");
if (processes.Length > 0) arg += " /IM \"智绘教.exe\""; if (processes.Length > 0) arg += " /IM \"Inkeys.exe\"";
} }
if (Settings.Automation.IsAutoKillSeewoLauncher2DesktopAnnotation) { if (Settings.Automation.IsAutoKillSeewoLauncher2DesktopAnnotation) {
@@ -162,9 +162,9 @@ namespace Ink_Canvas {
}); });
} }
if (arg.Contains("智绘教")) { if (arg.Contains("Inkeys")) {
Dispatcher.Invoke(() => { Dispatcher.Invoke(() => {
ShowNotification("“智绘教”已自动关闭"); ShowNotification("“智绘教Inkeys”已自动关闭");
}); });
} }
@@ -178,7 +178,7 @@ namespace Ink_Canvas {
if (arg.Contains("DesktopAnnotation")) if (arg.Contains("DesktopAnnotation"))
{ {
Dispatcher.Invoke(() => { Dispatcher.Invoke(() => {
ShowNotification("“DesktopAnnotation”已自动关闭"); ShowNotification("“希沃桌面2.0 桌面批注”已自动关闭");
}); });
} }
} }
+9 -2
View File
@@ -79,6 +79,8 @@ namespace Ink_Canvas {
} }
else { else {
TouchDownPointsList[e.TouchDevice.Id] = InkCanvasEditingMode.None; TouchDownPointsList[e.TouchDevice.Id] = InkCanvasEditingMode.None;
// 修复面积擦时不显示橡皮形状:无论 forcePointEraser 状态,均显示 50x50 橡皮
inkCanvas.EraserShape = new EllipseStylusShape(50, 50);
inkCanvas.EditingMode = InkCanvasEditingMode.None; inkCanvas.EditingMode = InkCanvasEditingMode.None;
} }
} }
@@ -181,6 +183,11 @@ namespace Ink_Canvas {
private bool forcePointEraser = true; private bool forcePointEraser = true;
private void Main_Grid_TouchDown(object sender, TouchEventArgs e) { private void Main_Grid_TouchDown(object sender, TouchEventArgs e) {
// 确保触摸时显示自定义光标
if (Settings.Canvas.IsShowCursor) {
inkCanvas.ForceCursor = true;
System.Windows.Forms.Cursor.Show();
}
inkCanvas.CaptureTouch(e.TouchDevice); inkCanvas.CaptureTouch(e.TouchDevice);
ViewboxFloatingBar.IsHitTestVisible = false; ViewboxFloatingBar.IsHitTestVisible = false;
@@ -236,8 +243,8 @@ namespace Ink_Canvas {
} }
else { else {
isLastTouchEraser = false; isLastTouchEraser = false;
inkCanvas.EraserShape = // 修复面积擦时不显示橡皮形状:无论 forcePointEraser 状态,均显示 50x50 橡皮
forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5); inkCanvas.EraserShape = new EllipseStylusShape(50, 50);
if (forceEraser) return; if (forceEraser) return;
inkCanvas.EditingMode = InkCanvasEditingMode.Ink; inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
} }
+24 -2
View File
@@ -54,12 +54,34 @@ namespace Ink_Canvas
private void CloseAppTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e) { private void CloseAppTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e) {
var mainWin = (MainWindow)Application.Current.MainWindow; var mainWin = (MainWindow)Application.Current.MainWindow;
if (mainWin.IsLoaded) mainWin.BtnExit_Click(null,null); if (mainWin.IsLoaded) {
App.IsAppExitByUser = true;
Application.Current.Shutdown();
// mainWin.BtnExit_Click(null,null);
}
} }
private void RestartAppTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e) { private void RestartAppTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e) {
var mainWin = (MainWindow)Application.Current.MainWindow; var mainWin = (MainWindow)Application.Current.MainWindow;
if (mainWin.IsLoaded) mainWin.BtnRestart_Click(null,null); if (mainWin.IsLoaded) {
App.IsAppExitByUser = true;
try {
// 启动新实例
string exePath = Process.GetCurrentProcess().MainModule.FileName;
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = exePath;
startInfo.UseShellExecute = true;
// 启动进程但不等待
Process.Start(startInfo);
} catch (Exception ex) {
LogHelper.NewLog($"重启程序时出错: {ex.Message}");
}
// 退出当前实例
Application.Current.Shutdown();
}
} }
private void ForceFullScreenTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e) { private void ForceFullScreenTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e) {
+2 -2
View File
@@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.0.5.1")] [assembly: AssemblyVersion("1.6.4.0")]
[assembly: AssemblyFileVersion("5.0.5.1")] [assembly: AssemblyFileVersion("1.6.4.0")]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 KiB

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 KiB

After

Width:  |  Height:  |  Size: 151 KiB

+20 -1
View File
@@ -48,6 +48,18 @@ namespace Ink_Canvas
public bool FitToCurve { get; set; } = true; public bool FitToCurve { get; set; } = true;
[JsonProperty("clearCanvasAndClearTimeMachine")] [JsonProperty("clearCanvasAndClearTimeMachine")]
public bool ClearCanvasAndClearTimeMachine { get; set; } = false; public bool ClearCanvasAndClearTimeMachine { get; set; } = false;
[JsonProperty("enablePressureTouchMode")]
public bool EnablePressureTouchMode { get; set; } = false; // 是否启用压感触屏模式
[JsonProperty("disablePressure")]
public bool DisablePressure { get; set; } = false; // 是否屏蔽压感
[JsonProperty("autoStraightenLine")]
public bool AutoStraightenLine { get; set; } = true; // 是否启用直线自动拉直
[JsonProperty("autoStraightenLineThreshold")]
public int AutoStraightenLineThreshold { get; set; } = 30; // 直线自动拉直的长度阈值(像素)
[JsonProperty("lineEndpointSnapping")]
public bool LineEndpointSnapping { get; set; } = true; // 是否启用直线端点吸附
[JsonProperty("lineEndpointSnappingThreshold")]
public int LineEndpointSnappingThreshold { get; set; } = 15; // 直线端点吸附的距离阈值(像素)
[JsonProperty("usingWhiteboard")] [JsonProperty("usingWhiteboard")]
public bool UsingWhiteboard { get; set; } public bool UsingWhiteboard { get; set; }
@@ -308,7 +320,7 @@ namespace Ink_Canvas
public bool IsAutoKillICA { get; set; } = false; public bool IsAutoKillICA { get; set; } = false;
[JsonProperty("isAutoKillIDT")] [JsonProperty("isAutoKillIDT")]
public bool IsAutoKillIDT { get; set; } = true; public bool IsAutoKillIDT { get; set; } = false;
[JsonProperty("isSaveScreenshotsInDateFolders")] [JsonProperty("isSaveScreenshotsInDateFolders")]
public bool IsSaveScreenshotsInDateFolders { get; set; } = false; public bool IsSaveScreenshotsInDateFolders { get; set; } = false;
@@ -378,6 +390,9 @@ namespace Ink_Canvas
[JsonProperty("isSecondConfirmWhenShutdownApp")] [JsonProperty("isSecondConfirmWhenShutdownApp")]
public bool IsSecondConfirmWhenShutdownApp { get; set; } = false; public bool IsSecondConfirmWhenShutdownApp { get; set; } = false;
[JsonProperty("isEnableAvoidFullScreenHelper")]
public bool IsEnableAvoidFullScreenHelper { get; set; } = false;
} }
public class InkToShape public class InkToShape
@@ -394,6 +409,8 @@ namespace Ink_Canvas
public bool IsInkToShapeRectangle { get; set; } = true; public bool IsInkToShapeRectangle { get; set; } = true;
[JsonProperty("isInkToShapeRounded")] [JsonProperty("isInkToShapeRounded")]
public bool IsInkToShapeRounded { get; set; } = true; public bool IsInkToShapeRounded { get; set; } = true;
[JsonProperty("lineStraightenSensitivity")]
public double LineStraightenSensitivity { get; set; } = 0.10; // 直线检测灵敏度,值越小越严格(0.05-0.75)
} }
public class RandSettings { public class RandSettings {
@@ -403,5 +420,7 @@ namespace Ink_Canvas
public double RandWindowOnceCloseLatency { get; set; } = 2.5; public double RandWindowOnceCloseLatency { get; set; } = 2.5;
[JsonProperty("randWindowOnceMaxStudents")] [JsonProperty("randWindowOnceMaxStudents")]
public int RandWindowOnceMaxStudents { get; set; } = 10; public int RandWindowOnceMaxStudents { get; set; } = 10;
[JsonProperty("showRandomAndSingleDraw")]
public bool ShowRandomAndSingleDraw { get; set; } = true;
} }
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 KiB

After

Width:  |  Height:  |  Size: 190 KiB

+69 -23
View File
@@ -10,20 +10,24 @@
ui:WindowHelper.UseModernWindowStyle = "True" ui:WindowHelper.UseModernWindowStyle = "True"
ui:WindowHelper.SystemBackdropType="Mica" ui:WindowHelper.SystemBackdropType="Mica"
ui:TitleBar.Height="36" ui:TitleBar.Height="36"
Title="InkCanvasForClass有新版本可用" Height="475" Width="800" ResizeMode="NoResize"> Title="InkCanvasForClass CE有新版本可用" Height="680" Width="850" ResizeMode="NoResize"
<Grid Background="#fafafa"> WindowStartupLocation="CenterScreen">
<ui:SimpleStackPanel VerticalAlignment="Stretch" Spacing="0"> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<Grid Background="#fafafa" Margin="0,0,0,30">
<ui:SimpleStackPanel VerticalAlignment="Stretch" Spacing="0">
<!-- 标题栏 -->
<ui:SimpleStackPanel Orientation="Horizontal" Background="#2563eb" Margin="0,0,0,0"> <ui:SimpleStackPanel Orientation="Horizontal" Background="#2563eb" Margin="0,0,0,0">
<ui:SimpleStackPanel Orientation="Vertical" Width="685" Margin="24,18,0,12" Spacing="2"> <ui:SimpleStackPanel Orientation="Vertical" Width="735" Margin="24,18,0,12" Spacing="2">
<TextBlock Text="InkCanvasForClass 新版本来了!" FontSize="24" FontWeight="Bold" Foreground="White" TextAlignment="Left"/> <TextBlock Text="InkCanvasForClass CE新版本来了!" FontSize="24" FontWeight="Bold" Foreground="White" TextAlignment="Left"/>
<TextBlock Text="希望您能喜欢我们的新版本 :-)" FontSize="20" TextAlignment="Left" Foreground="White"/> <TextBlock Text="希望您能喜欢我们的新版本 :-)" FontSize="20" TextAlignment="Left" Foreground="White"/>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<Image Source="/Resources/Icons-fluent/party.png" Width="72" Height="72"/> <Image Source="/Resources/Icons-fluent/party.png" Width="72" Height="72"/>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<Border BorderBrush="#3f3f46" Background="White" BorderThickness="1" CornerRadius="4" Margin="24,12,24,0"> <!-- 更新内容 -->
<ui:ScrollViewerEx Margin="0" VerticalScrollBarVisibility="Auto" Height="256" PanningMode="VerticalOnly"> <Border BorderBrush="#3f3f46" Background="White" BorderThickness="1" CornerRadius="4" Margin="24,16,24,0">
<mdxam:MarkdownScrollViewer xml:space="preserve" Foreground="Black" MarkdownStyleName="GithubLike"> <ui:ScrollViewerEx Margin="0" VerticalScrollBarVisibility="Auto" Height="180" PanningMode="VerticalOnly">
<mdxam:MarkdownScrollViewer x:Name="markdownContent" xml:space="preserve" Foreground="Black" MarkdownStyleName="GithubLike">
# InkCanvasForClass v5.0.2更新 # InkCanvasForClass v5.0.2更新
你好,旅行者们,本次InkCanvasForClass更新带来了如下新功能供您探索: 你好,旅行者们,本次InkCanvasForClass更新带来了如下新功能供您探索:
@@ -39,21 +43,63 @@
</mdxam:MarkdownScrollViewer> </mdxam:MarkdownScrollViewer>
</ui:ScrollViewerEx> </ui:ScrollViewerEx>
</Border> </Border>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="12" Margin="0,8,0,0">
<TextBlock Text="本次更新: 4.9.1 -> 5.9.1" FontWeight="Bold" FontSize="14" TextAlignment="Center"/> <!-- 版本信息 -->
<TextBlock Text="2024年8月4日发布更新" FontSize="14" TextAlignment="Center"/> <ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="16" Margin="0,16,0,0">
<TextBlock x:Name="updateVersionInfo" Text="本次更新: 4.9.1 -> 5.9.1" FontWeight="Bold" FontSize="15" TextAlignment="Center"/>
<TextBlock x:Name="updateDateInfo" Text="2024年8月4日发布更新" FontSize="15" TextAlignment="Center"/>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="12">
<Button Content="立刻更新" Foreground="White" HorizontalAlignment="Center" Margin="0,10,0,0"> <!-- 自动更新选项 -->
<Button.Resources> <Border Background="White" BorderBrush="#e2e8f0" BorderThickness="1" CornerRadius="4" Margin="24,16,24,0">
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundKey}" Color="#15803d"/> <ui:SimpleStackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="0,16,0,16" Spacing="10">
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundPointerOverKey}" Color="#15803d"/> <TextBlock Text="更新设置" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center" Margin="0,0,0,6"/>
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundPressedKey}" Color="#166534"/>
</Button.Resources> <!-- 水平排列两个ToggleSwitch -->
</Button> <ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
<Button Content="下次更新" Foreground="Black" HorizontalAlignment="Center" Margin="0,10,0,0"/> <ui:SimpleStackPanel Orientation="Vertical" Spacing="4">
<Button Content="跳过该版本" HorizontalAlignment="Center" Foreground="#71717a" Margin="0,10,0,0"/> <ui:ToggleSwitch x:Name="EnableAutoUpdateToggle" Header="启用自动更新" OnContent="开启" OffContent="关闭" IsOn="True" Width="170" Foreground="Black"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Vertical" Spacing="4">
<ui:ToggleSwitch x:Name="EnableSilentUpdateToggle" Header="启用静默更新" OnContent="开启" OffContent="关闭" Width="170" Foreground="Black"/>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
<TextBlock Text="静默更新将在软件不使用时自动安装,无需手动操作" FontSize="13" Foreground="#71717a" HorizontalAlignment="Center"
Margin="4,0,0,0" Width="360" TextWrapping="Wrap"/>
</ui:SimpleStackPanel>
</Border>
<!-- 更新按钮组 -->
<Border Background="#f1f5f9" BorderBrush="#e2e8f0" BorderThickness="1" CornerRadius="4" Margin="24,16,24,20">
<ui:SimpleStackPanel Orientation="Vertical" HorizontalAlignment="Center" Spacing="14" Margin="0,16,0,16">
<TextBlock Text="请选择更新方式" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center" Margin="0,0,0,6"/>
<!-- 立即更新按钮 -->
<Button x:Name="UpdateNowButton" Content="立刻下载并安装" Foreground="White" FontSize="15" FontWeight="SemiBold"
Padding="20,10" Width="360" Height="48" HorizontalAlignment="Center"
Click="UpdateNowButton_Click" ToolTip="立即下载更新并在完成后安装" Visibility="Visible" IsEnabled="True">
<Button.Resources>
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundKey}" Color="#15803d"/>
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundPointerOverKey}" Color="#15803d"/>
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundPressedKey}" Color="#166534"/>
</Button.Resources>
</Button>
<!-- 稍后更新按钮 -->
<Button x:Name="UpdateLaterButton" Content="下载并在软件关闭时安装" Foreground="Black" FontSize="15"
Padding="20,10" Width="360" Height="48" HorizontalAlignment="Center"
Click="UpdateLaterButton_Click" Background="#e2e8f0" BorderBrush="#cbd5e1"
ToolTip="后台下载更新,在软件关闭时自动安装" Visibility="Visible" IsEnabled="True"/>
<!-- 跳过版本按钮 -->
<Button x:Name="SkipVersionButton" Content="跳过该版本" HorizontalAlignment="Center" Foreground="#71717a"
FontSize="15" Padding="20,10" Width="360" Height="48" Click="SkipVersionButton_Click"
Background="#f8fafc" BorderBrush="#cbd5e1" ToolTip="跳过此版本更新" Visibility="Visible" IsEnabled="True"/>
</ui:SimpleStackPanel>
</Border>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</ui:SimpleStackPanel> </Grid>
</Grid> </ScrollViewer>
</Window> </Window>
+252 -3
View File
@@ -45,7 +45,7 @@ namespace Ink_Canvas
} }
int useImmersiveDarkMode = enabled ? 1 : 0; int useImmersiveDarkMode = enabled ? 1 : 0;
return DwmSetWindowAttribute(handle, (int)attribute, ref useImmersiveDarkMode, sizeof(int)) == 0; return DwmSetWindowAttribute(handle, attribute, ref useImmersiveDarkMode, sizeof(int)) == 0;
} }
return false; return false;
@@ -55,12 +55,261 @@ namespace Ink_Canvas
{ {
return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= build; return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= build;
} }
public HasNewUpdateWindow()
// 存储更新版本信息
public string CurrentVersion { get; set; }
public string NewVersion { get; set; }
public string ReleaseDate { get; set; }
public string ReleaseNotes { get; set; }
// 更新按钮结果
public enum UpdateResult
{
UpdateNow,
UpdateLater,
SkipVersion
}
public UpdateResult Result { get; private set; } = UpdateResult.UpdateLater;
// 更新设置
public bool IsAutoUpdateEnabled => EnableAutoUpdateToggle.IsOn;
public bool IsSilentUpdateEnabled => EnableSilentUpdateToggle.IsOn;
public HasNewUpdateWindow(string currentVersion, string newVersion, string releaseDate, string releaseNotes = null)
{ {
InitializeComponent(); InitializeComponent();
// 设置版本信息
CurrentVersion = currentVersion;
NewVersion = newVersion;
ReleaseDate = releaseDate;
ReleaseNotes = releaseNotes;
// 更新UI
updateVersionInfo.Text = $"本次更新: {CurrentVersion} -> {NewVersion}";
updateDateInfo.Text = $"{ReleaseDate}发布更新";
// 如果有发布说明,设置到Markdown内容中
if (!string.IsNullOrEmpty(ReleaseNotes))
{
markdownContent.Markdown = ReleaseNotes;
}
// 初始化自动更新设置
EnableAutoUpdateToggle.IsOn = MainWindow.Settings.Startup.IsAutoUpdate;
EnableSilentUpdateToggle.IsOn = MainWindow.Settings.Startup.IsAutoUpdateWithSilence;
// 确保按钮可见且可用
EnsureButtonsVisibility();
// 显示窗口动画
AnimationsHelper.ShowWithFadeIn(this, 0.25); AnimationsHelper.ShowWithFadeIn(this, 0.25);
Trace.WriteLine(new WindowInteropHelper(this).Handle);
// 设置深色模式
UseImmersiveDarkMode(new WindowInteropHelper(this).Handle, true); UseImmersiveDarkMode(new WindowInteropHelper(this).Handle, true);
// 窗口加载完成后再次确保按钮可见
this.Loaded += HasNewUpdateWindow_Loaded;
}
private void HasNewUpdateWindow_Loaded(object sender, RoutedEventArgs e)
{
// 窗口加载完成后再次确保按钮可见
EnsureButtonsVisibility();
// 调整窗口大小以适应屏幕分辨率
AdjustWindowSizeForScreenResolution();
}
// 确保按钮可见并启用
private void EnsureButtonsVisibility()
{
// 确保立即更新按钮可见
UpdateNowButton.Visibility = Visibility.Visible;
UpdateNowButton.IsEnabled = true;
// 确保稍后更新按钮可见
UpdateLaterButton.Visibility = Visibility.Visible;
UpdateLaterButton.IsEnabled = true;
// 确保跳过版本按钮可见
SkipVersionButton.Visibility = Visibility.Visible;
SkipVersionButton.IsEnabled = true;
// 强制刷新UI
UpdateLayout();
// 记录日志
LogHelper.WriteLogToFile("AutoUpdate | Update dialog buttons visibility ensured");
}
private void UpdateNowButton_Click(object sender, RoutedEventArgs e)
{
LogHelper.WriteLogToFile("AutoUpdate | Update Now button clicked");
// 保存自动更新设置
SaveUpdateSettings();
// 设置结果为立即更新
Result = UpdateResult.UpdateNow;
// 关闭窗口,返回到MainWindow处理后续下载和安装流程
DialogResult = true;
Close();
}
private void UpdateLaterButton_Click(object sender, RoutedEventArgs e)
{
LogHelper.WriteLogToFile("AutoUpdate | Update Later button clicked");
// 保存自动更新设置
SaveUpdateSettings();
// 设置结果为稍后更新
Result = UpdateResult.UpdateLater;
// 关闭窗口
DialogResult = true;
Close();
}
private void SkipVersionButton_Click(object sender, RoutedEventArgs e)
{
LogHelper.WriteLogToFile("AutoUpdate | Skip Version button clicked");
// 保存自动更新设置
SaveUpdateSettings();
// 设置结果为跳过该版本
Result = UpdateResult.SkipVersion;
// 关闭窗口
DialogResult = true;
Close();
}
private void SaveUpdateSettings()
{
// 保存自动更新设置
MainWindow.Settings.Startup.IsAutoUpdate = EnableAutoUpdateToggle.IsOn;
MainWindow.Settings.Startup.IsAutoUpdateWithSilence = EnableSilentUpdateToggle.IsOn;
// 记录到日志
LogHelper.WriteLogToFile($"AutoUpdate | User settings changed: AutoUpdate={EnableAutoUpdateToggle.IsOn}, SilentUpdate={EnableSilentUpdateToggle.IsOn}");
}
// 根据屏幕分辨率调整窗口大小
private void AdjustWindowSizeForScreenResolution()
{
try
{
// 获取主屏幕分辨率
double screenWidth = SystemParameters.PrimaryScreenWidth;
double screenHeight = SystemParameters.PrimaryScreenHeight;
LogHelper.WriteLogToFile($"AutoUpdate | Screen resolution: {screenWidth}x{screenHeight}");
// 始终确保窗口不超过屏幕大小的85%
double maxHeight = screenHeight * 0.85;
double maxWidth = screenWidth * 0.85;
bool needsAdjustment = false;
// 如果窗口高度超过最大允许高度,调整窗口高度
if (this.Height > maxHeight)
{
this.Height = maxHeight;
needsAdjustment = true;
LogHelper.WriteLogToFile($"AutoUpdate | Adjusted window height to: {this.Height}");
}
// 如果窗口宽度超过最大允许宽度,调整窗口宽度
if (this.Width > maxWidth)
{
this.Width = maxWidth;
needsAdjustment = true;
LogHelper.WriteLogToFile($"AutoUpdate | Adjusted window width to: {this.Width}");
}
// 如果屏幕分辨率较低,调整更多UI元素
if (screenHeight < 768 || screenWidth < 1024 || needsAdjustment)
{
// 查找相关控件并调整大小
var markdownViewer = this.FindName("markdownContent") as MdXaml.MarkdownScrollViewer;
var updateNowButton = this.FindName("UpdateNowButton") as Button;
var updateLaterButton = this.FindName("UpdateLaterButton") as Button;
var skipVersionButton = this.FindName("SkipVersionButton") as Button;
// 查找包含ScrollViewer的边框控件,减小其高度
var contentBorders = this.FindVisualChildren<Border>().ToList();
foreach (var border in contentBorders)
{
if (border.Child is ScrollViewer || border.Child is iNKORE.UI.WPF.Modern.Controls.ScrollViewerEx)
{
// 减小内容显示区域的高度
if (border.Height > 180)
{
border.Height = 160;
LogHelper.WriteLogToFile("AutoUpdate | Reduced content area height");
}
else if (border.Child is iNKORE.UI.WPF.Modern.Controls.ScrollViewerEx scrollViewer && scrollViewer.Height > 160)
{
scrollViewer.Height = 160;
LogHelper.WriteLogToFile("AutoUpdate | Reduced scroll viewer height");
}
}
}
// 调整按钮大小
if (updateNowButton != null && updateLaterButton != null && skipVersionButton != null)
{
updateNowButton.Height = 42;
updateLaterButton.Height = 42;
skipVersionButton.Height = 42;
updateNowButton.Padding = new Thickness(15, 8, 15, 8);
updateLaterButton.Padding = new Thickness(15, 8, 15, 8);
skipVersionButton.Padding = new Thickness(15, 8, 15, 8);
LogHelper.WriteLogToFile("AutoUpdate | Reduced button sizes for small screen");
}
}
// 确保窗口在屏幕范围内
if (this.Left < 0) this.Left = 0;
if (this.Top < 0) this.Top = 0;
if (this.Left + this.Width > screenWidth) this.Left = screenWidth - this.Width;
if (this.Top + this.Height > screenHeight) this.Top = screenHeight - this.Height;
LogHelper.WriteLogToFile($"AutoUpdate | Final window size: {this.Width}x{this.Height}");
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | Error adjusting window size: {ex.Message}", LogHelper.LogType.Error);
}
}
// 递归查找指定类型的所有子控件
private IEnumerable<T> FindVisualChildren<T>(DependencyObject depObj = null) where T : DependencyObject
{
if (depObj == null)
depObj = this;
if (depObj != null)
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++)
{
DependencyObject child = VisualTreeHelper.GetChild(depObj, i);
if (child != null && child is T)
{
yield return (T)child;
}
foreach (T childOfChild in FindVisualChildren<T>(child))
{
yield return childOfChild;
}
}
}
} }
} }
} }
+8
View File
@@ -101,6 +101,14 @@
<TextBlock Text="开抽" Foreground="White" FontSize="32" Margin="-1,-1,4,0" VerticalAlignment="Center"/> <TextBlock Text="开抽" Foreground="White" FontSize="32" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</Border> </Border>
<Border x:Name="BorderBtnIslandCaller" MouseUp="BorderBtnIslandCaller_MouseUp" Background="#00B894" Height="50" Width="200" CornerRadius="25" Margin="0,16,0,0">
<ui:SimpleStackPanel Margin="3,0" Spacing="12" Orientation="Horizontal" HorizontalAlignment="Center">
<Viewbox Margin="0,10">
<ui:SymbolIcon Symbol="Globe" Foreground="White"/>
</Viewbox>
<TextBlock Text="ClassIsland点名" Foreground="White" FontSize="18" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
</ui:SimpleStackPanel>
</Border>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</Grid> </Grid>
<Border UseLayoutRounding="True" Canvas.Bottom="8" Canvas.Right="8" x:Name="BorderBtnHelp" MouseUp="BorderBtnHelp_MouseUp" Background="#FBFBFD" Grid.Column="1" Margin="10,10,60,10" Height="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" CornerRadius="20"> <Border UseLayoutRounding="True" Canvas.Bottom="8" Canvas.Right="8" x:Name="BorderBtnHelp" MouseUp="BorderBtnHelp_MouseUp" Background="#FBFBFD" Grid.Column="1" Margin="10,10,60,10" Height="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" CornerRadius="20">
+30
View File
@@ -8,6 +8,7 @@ using System.Linq;
using System.Threading; using System.Threading;
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox;
namespace Ink_Canvas { namespace Ink_Canvas {
/// <summary> /// <summary>
@@ -205,5 +206,34 @@ namespace Ink_Canvas {
private void BtnClose_MouseUp(object sender, MouseButtonEventArgs e) { private void BtnClose_MouseUp(object sender, MouseButtonEventArgs e) {
Close(); Close();
} }
// 将 isIslandCallerFirstClick 设为静态字段,实现全局记录
private static bool isIslandCallerFirstClick = true;
private void BorderBtnIslandCaller_MouseUp(object sender, MouseButtonEventArgs e)
{
if (isIslandCallerFirstClick)
{
MessageBox.Show(
"首次使用ClassIsland点名功能,请确保已安装ClassIsland和Island caller插件。\n" +
"如未安装,请前往官网下载并安装后再使用。如果安装请再次点击此按钮。",
"提示", MessageBoxButton.OK, MessageBoxImage.Information);
isIslandCallerFirstClick = false;
return;
}
try
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
{
FileName = "classisland://plugins/IslandCaller/Run",
UseShellExecute = true
});
}
catch (Exception ex)
{
MessageBox.Show("无法调用外部点名:" + ex.Message);
}
}
} }
} }
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
is_global = true is_global = true
build_property.RootNamespace = Ink_Canvas build_property.RootNamespace = Ink_Canvas
build_property.ProjectDir = C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\ build_property.ProjectDir = C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\
build_property.EnableComHosting = build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false build_property.CsWinRTUseWindowsUIXamlProjections = false
@@ -4,16 +4,16 @@
winexe winexe
C# C#
.cs .cs
C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\obj\ARM64\Debug\net472\ C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\obj\ARM64\Debug\net472\
Ink_Canvas Ink_Canvas
none none
false false
TRACE;DEBUG;NETFRAMEWORK;NET472;;NET30_OR_GREATER;NET35_OR_GREATER;NET40_OR_GREATER;NET45_OR_GREATER;NET451_OR_GREATER;NET452_OR_GREATER;NET46_OR_GREATER;NET461_OR_GREATER;NET462_OR_GREATER;NET47_OR_GREATER;NET471_OR_GREATER;NET472_OR_GREATER TRACE;DEBUG;NETFRAMEWORK;NET472;;NET30_OR_GREATER;NET35_OR_GREATER;NET40_OR_GREATER;NET45_OR_GREATER;NET451_OR_GREATER;NET452_OR_GREATER;NET46_OR_GREATER;NET461_OR_GREATER;NET462_OR_GREATER;NET47_OR_GREATER;NET471_OR_GREATER;NET472_OR_GREATER
C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\App.xaml C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\App.xaml
13173459795 13173459795
55-769182680 55-769182680
46-1246926730 461887219135
MainWindow.xaml;Resources\DrawShapeImageDictionary.xaml;Resources\IconImageDictionary.xaml;Resources\SeewoImageDictionary.xaml;Resources\Styles\Dark.xaml;Resources\Styles\Light.xaml;Windows\CountdownTimerWindow.xaml;Windows\CycleProcessBar.xaml;Windows\HasNewUpdateWindow.xaml;Windows\NamesInputWindow.xaml;Windows\OperatingGuideWindow.xaml;Windows\RandWindow.xaml;Windows\YesOrNoNotificationWindow.xaml; MainWindow.xaml;Resources\DrawShapeImageDictionary.xaml;Resources\IconImageDictionary.xaml;Resources\SeewoImageDictionary.xaml;Resources\Styles\Dark.xaml;Resources\Styles\Light.xaml;Windows\CountdownTimerWindow.xaml;Windows\CycleProcessBar.xaml;Windows\HasNewUpdateWindow.xaml;Windows\NamesInputWindow.xaml;Windows\OperatingGuideWindow.xaml;Windows\RandWindow.xaml;Windows\YesOrNoNotificationWindow.xaml;
True True
@@ -1,11 +1,11 @@
C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\obj\ARM64\Debug\net472\GeneratedInternalTypeHelper.g.cs C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\obj\ARM64\Debug\net472\GeneratedInternalTypeHelper.g.cs
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\App.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\App.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\MainWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\MainWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\CountdownTimerWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\CountdownTimerWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\CycleProcessBar.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\CycleProcessBar.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\HasNewUpdateWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\HasNewUpdateWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\NamesInputWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\NamesInputWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\OperatingGuideWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\OperatingGuideWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\RandWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\RandWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\YesOrNoNotificationWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\YesOrNoNotificationWindow.xaml;;
@@ -1,6 +1,6 @@
is_global = true is_global = true
build_property.RootNamespace = Ink_Canvas build_property.RootNamespace = Ink_Canvas
build_property.ProjectDir = C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\ build_property.ProjectDir = C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\
build_property.EnableComHosting = build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false build_property.CsWinRTUseWindowsUIXamlProjections = false
@@ -4,16 +4,16 @@
winexe winexe
C# C#
.cs .cs
C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\obj\ARM64\Release\net472\ C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\obj\ARM64\Release\net472\
Ink_Canvas Ink_Canvas
none none
false false
TRACE;RELEASE;NETFRAMEWORK;NET472;;NET30_OR_GREATER;NET35_OR_GREATER;NET40_OR_GREATER;NET45_OR_GREATER;NET451_OR_GREATER;NET452_OR_GREATER;NET46_OR_GREATER;NET461_OR_GREATER;NET462_OR_GREATER;NET47_OR_GREATER;NET471_OR_GREATER;NET472_OR_GREATER TRACE;RELEASE;NETFRAMEWORK;NET472;;NET30_OR_GREATER;NET35_OR_GREATER;NET40_OR_GREATER;NET45_OR_GREATER;NET451_OR_GREATER;NET452_OR_GREATER;NET46_OR_GREATER;NET461_OR_GREATER;NET462_OR_GREATER;NET47_OR_GREATER;NET471_OR_GREATER;NET472_OR_GREATER
C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\App.xaml C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\App.xaml
13173459795 13173459795
55-769182680 55-769182680
46-267324192 46-1428145623
MainWindow.xaml;Resources\DrawShapeImageDictionary.xaml;Resources\IconImageDictionary.xaml;Resources\SeewoImageDictionary.xaml;Resources\Styles\Dark.xaml;Resources\Styles\Light.xaml;Windows\CountdownTimerWindow.xaml;Windows\CycleProcessBar.xaml;Windows\HasNewUpdateWindow.xaml;Windows\NamesInputWindow.xaml;Windows\OperatingGuideWindow.xaml;Windows\RandWindow.xaml;Windows\YesOrNoNotificationWindow.xaml; MainWindow.xaml;Resources\DrawShapeImageDictionary.xaml;Resources\IconImageDictionary.xaml;Resources\SeewoImageDictionary.xaml;Resources\Styles\Dark.xaml;Resources\Styles\Light.xaml;Windows\CountdownTimerWindow.xaml;Windows\CycleProcessBar.xaml;Windows\HasNewUpdateWindow.xaml;Windows\NamesInputWindow.xaml;Windows\OperatingGuideWindow.xaml;Windows\RandWindow.xaml;Windows\YesOrNoNotificationWindow.xaml;
True True
@@ -1,11 +1,11 @@
C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\obj\ARM64\Release\net472\GeneratedInternalTypeHelper.g.cs C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\obj\ARM64\Release\net472\GeneratedInternalTypeHelper.g.cs
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\App.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\App.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\MainWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\MainWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\CountdownTimerWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\CountdownTimerWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\CycleProcessBar.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\CycleProcessBar.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\HasNewUpdateWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\HasNewUpdateWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\NamesInputWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\NamesInputWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\OperatingGuideWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\OperatingGuideWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\RandWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\RandWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\YesOrNoNotificationWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\YesOrNoNotificationWindow.xaml;;
@@ -1,6 +1,6 @@
is_global = true is_global = true
build_property.RootNamespace = Ink_Canvas build_property.RootNamespace = Ink_Canvas
build_property.ProjectDir = C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\ build_property.ProjectDir = C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\
build_property.EnableComHosting = build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false build_property.CsWinRTUseWindowsUIXamlProjections = false
@@ -4,16 +4,16 @@
winexe winexe
C# C#
.cs .cs
C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\obj\ARM64\x86 Debug\net472\ C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\obj\ARM64\x86 Debug\net472\
Ink_Canvas Ink_Canvas
none none
false false
TRACE;X86_DEBUG;NETFRAMEWORK;NET472;;NET30_OR_GREATER;NET35_OR_GREATER;NET40_OR_GREATER;NET45_OR_GREATER;NET451_OR_GREATER;NET452_OR_GREATER;NET46_OR_GREATER;NET461_OR_GREATER;NET462_OR_GREATER;NET47_OR_GREATER;NET471_OR_GREATER;NET472_OR_GREATER TRACE;X86_DEBUG;NETFRAMEWORK;NET472;;NET30_OR_GREATER;NET35_OR_GREATER;NET40_OR_GREATER;NET45_OR_GREATER;NET451_OR_GREATER;NET452_OR_GREATER;NET46_OR_GREATER;NET461_OR_GREATER;NET462_OR_GREATER;NET47_OR_GREATER;NET471_OR_GREATER;NET472_OR_GREATER
C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\App.xaml C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\App.xaml
13173459795 13173459795
55-769182680 55-769182680
46-479392040 46-1640213471
MainWindow.xaml;Resources\DrawShapeImageDictionary.xaml;Resources\IconImageDictionary.xaml;Resources\SeewoImageDictionary.xaml;Resources\Styles\Dark.xaml;Resources\Styles\Light.xaml;Windows\CountdownTimerWindow.xaml;Windows\CycleProcessBar.xaml;Windows\HasNewUpdateWindow.xaml;Windows\NamesInputWindow.xaml;Windows\OperatingGuideWindow.xaml;Windows\RandWindow.xaml;Windows\YesOrNoNotificationWindow.xaml; MainWindow.xaml;Resources\DrawShapeImageDictionary.xaml;Resources\IconImageDictionary.xaml;Resources\SeewoImageDictionary.xaml;Resources\Styles\Dark.xaml;Resources\Styles\Light.xaml;Windows\CountdownTimerWindow.xaml;Windows\CycleProcessBar.xaml;Windows\HasNewUpdateWindow.xaml;Windows\NamesInputWindow.xaml;Windows\OperatingGuideWindow.xaml;Windows\RandWindow.xaml;Windows\YesOrNoNotificationWindow.xaml;
True True
@@ -1,11 +1,11 @@
C:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\obj\ARM64\x86 Debug\net472\GeneratedInternalTypeHelper.g.cs C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\obj\ARM64\x86 Debug\net472\GeneratedInternalTypeHelper.g.cs
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\App.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\App.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\MainWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\MainWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\CountdownTimerWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\CountdownTimerWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\CycleProcessBar.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\CycleProcessBar.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\HasNewUpdateWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\HasNewUpdateWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\NamesInputWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\NamesInputWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\OperatingGuideWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\OperatingGuideWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\RandWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\RandWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\icc-0610.2.3\Ink Canvas\Windows\YesOrNoNotificationWindow.xaml;; FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\YesOrNoNotificationWindow.xaml;;
Binary file not shown.
+5 -5
View File
@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1E327457A4903FFFEEF5296A4E0B282BD14654E1" #pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "2F83C72861203F56E137DC704561E979347ABF79"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
@@ -65,7 +65,7 @@ namespace Ink_Canvas {
/// InitializeComponent /// InitializeComponent
/// </summary> /// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.6.0")]
public void InitializeComponent() { public void InitializeComponent() {
if (_contentLoaded) { if (_contentLoaded) {
return; return;
@@ -87,7 +87,7 @@ namespace Ink_Canvas {
} }
[System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.6.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
@@ -162,7 +162,7 @@ namespace Ink_Canvas {
} }
[System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.6.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
@@ -190,7 +190,7 @@ namespace Ink_Canvas {
/// </summary> /// </summary>
[System.STAThreadAttribute()] [System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.6.0")]
public static void Main() { public static void Main() {
Ink_Canvas.App app = new Ink_Canvas.App(); Ink_Canvas.App app = new Ink_Canvas.App();
app.InitializeComponent(); app.InitializeComponent();
+5 -5
View File
@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1E327457A4903FFFEEF5296A4E0B282BD14654E1" #pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "2F83C72861203F56E137DC704561E979347ABF79"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
@@ -65,7 +65,7 @@ namespace Ink_Canvas {
/// InitializeComponent /// InitializeComponent
/// </summary> /// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.6.0")]
public void InitializeComponent() { public void InitializeComponent() {
if (_contentLoaded) { if (_contentLoaded) {
return; return;
@@ -87,7 +87,7 @@ namespace Ink_Canvas {
} }
[System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.6.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
@@ -162,7 +162,7 @@ namespace Ink_Canvas {
} }
[System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.6.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
@@ -190,7 +190,7 @@ namespace Ink_Canvas {
/// </summary> /// </summary>
[System.STAThreadAttribute()] [System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.6.0")]
public static void Main() { public static void Main() {
Ink_Canvas.App app = new Ink_Canvas.App(); Ink_Canvas.App app = new Ink_Canvas.App();
app.InitializeComponent(); app.InitializeComponent();
@@ -1,2 +1,62 @@
 //------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.6.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
/// <summary>
/// CreateInstance
/// </summary>
protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
| (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
}
/// <summary>
/// GetPropertyValue
/// </summary>
protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// SetPropertyValue
/// </summary>
protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// CreateDelegate
/// </summary>
protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
| (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
delegateType,
handler}, null)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}
@@ -15,7 +15,7 @@ namespace XamlGeneratedNamespace {
/// GeneratedInternalTypeHelper /// GeneratedInternalTypeHelper
/// </summary> /// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.6.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper { public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
@@ -1,6 +1,6 @@
is_global = true is_global = true
build_property.RootNamespace = Ink_Canvas build_property.RootNamespace = Ink_Canvas
build_property.ProjectDir = C:\Users\Administrator\Desktop\ICC CE\ICC CE main\ICC-CE\Ink Canvas\ build_property.ProjectDir = E:\ICC CE\ICC CE main\ICC-CE\Ink Canvas\
build_property.EnableComHosting = build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false build_property.CsWinRTUseWindowsUIXamlProjections = false

Some files were not shown because too many files have changed in this diff Show More