Compare commits

..

142 Commits

Author SHA1 Message Date
CJK_mkp 7db87b7c36 Merge pull request #61 from InkCanvasForClass/beta
ICC CE 1.7.0.0 (ICC CE Beta1.7.0.0)
2025-06-29 12:01:50 +08:00
CJK_mkp 54d0aaca04 improve:改进自动更新 2025-06-29 11:56:38 +08:00
CJK_mkp 352aa886c8 Merge pull request #60 from InkCanvasForClass/main
合并分支
2025-06-29 10:18:20 +08:00
Hydrogen 8fada629f0 Update README.md 2025-06-29 09:21:08 +08:00
Hydrogen 34bb3cd0bd Merge pull request #59 from InkCanvasForClass/beta
Beta
2025-06-29 09:12:42 +08:00
Hydrogen 5555a67422 Merge pull request #58 from InkCanvasForClass/all-contributors/add-Hydro11451
docs: add Hydro11451 as a contributor for doc
2025-06-29 09:11:46 +08:00
allcontributors[bot] 3631d35946 docs: update .all-contributorsrc 2025-06-29 01:04:17 +00:00
allcontributors[bot] 460d4a5ac1 docs: update README.md 2025-06-29 01:04:16 +00:00
Hydrogen b7b5db18fd Update .all-contributorsrc 2025-06-29 09:03:45 +08:00
Hydrogen 58d877af6b Update README.md 2025-06-29 09:02:19 +08:00
Hydrogen ab20e0d8f2 Update .all-contributorsrc 2025-06-29 09:02:00 +08:00
Hydrogen 42e55c51b0 Update .all-contributorsrc 2025-06-29 08:57:00 +08:00
Hydrogen ca82c24c76 Merge pull request #57 from InkCanvasForClass/revert-56-all-contributors/add-Hydro11451
Revert "docs: add Hydro11451 as a contributor for doc"
2025-06-29 08:56:25 +08:00
Hydrogen 66874e7a85 Revert "docs: add Hydro11451 as a contributor for doc" 2025-06-29 08:55:59 +08:00
Hydrogen e365a94f71 Update README.md 2025-06-29 08:52:42 +08:00
Hydrogen 81298e5980 Merge pull request #55 from InkCanvasForClass/beta
Beta
2025-06-29 08:51:59 +08:00
Hydrogen 4eb920553b Merge pull request #56 from InkCanvasForClass/all-contributors/add-Hydro11451
docs: add Hydro11451 as a contributor for doc
2025-06-29 08:51:44 +08:00
Hydrogen 1be5408302 Update .all-contributorsrc 2025-06-29 08:51:04 +08:00
allcontributors[bot] 1e9a7b037a docs: update .all-contributorsrc 2025-06-29 00:49:32 +00:00
allcontributors[bot] e79ed438ef docs: update README.md 2025-06-29 00:49:31 +00:00
Hydrogen ff658409be Update README.md 2025-06-29 08:43:52 +08:00
dubi906w 9c26353fed fix: gitignore and purge. 2025-06-29 01:55:52 +08:00
CJK_mkp 2a3ce9549a Create UpdateLog.txt 2025-06-28 22:09:24 +08:00
CJK_mkp 8093f55b4f Merge pull request #54 from InkCanvasForClass/main
合并分支
2025-06-28 22:03:16 +08:00
Hydrogen 4a46892486 修改ac badge样式 2025-06-28 21:57:41 +08:00
DotteringDoge471 35fafc39a8 Merge pull request #52 from InkCanvasForClass/all-contributors/add-Hydro11451
docs: add Hydro11451 as a contributor for maintenance
2025-06-28 21:11:36 +08:00
allcontributors[bot] 3976970bb5 docs: update .all-contributorsrc 2025-06-28 13:09:17 +00:00
allcontributors[bot] 1a3ab49849 docs: update README.md 2025-06-28 13:09:15 +00:00
CJK_mkp 32d75ae23d Merge pull request #51 from InkCanvasForClass/all-contributors/add-CJKmkp
docs: add CJKmkp as a contributor for maintenance
2025-06-28 21:08:17 +08:00
CJK_mkp 29c6844390 Merge pull request #50 from InkCanvasForClass/beta
Beta
2025-06-28 21:07:20 +08:00
allcontributors[bot] 9c6eee59a8 docs: update .all-contributorsrc 2025-06-28 13:06:42 +00:00
allcontributors[bot] 4ff2be67d3 docs: update README.md 2025-06-28 13:06:41 +00:00
CJK_mkp 47d3eb13ce Update AssemblyInfo.cs 2025-06-28 21:06:26 +08:00
CJK_mkp 5de3043544 Update AssemblyInfo.cs 2025-06-28 21:05:02 +08:00
CJK_mkp 4b1d544c6b Update AutomaticUpdateVersionControl.txt 2025-06-28 21:04:09 +08:00
Hydrogen 6cb8fe3a6e Update README.md 2025-06-28 21:02:13 +08:00
CJK_mkp 1acf2e044e Merge pull request #49 from InkCanvasForClass/beta
合并分支
2025-06-28 21:01:43 +08:00
Hydrogen 9e9e960fa3 修修补补x4
啊啊啊啊啊啊啊
2025-06-28 20:29:08 +08:00
Hydrogen e767873ff1 Create .all-contributorsrc 2025-06-28 20:28:01 +08:00
Hydrogen b57762afed Update README.md
shields.io需要亿点点尝逝
2025-06-28 20:24:06 +08:00
Hydrogen 24526c5a48 Update README.md 2025-06-28 20:23:07 +08:00
Hydrogen ed1b62ec50 Update README.md 2025-06-28 20:22:49 +08:00
Hydrogen 98e727cf55 修修补补x3
《梅开三度》
2025-06-28 20:20:21 +08:00
Hydrogen 6c4ed850b0 修修补补x2
《梅开二度》(这个词是这么用的吧)
2025-06-28 20:17:56 +08:00
CJK_mkp db6b9da945 Merge pull request #48 from InkCanvasForClass/beta
合并分支
2025-06-28 20:17:38 +08:00
Hydrogen 52c930624a 修修补补 2025-06-28 20:16:32 +08:00
Hydrogen b7ddcb5419 增加极为先进的allcontributors 2025-06-28 20:15:36 +08:00
CJK_mkp 34f27c8e8d Update bug_report.md 2025-06-28 20:14:13 +08:00
CJK_mkp 3f7055327b Update MainWindow.xaml 2025-06-28 20:13:20 +08:00
CJK_mkp 51fb13b448 Merge pull request #46 from InkCanvasForClass/beta
合并分支
2025-06-28 09:01:21 +08:00
CJK_mkp 5273990305 Update README.md 2025-06-28 08:59:52 +08:00
CJK_mkp a44badddaa Update README.md 2025-06-28 08:56:02 +08:00
CJK_mkp 3e8d186dc8 Update README.md 2025-06-28 08:53:20 +08:00
CJK_mkp 51f8a0541d Add files via upload 2025-06-28 08:52:34 +08:00
CJK_mkp 808da0a3a7 Merge pull request #45 from InkCanvasForClass/beta
Update README.md
2025-06-27 16:50:50 +08:00
CJK_mkp 1c522840cd Update README.md 2025-06-27 16:50:22 +08:00
CJK_mkp 6fb8506551 Merge pull request #44 from InkCanvasForClass/beta
合并分支
2025-06-27 16:48:57 +08:00
CJK_mkp 7bf0438960 Update MainWindow.xaml 2025-06-27 16:47:13 +08:00
CJK_mkp fe02ec1852 Update HasNewUpdateWindow.xaml 2025-06-27 16:46:05 +08:00
CJK_mkp 4020925af1 Merge pull request #43 from InkCanvasForClass/beta
Update README.md
2025-06-24 17:25:22 +08:00
CJK_mkp 863b42f516 Update README.md 2025-06-24 17:22:23 +08:00
CJK_mkp 7f6b03be27 Merge pull request #42 from InkCanvasForClass/beta
合并分支,修改部分内容
2025-06-24 17:18:07 +08:00
CJK_mkp 880770b718 Merge branch 'main' into beta 2025-06-24 17:17:55 +08:00
CJK_mkp ed74f98919 Update README.md 2025-06-24 17:08:46 +08:00
CJK_mkp 4a1e42d5ee Update AutoUpdateHelper.cs 2025-06-24 16:53:49 +08:00
Hydrogen b21e608eea 增加dc链接
不知怎么回事,dc的在线人数显示不出来(从aiwb inkways的dc标签修改而来)
2025-06-23 15:01:42 +08:00
Hydrogen 671ec2fba6 更新 README 文件,加入贡献指南
在自述文件中添加了一个新部分,提供贡献指南,包括提交代码到测试分支的说明。同时作为构建过程的一部分,更新了生成的文件和缓存文件。
(标题和介绍由Copilot生成并使用巨硬机翻)
2025-06-23 14:48:35 +08:00
Hydrogen 293a89575a 更新README
将新readme同步到beta

Co-Authored-By: DotteringDoge471 <185512682+DotteringDoge471@users.noreply.github.com>
2025-06-23 14:37:33 +08:00
Hydrogen 542812eb74 初步添加重启计数器
1. 防止异常重启死循环
2. 为未来可能的新功能做准备
2025-06-23 14:33:58 +08:00
DotteringDoge471 e44cb715d0 fix(docs): typo. 2025-06-23 02:46:33 +08:00
DotteringDoge471 f7a1a1c851 feat(docs): 更新了README.md。 2025-06-23 02:44:17 +08:00
CJKmkp 757c08cd02 improve:UI改进 2025-06-20 13:51:18 +08:00
CJKmkp 15fcd50151 improve:改进多指触摸操作 2025-06-20 11:23:57 +08:00
CJKmkp 867a747853 improve:改进多指触摸操作 2025-06-19 22:49:11 +08:00
CJKmkp 02dfbb54b6 fix:灵敏度阈值范围过小导致的调节无效 2025-06-19 15:12:40 +08:00
CJK_mkp c42c6c8dfe Merge pull request #37 from awesome-iwb/beta
ICC CE 1.6.7 (ICC CE Beta 1.6.14)
2025-06-19 14:38:19 +08:00
CJKmkp 316d568cbc 更新版本号 2025-06-19 14:33:01 +08:00
CJKmkp 0b72b1f1b3 fix:设置窗口关闭导致的无法点击 2025-06-19 14:32:16 +08:00
CJKmkp 25b52def92 fix:直线拉直及端点吸附 2025-06-19 14:30:24 +08:00
CJK_mkp ab67ea48f0 Merge pull request #36 from awesome-iwb/beta
ICC CE 1.6.6 (ICC CE Beta 1.6.13)
2025-06-19 12:00:20 +08:00
CJK_mkp 912c1b91e4 更新版本号 2025-06-19 11:56:36 +08:00
CJK_mkp d4f1d21634 improve:静默更新 2025-06-19 11:47:16 +08:00
CJK_mkp 6c0e7c2e64 fix:触屏类问题及设置内点击问题 2025-06-19 11:25:15 +08:00
CJK_mkp e054a50b55 Merge pull request #35 from awesome-iwb/beta
Update AutomaticUpdateVersionControl.txt
2025-06-18 23:09:27 +08:00
CJK_mkp ff005e6398 Update AutomaticUpdateVersionControl.txt 2025-06-18 23:08:47 +08:00
CJK_mkp 74cc8e7dda Merge pull request #34 from awesome-iwb/beta
修改版本号
2025-06-18 22:59:52 +08:00
CJK_mkp 254d70a787 修改版本号 2025-06-18 22:58:18 +08:00
CJK_mkp 28b728822c Merge pull request #33 from awesome-iwb/beta
ICC CE 1.6.4(ICC CE Beta1.6.8)
2025-06-18 22:44:30 +08:00
CJK_mkp 5a53471bcd improve:自动更新 2025-06-18 22:42:21 +08:00
CJK_mkp a3fee5d77c improve:自动更新 2025-06-18 22:40:48 +08:00
CJK_mkp 6f961225d7 更新版本号 2025-06-18 22:29:28 +08:00
CJK_mkp 1b0b4f7505 去除了miku 2025-06-18 22:19:34 +08:00
CJK_mkp fac66fafbd fix:墨迹压感问题 2025-06-18 18:31:03 +08:00
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
363 changed files with 5371 additions and 146120 deletions
+31
View File
@@ -0,0 +1,31 @@
{
"projectName": "community",
"projectOwner": "InkCanvasForClass",
"files": [
"README.md"
],
"commitType": "docs",
"commitConvention": "angular",
"contributorsPerLine": 7,
"contributors": [
{
"login": "CJKmkp",
"name": "CJK_mkp",
"avatar_url": "https://avatars.githubusercontent.com/u/113243675?v=4",
"profile": "https://github.com/CJKmkp",
"contributions": [
"maintenance"
]
},
{
"login": "Hydro11451",
"name": "Hydrogen",
"avatar_url": "https://avatars.githubusercontent.com/u/214308559?v=4",
"profile": "https://github.com/Hydro11451",
"contributions": [
"maintenance",
"doc"
]
}
]
}
+1
View File
@@ -6,6 +6,7 @@ labels: bug
assignees: '' assignees: ''
--- ---
## Version(or version link)
## Description ## Description
+3 -3
View File
@@ -1,3 +1,3 @@
/Ink Canvas/obj obj/
/Ink Canvas/bin bin/
/.vs .vs
Binary file not shown.
Binary file not shown.
Binary file not shown.
+256 -41
View File
@@ -1,37 +1,37 @@
{ {
"Version": 1, "Version": 1,
"WorkspaceRootPath": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\", "WorkspaceRootPath": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\",
"Documents": [ "Documents": [
{ {
"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}", "AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\dubi906w\\source\\repos\\icc-ce\\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}" "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}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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}" "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}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\Manual.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\LICENSE||{8B382828-6202-11D1-8870-0000F87579D2}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\Ink Canvas.sln.DotSettings.user||{FA3CD31E-987B-443A-9B81-186104E8DAC1}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\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\\dubi906w\\source\\repos\\icc-ce\\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.5\\ink canvas\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", "AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\dubi906w\\source\\repos\\icc-ce\\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}"
}, },
{ {
@@ -47,18 +47,210 @@
"VerticalTabListWidth": 256, "VerticalTabListWidth": 256,
"DocumentGroups": [ "DocumentGroups": [
{ {
"DockedWidth": 200, "DockedWidth": 210,
"SelectedChildIndex": 0, "SelectedChildIndex": 48,
"Children": [ "Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{387cb18d-6153-4156-9257-9ac3f9207bbe}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{e8b06f52-6d01-11d2-aa7d-00c04f990343}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{46c87f81-5a06-43a8-9e25-85d33bac49f8}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{269a02dc-6af8-11d3-bdc4-00c04f688e50}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{99b8fa2f-ab90-4f57-9c32-949f146f1914}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{c79b74ff-f1d7-4c94-aefa-4d22bfe1b1f9}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{13b12e3e-c1b4-4539-9371-4fe9a0d523fc}"
},
{
"$type": "Bookmark",
"Name": "ST:2:0:{34c7837f-3b3a-449c-bdf0-bdad86cbaf4a}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{37aba9be-445a-11d3-9949-00c04f68fd0a}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{dcc4ea97-1c0c-482b-b205-e541c0df9728}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{75188d03-9892-4ae2-abf1-207126247ce5}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{eefa5220-e298-11d0-8f78-00a0c9110057}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{4a9b7e51-aa16-11d0-a8c5-00a0c921a4d2}"
},
{
"$type": "Bookmark",
"Name": "ST:132:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:133:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:3:0:{34c7837f-3b3a-449c-bdf0-bdad86cbaf4a}"
},
{
"$type": "Bookmark",
"Name": "ST:153:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:154:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:152:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:151:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:150:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:148:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:149:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:136:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:144:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:147:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:145:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:146:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:143:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:142:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:141:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:140:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:139:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:138:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:137:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:135:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:134:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{13b12e3e-c1b4-4539-9371-4fe9a0d523fc}"
},
{
"$type": "Bookmark",
"Name": "ST:130:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{75188d03-9892-4ae2-abf1-207126247ce5}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{b1e99781-ab81-11d0-b683-00aa00a3ee26}"
},
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 0, "DocumentIndex": 0,
"Title": "MW_FloatingBarIcons.cs", "Title": "MW_FloatingBarIcons.cs",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"RelativeDocumentMoniker": "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*", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs*", "RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"ViewState": "AgIAAFgHAAAAAAAAAAAgwGcHAAAIAAAAAAAAAA==", "ViewState": "AgIAAOgCAAAAAAAAAAAuwEoGAAAIAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-05-31T10:49:24.719Z", "WhenOpened": "2025-05-31T10:49:24.719Z",
"EditorCaption": "" "EditorCaption": ""
@@ -67,22 +259,21 @@
"$type": "Document", "$type": "Document",
"DocumentIndex": 1, "DocumentIndex": 1,
"Title": "README.md", "Title": "README.md",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\README.md", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\README.md",
"RelativeDocumentMoniker": "README.md", "RelativeDocumentMoniker": "README.md",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\README.md", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\README.md",
"RelativeToolTip": "README.md", "RelativeToolTip": "README.md",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
"WhenOpened": "2025-05-31T10:48:22.883Z", "WhenOpened": "2025-05-31T10:48:22.883Z"
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 7, "DocumentIndex": 7,
"Title": "MainWindow.xaml", "Title": "MainWindow.xaml",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow.xaml", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\Ink Canvas\\MainWindow.xaml", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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"
@@ -103,9 +294,9 @@
"$type": "Document", "$type": "Document",
"DocumentIndex": 6, "DocumentIndex": 6,
"Title": "MW_PPT.cs", "Title": "MW_PPT.cs",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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|",
@@ -116,9 +307,9 @@
"DocumentIndex": 8, "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": "..\\..\\..\\..\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md",
"RelativeToolTip": "..\\icc-0610.2.3\\README.md", "RelativeToolTip": "..\\..\\..\\..\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
"WhenOpened": "2025-05-24T13:04:01.407Z" "WhenOpened": "2025-05-24T13:04:01.407Z"
@@ -127,53 +318,77 @@
"$type": "Document", "$type": "Document",
"DocumentIndex": 2, "DocumentIndex": 2,
"Title": "privacy.txt", "Title": "privacy.txt",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\privacy.txt", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\privacy.txt",
"RelativeDocumentMoniker": "privacy.txt", "RelativeDocumentMoniker": "privacy.txt",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\privacy.txt", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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|",
"WhenOpened": "2025-05-24T13:04:01.337Z", "WhenOpened": "2025-05-24T13:04:01.337Z"
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 3, "DocumentIndex": 3,
"Title": "Manual.md", "Title": "Manual.md",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Manual.md", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\Manual.md",
"RelativeDocumentMoniker": "Manual.md", "RelativeDocumentMoniker": "Manual.md",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Manual.md", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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|",
"WhenOpened": "2025-05-24T13:04:00.986Z", "WhenOpened": "2025-05-24T13:04:00.986Z"
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 4, "DocumentIndex": 4,
"Title": "LICENSE", "Title": "LICENSE",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\LICENSE",
"RelativeDocumentMoniker": "LICENSE", "RelativeDocumentMoniker": "LICENSE",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\LICENSE",
"RelativeToolTip": "LICENSE", "RelativeToolTip": "LICENSE",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2025-05-24T13:04:00.902Z", "WhenOpened": "2025-05-24T13:04:00.902Z"
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 5, "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.5\\Ink Canvas.sln.DotSettings.user", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\Ink Canvas.sln.DotSettings.user", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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": "" },
{
"$type": "Bookmark",
"Name": "ST:0:0:{d84ee353-0bef-5a41-a649-8f89aca5d84d}"
}
]
},
{
"DockedWidth": 204,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:1:0:{3ae79031-e1bc-11d0-8f78-00a0c9110057}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{590a070c-4fcd-52d9-87da-dfaa11710261}"
}
]
},
{
"DockedWidth": 190,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{f4fc5ff1-28ef-4b04-ad02-6b298310ccc7}"
} }
] ]
} }
+255 -40
View File
@@ -1,37 +1,37 @@
{ {
"Version": 1, "Version": 1,
"WorkspaceRootPath": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\", "WorkspaceRootPath": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\",
"Documents": [ "Documents": [
{ {
"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}", "AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\dubi906w\\source\\repos\\icc-ce\\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}" "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}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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}" "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}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\Manual.md||{EFC0BB08-EA7D-40C6-A696-C870411A895B}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\LICENSE||{8B382828-6202-11D1-8870-0000F87579D2}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\Ink Canvas.sln.DotSettings.user||{FA3CD31E-987B-443A-9B81-186104E8DAC1}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\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\\dubi906w\\source\\repos\\icc-ce\\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.5\\ink canvas\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", "AbsoluteMoniker": "D:0:0:{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}|Ink Canvas\\InkCanvasForClass.csproj|c:\\users\\dubi906w\\source\\repos\\icc-ce\\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}"
}, },
{ {
@@ -47,18 +47,210 @@
"VerticalTabListWidth": 256, "VerticalTabListWidth": 256,
"DocumentGroups": [ "DocumentGroups": [
{ {
"DockedWidth": 200, "DockedWidth": 210,
"SelectedChildIndex": 0, "SelectedChildIndex": 48,
"Children": [ "Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{387cb18d-6153-4156-9257-9ac3f9207bbe}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{e8b06f52-6d01-11d2-aa7d-00c04f990343}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{46c87f81-5a06-43a8-9e25-85d33bac49f8}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{269a02dc-6af8-11d3-bdc4-00c04f688e50}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{99b8fa2f-ab90-4f57-9c32-949f146f1914}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{c79b74ff-f1d7-4c94-aefa-4d22bfe1b1f9}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{13b12e3e-c1b4-4539-9371-4fe9a0d523fc}"
},
{
"$type": "Bookmark",
"Name": "ST:2:0:{34c7837f-3b3a-449c-bdf0-bdad86cbaf4a}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{37aba9be-445a-11d3-9949-00c04f68fd0a}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{dcc4ea97-1c0c-482b-b205-e541c0df9728}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{75188d03-9892-4ae2-abf1-207126247ce5}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{eefa5220-e298-11d0-8f78-00a0c9110057}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{4a9b7e51-aa16-11d0-a8c5-00a0c921a4d2}"
},
{
"$type": "Bookmark",
"Name": "ST:132:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:133:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:3:0:{34c7837f-3b3a-449c-bdf0-bdad86cbaf4a}"
},
{
"$type": "Bookmark",
"Name": "ST:153:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:154:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:152:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:151:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:150:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:148:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:149:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:136:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:144:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:147:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:145:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:146:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:143:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:142:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:141:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:140:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:139:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:138:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:137:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:135:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:134:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{13b12e3e-c1b4-4539-9371-4fe9a0d523fc}"
},
{
"$type": "Bookmark",
"Name": "ST:130:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{75188d03-9892-4ae2-abf1-207126247ce5}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{b1e99781-ab81-11d0-b683-00aa00a3ee26}"
},
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 0, "DocumentIndex": 0,
"Title": "MW_FloatingBarIcons.cs", "Title": "MW_FloatingBarIcons.cs",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"RelativeDocumentMoniker": "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", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs", "RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
"ViewState": "AgIAAFgHAAAAAAAAAAAgwGcHAAAIAAAAAAAAAA==", "ViewState": "AgIAAOgCAAAAAAAAAAAuwEoGAAAIAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-05-31T10:49:24.719Z", "WhenOpened": "2025-05-31T10:49:24.719Z",
"EditorCaption": "" "EditorCaption": ""
@@ -67,22 +259,21 @@
"$type": "Document", "$type": "Document",
"DocumentIndex": 1, "DocumentIndex": 1,
"Title": "README.md", "Title": "README.md",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\README.md", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\README.md",
"RelativeDocumentMoniker": "README.md", "RelativeDocumentMoniker": "README.md",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\README.md", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\README.md",
"RelativeToolTip": "README.md", "RelativeToolTip": "README.md",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
"WhenOpened": "2025-05-31T10:48:22.883Z", "WhenOpened": "2025-05-31T10:48:22.883Z"
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 7, "DocumentIndex": 7,
"Title": "MainWindow.xaml", "Title": "MainWindow.xaml",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow.xaml", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\Ink Canvas\\MainWindow.xaml", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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"
@@ -103,9 +294,9 @@
"$type": "Document", "$type": "Document",
"DocumentIndex": 6, "DocumentIndex": 6,
"Title": "MW_PPT.cs", "Title": "MW_PPT.cs",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\Ink Canvas\\MainWindow_cs\\MW_PPT.cs", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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|",
@@ -116,9 +307,9 @@
"DocumentIndex": 8, "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": "..\\..\\..\\..\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md", "ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md",
"RelativeToolTip": "..\\icc-0610.2.3\\README.md", "RelativeToolTip": "..\\..\\..\\..\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
"WhenOpened": "2025-05-24T13:04:01.407Z" "WhenOpened": "2025-05-24T13:04:01.407Z"
@@ -127,53 +318,77 @@
"$type": "Document", "$type": "Document",
"DocumentIndex": 2, "DocumentIndex": 2,
"Title": "privacy.txt", "Title": "privacy.txt",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\privacy.txt", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\privacy.txt",
"RelativeDocumentMoniker": "privacy.txt", "RelativeDocumentMoniker": "privacy.txt",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\privacy.txt", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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|",
"WhenOpened": "2025-05-24T13:04:01.337Z", "WhenOpened": "2025-05-24T13:04:01.337Z"
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 3, "DocumentIndex": 3,
"Title": "Manual.md", "Title": "Manual.md",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Manual.md", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\Manual.md",
"RelativeDocumentMoniker": "Manual.md", "RelativeDocumentMoniker": "Manual.md",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Manual.md", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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|",
"WhenOpened": "2025-05-24T13:04:00.986Z", "WhenOpened": "2025-05-24T13:04:00.986Z"
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 4, "DocumentIndex": 4,
"Title": "LICENSE", "Title": "LICENSE",
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\LICENSE",
"RelativeDocumentMoniker": "LICENSE", "RelativeDocumentMoniker": "LICENSE",
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\LICENSE",
"RelativeToolTip": "LICENSE", "RelativeToolTip": "LICENSE",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2025-05-24T13:04:00.902Z", "WhenOpened": "2025-05-24T13:04:00.902Z"
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 5, "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.5\\Ink Canvas.sln.DotSettings.user", "DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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.5\\Ink Canvas.sln.DotSettings.user", "ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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": "" },
{
"$type": "Bookmark",
"Name": "ST:0:0:{d84ee353-0bef-5a41-a649-8f89aca5d84d}"
}
]
},
{
"DockedWidth": 204,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:1:0:{3ae79031-e1bc-11d0-8f78-00a0c9110057}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{590a070c-4fcd-52d9-87da-dfaa11710261}"
}
]
},
{
"DockedWidth": 190,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{f4fc5ff1-28ef-4b04-ad02-6b298310ccc7}"
} }
] ]
} }
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -2,5 +2,6 @@
"ExpandedNodes": [ "ExpandedNodes": [
"" ""
], ],
"SelectedNode": "\\Ink Canvas.sln",
"PreviewInSolutionExplorer": false "PreviewInSolutionExplorer": false
} }
+1 -1
View File
@@ -1 +1 @@
1.4.7 1.7.0.0
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 568 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

File diff suppressed because one or more lines are too long
+725 -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,57 @@ 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)
{
StartupCount.Increment();
if (StartupCount.GetCount() >= 5)
{
MessageBox.Show("检测到程序已连续重启5次,已停止自动重启。请联系开发者或检查系统环境。", "重启次数过多", MessageBoxButton.OK, MessageBoxImage.Error);
StartupCount.Reset();
Environment.Exit(1);
}
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 +97,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 +237,567 @@ 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)
{
StartupCount.Increment();
if (StartupCount.GetCount() >= 5)
{
MessageBox.Show("检测到程序已连续重启5次,已停止自动重启。请联系开发者或检查系统环境。", "重启次数过多", MessageBoxButton.OK, MessageBoxImage.Error);
StartupCount.Reset();
Environment.Exit(1);
}
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);
}
// 主进程异常退出,自动重启
StartupCount.Increment();
if (StartupCount.GetCount() >= 5)
{
MessageBox.Show("检测到程序已连续重启5次,已停止自动重启。请联系开发者或检查系统环境。", "重启次数过多", MessageBoxButton.OK, MessageBoxImage.Error);
StartupCount.Reset();
Environment.Exit(1);
}
string exePath = Process.GetCurrentProcess().MainModule.FileName;
Process.Start(exePath);
}
catch { }
Environment.Exit(0);
}
}
private void App_Exit(object sender, ExitEventArgs e)
{
// 仅在软件内主动退出时关闭看门狗,并写入退出信号
try
{
if (IsAppExitByUser)
{
// 写入退出信号文件,通知看门狗正常退出
StartupCount.Reset();
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.7.0.0")]
[assembly: AssemblyFileVersion("5.0.2.0")] [assembly: AssemblyFileVersion("1.7.0.0")]
+769 -42
View File
@@ -8,40 +8,79 @@ 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
{ {
internal class AutoUpdateHelper internal class AutoUpdateHelper
{ {
public static async Task<string> CheckForUpdates(string proxy = null) // 定义超时时间为10秒
private static readonly TimeSpan RequestTimeout = TimeSpan.FromSeconds(10);
public static async Task<string> CheckForUpdates(string proxy = null, UpdateChannel channel = UpdateChannel.Release)
{ {
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://github.com/CJKmkp/ICC-CE/blob/main/AutomaticUpdateVersionControl.txt";
// 根据通道选择URL
string primaryUrl, fallbackUrl;
if (channel == UpdateChannel.Release)
{
// Release通道版本信息地址
primaryUrl = "https://github.com/InkCanvasForClass/community/raw/refs/heads/beta/AutomaticUpdateVersionControl.txt";
fallbackUrl = "https://bgithub.xyz/InkCanvasForClass/community/raw/refs/heads/main/AutomaticUpdateVersionControl.txt";
}
else
{
// Beta通道版本信息地址
primaryUrl = "https://github.com/InkCanvasForClass/community-beta/raw/refs/heads/main/AutomaticUpdateVersionControl.txt";
fallbackUrl = "https://bgithub.xyz/InkCanvasForClass/community-beta/raw/refs/heads/main/AutomaticUpdateVersionControl.txt";
}
LogHelper.WriteLogToFile($"AutoUpdate | Checking for updates on {channel} channel");
// 先尝试主地址
remoteAddress += primaryUrl;
string remoteVersion = await GetRemoteVersion(remoteAddress); string remoteVersion = await GetRemoteVersion(remoteAddress);
// 如果主地址失败,尝试备用地址
if (remoteVersion == null)
{
LogHelper.WriteLogToFile($"AutoUpdate | Primary URL failed, trying fallback URL");
remoteVersion = await GetRemoteVersion(proxy + fallbackUrl);
}
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 from both URLs.", 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 +91,72 @@ namespace Ink_Canvas.Helpers
{ {
try try
{ {
HttpResponseMessage response = await client.GetAsync(fileUrl); // 设置超时时间为10秒
client.Timeout = RequestTimeout;
LogHelper.WriteLogToFile($"AutoUpdate | Sending HTTP request to: {fileUrl}");
// 使用带超时的Task.WhenAny来确保请求不会无限期等待
var downloadTask = client.GetAsync(fileUrl);
var timeoutTask = Task.Delay(RequestTimeout);
var completedTask = await Task.WhenAny(downloadTask, timeoutTask);
if (completedTask == timeoutTask)
{
LogHelper.WriteLogToFile($"AutoUpdate | Request timed out after {RequestTimeout.TotalSeconds} seconds", LogHelper.LogType.Error);
return null;
}
// 请求完成,检查结果
HttpResponseMessage response = await downloadTask;
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,10 +166,10 @@ 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 = "", UpdateChannel channel = UpdateChannel.Release)
{ {
try try
{ {
@@ -85,49 +181,214 @@ 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}");
}
// 根据通道选择下载地址
string primaryUrl, fallbackUrl;
if (channel == UpdateChannel.Release)
{
// Release通道下载地址
primaryUrl = $"{proxy}https://github.com/InkCanvasForClass/community/releases/download/{version}/InkCanvasForClass.CE.{version}.zip";
fallbackUrl = $"{proxy}https://bgithub.xyz/InkCanvasForClass/community/releases/download/{version}/InkCanvasForClass.CE.{version}.zip";
}
else
{
// Beta通道下载地址
primaryUrl = $"{proxy}https://github.com/InkCanvasForClass/community-beta/releases/download/{version}/InkCanvasForClass.CE.{version}.zip";
fallbackUrl = $"{proxy}https://bgithub.xyz/InkCanvasForClass/community-beta/releases/download/{version}/InkCanvasForClass.CE.{version}.zip";
}
LogHelper.WriteLogToFile($"AutoUpdate | Primary download URL: {primaryUrl}");
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."); // 先尝试主地址下载
return true; bool downloadSuccess = await DownloadFile(primaryUrl, zipFilePath);
// 如果主地址下载失败,尝试备用地址
if (!downloadSuccess)
{
LogHelper.WriteLogToFile($"AutoUpdate | Primary download failed, trying fallback URL: {fallbackUrl}");
downloadSuccess = await DownloadFile(fallbackUrl, zipFilePath);
}
if (downloadSuccess)
{
SaveDownloadStatus(true);
LogHelper.WriteLogToFile("AutoUpdate | Setup file successfully downloaded.");
return true;
}
else
{
LogHelper.WriteLogToFile("AutoUpdate | Failed to download the update file from both URLs.", 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); // 下载文件需要更长的超时时间
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();
} }
// 使用带超时的Task.WhenAny来确保请求不会无限期等待
var downloadTask = client.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead);
var initialTimeoutTask = Task.Delay(RequestTimeout); // 使用全局定义的10秒超时
var completedTask = await Task.WhenAny(downloadTask, initialTimeoutTask);
if (completedTask == initialTimeoutTask)
{
LogHelper.WriteLogToFile($"AutoUpdate | Initial connection timed out after 30 seconds", LogHelper.LogType.Error);
return false;
}
// 请求完成,检查结果
HttpResponseMessage response = await downloadTask;
LogHelper.WriteLogToFile($"AutoUpdate | HTTP response status: {response.StatusCode}");
response.EnsureSuccessStatusCode();
// 获取文件总大小
long? totalBytes = response.Content.Headers.ContentLength;
LogHelper.WriteLogToFile($"AutoUpdate | File size: {(totalBytes.HasValue ? (totalBytes.Value / 1024.0 / 1024.0).ToString("F2") + " MB" : "Unknown")}");
// 创建临时文件流
using (var fileStream = new FileStream(tempFilePath, FileMode.Create, FileAccess.Write, FileShare.None))
{
// 获取下载流
using (var downloadStream = await response.Content.ReadAsStreamAsync())
{
byte[] buffer = new byte[8192]; // 8KB buffer
long totalBytesRead = 0;
int bytesRead;
DateTime lastProgressUpdate = DateTime.Now;
// 设置下载超时 - 如果60秒内没有数据传输,则认为下载超时
var downloadTimeoutTask = Task.Delay(TimeSpan.FromSeconds(60));
var readTask = Task.Run(async () => {
while ((bytesRead = await downloadStream.ReadAsync(buffer, 0, buffer.Length)) > 0)
{
await fileStream.WriteAsync(buffer, 0, bytesRead);
totalBytesRead += bytesRead;
// 每5秒更新一次进度
if ((DateTime.Now - lastProgressUpdate).TotalSeconds >= 5)
{
if (totalBytes.HasValue)
{
double percentage = (double)totalBytesRead / totalBytes.Value * 100;
LogHelper.WriteLogToFile($"AutoUpdate | Download progress: {percentage:F1}% ({(totalBytesRead / 1024.0 / 1024.0):F2} MB / {(totalBytes.Value / 1024.0 / 1024.0):F2} MB)");
}
else
{
LogHelper.WriteLogToFile($"AutoUpdate | Downloaded: {(totalBytesRead / 1024.0 / 1024.0):F2} MB");
}
lastProgressUpdate = DateTime.Now;
// 重置下载超时
downloadTimeoutTask = Task.Delay(TimeSpan.FromSeconds(60));
}
}
return true;
});
// 等待下载完成或超时
if (await Task.WhenAny(readTask, downloadTimeoutTask) == downloadTimeoutTask)
{
LogHelper.WriteLogToFile($"AutoUpdate | Download timed out after 60 seconds of inactivity", LogHelper.LogType.Error);
return false;
}
// 确保下载任务完成
bool downloadCompleted = await readTask;
if (downloadCompleted)
{
LogHelper.WriteLogToFile($"AutoUpdate | Download completed: {(totalBytesRead / 1024.0 / 1024.0):F2} MB");
}
}
}
// 如果临时文件存在,则将其移动到目标位置
if (File.Exists(tempFilePath))
{
// 如果目标文件已存在,先删除
if (File.Exists(destinationPath))
{
File.Delete(destinationPath);
}
File.Move(tempFilePath, destinationPath);
LogHelper.WriteLogToFile($"AutoUpdate | File saved to: {destinationPath}");
return true;
}
return false;
} }
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; }
catch (TaskCanceledException ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | Download timed out: {ex.Message}", LogHelper.LogType.Error);
} }
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);
}
} }
// 清理临时文件
try
{
string tempFilePath = destinationPath + ".tmp";
if (File.Exists(tempFilePath))
{
File.Delete(tempFilePath);
}
}
catch { }
return false;
} }
} }
@@ -155,17 +416,263 @@ 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}");
LogHelper.WriteLogToFile($"AutoUpdate | Silent update mode: {isInSilence}");
// 创建批处理文件来执行更新操作
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}\"");
// 根据是否为静默更新模式决定是否自动启动应用程序
if (isInSilence)
{
// 静默更新模式下,自动启动应用程序
batchContent.AppendLine($"echo echo 自动启动应用程序... >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo start \"\" \"{appPath}\" >> \"{updateBatPath}\"");
}
else
{
// 非静默模式下,检查应用程序是否已经在运行
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}\"");
// 错误退出处理
if (isInSilence)
{
// 静默模式下,不显示错误提示
batchContent.AppendLine($"echo :ERROR_EXIT >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo echo Update failed! >> \"%temp%\\icc_update_error.log\" >> \"{updateBatPath}\"");
batchContent.AppendLine($"echo exit /b 1 >> \"{updateBatPath}\"");
}
else
{
// 非静默模式下,显示错误提示
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 +680,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 +718,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 +728,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 +750,197 @@ 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);
}
}
// 新增:版本修复方法,强制下载并安装指定通道的最新版本
public static async Task<bool> FixVersion(UpdateChannel channel = UpdateChannel.Release)
{
try
{
LogHelper.WriteLogToFile($"AutoUpdate | Starting version fix for {channel} channel");
// 获取当前通道的最新版本
string latestVersion = await CheckForUpdates(null, channel);
if (string.IsNullOrEmpty(latestVersion))
{
LogHelper.WriteLogToFile("AutoUpdate | No newer version found for fixing", LogHelper.LogType.Warning);
return false;
}
// 下载最新版本
bool downloadResult = await DownloadSetupFileAndSaveStatus(latestVersion, "", channel);
if (!downloadResult)
{
LogHelper.WriteLogToFile("AutoUpdate | Failed to download update for fixing", LogHelper.LogType.Error);
return false;
}
// 执行安装,非静默模式
InstallNewVersionApp(latestVersion, false);
// 设置为用户主动退出,避免被看门狗判定为崩溃
App.IsAppExitByUser = true;
// 关闭应用程序
Application.Current.Dispatcher.Invoke(() => {
Application.Current.Shutdown();
});
return true;
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | Error in FixVersion: {ex.Message}", LogHelper.LogType.Error);
return false;
}
}
// 获取更新日志
public static async Task<string> GetUpdateLog(UpdateChannel channel = UpdateChannel.Release)
{
try
{
string primaryUrl, fallbackUrl;
if (channel == UpdateChannel.Release)
{
// Release通道更新日志地址
primaryUrl = "https://github.com/InkCanvasForClass/community/raw/refs/heads/beta/UpdateLog.txt";
fallbackUrl = "https://bgithub.xyz/InkCanvasForClass/community/raw/refs/heads/main/UpdateLog.txt";
}
else
{
// Beta通道更新日志地址
primaryUrl = "https://github.com/InkCanvasForClass/community-beta/raw/refs/heads/main/UpdateLog.txt";
fallbackUrl = "https://bgithub.xyz/InkCanvasForClass/community-beta/raw/refs/heads/main/UpdateLog.txt";
}
LogHelper.WriteLogToFile($"AutoUpdate | Getting update log from {channel} channel");
// 先尝试主地址
string updateLog = await GetRemoteContent(primaryUrl);
// 如果主地址失败,尝试备用地址
if (string.IsNullOrEmpty(updateLog))
{
LogHelper.WriteLogToFile($"AutoUpdate | Primary URL failed for update log, trying fallback URL");
updateLog = await GetRemoteContent(fallbackUrl);
}
if (!string.IsNullOrEmpty(updateLog))
{
LogHelper.WriteLogToFile($"AutoUpdate | Successfully retrieved update log");
return updateLog;
}
else
{
LogHelper.WriteLogToFile("AutoUpdate | Failed to retrieve update log from both URLs.", LogHelper.LogType.Error);
return $"# 无法获取更新日志\n\n无法从服务器获取更新日志信息,请检查网络连接后重试。";
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"AutoUpdate | Error in GetUpdateLog: {ex.Message}", LogHelper.LogType.Error);
return $"# 获取更新日志时发生错误\n\n错误信息: {ex.Message}";
}
}
// 获取远程内容的通用方法
private static async Task<string> GetRemoteContent(string fileUrl)
{
using (HttpClient client = new HttpClient())
{
try
{
// 设置超时时间为10秒
client.Timeout = RequestTimeout;
LogHelper.WriteLogToFile($"AutoUpdate | Sending HTTP request to: {fileUrl}");
// 使用带超时的Task.WhenAny来确保请求不会无限期等待
var downloadTask = client.GetAsync(fileUrl);
var timeoutTask = Task.Delay(RequestTimeout);
var completedTask = await Task.WhenAny(downloadTask, timeoutTask);
if (completedTask == timeoutTask)
{
LogHelper.WriteLogToFile($"AutoUpdate | Request timed out after {RequestTimeout.TotalSeconds} seconds", LogHelper.LogType.Error);
return null;
}
// 请求完成,检查结果
HttpResponseMessage response = await downloadTask;
LogHelper.WriteLogToFile($"AutoUpdate | HTTP response status: {response.StatusCode}");
response.EnsureSuccessStatusCode();
string content = await response.Content.ReadAsStringAsync();
return content;
}
catch (HttpRequestException ex)
{
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)
{
LogHelper.WriteLogToFile($"AutoUpdate | Error: {ex.Message}", LogHelper.LogType.Error);
}
return null;
} }
} }
} }
@@ -256,3 +982,4 @@ namespace Ink_Canvas.Helpers
} }
} }
} }
-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();
+52
View File
@@ -0,0 +1,52 @@
using System;
using System.IO;
namespace Ink_Canvas.Helpers
{
public static class StartupCount
{
private static readonly string CountFilePath = Path.Combine(App.RootPath, "startup-count");
private static readonly object fileLock = new object();
public static int GetCount()
{
try
{
if (File.Exists(CountFilePath))
{
var text = File.ReadAllText(CountFilePath).Trim();
if (int.TryParse(text, out int count))
return count;
}
}
catch { }
return 0;
}
public static void Increment()
{
lock (fileLock)
{
int count = GetCount() + 1;
try
{
File.WriteAllText(CountFilePath, count.ToString());
}
catch { }
}
}
public static void Reset()
{
lock (fileLock)
{
try
{
if (File.Exists(CountFilePath))
File.Delete(CountFilePath);
}
catch { }
}
}
}
}
+588 -63
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}" />
@@ -107,15 +170,303 @@
<Grid x:Name="Main_Grid"> <Grid x:Name="Main_Grid">
<!--// 设置界面 //--> <!--// 设置界面 //-->
<Grid Panel.ZIndex="999" x:Name="BorderSettingsMask" MouseDown="SettingsOverlayClick" IsHitTestVisible="False" <Grid Panel.ZIndex="999" x:Name="BorderSettingsMask" MouseDown="SettingsOverlayClick" IsHitTestVisible="True"
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="F0 M24,24z M0,0z M6.63415,3.34528C6.87134,3.21274,7.16167,3.21885,7.39307,3.36126L20.3931,11.3613C20.6149,11.4978 20.75,11.7396 20.75,12 20.75,12.2604 20.6149,12.5022 20.3931,12.6387L7.39307,20.6387C7.16167,20.7811 6.87134,20.7873 6.63415,20.6547 6.39696,20.5222 6.25,20.2717 6.25,20L6.25,4C6.25,3.72829,6.39696,3.47783,6.63415,3.34528z M7.75,5.34217L7.75,18.6578 18.569,12 7.75,5.34217z" />
</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="F0 M24,24z M0,0z M4.11612,6.11612C4.35054,5.8817,4.66848,5.75,5,5.75L19,5.75C19.3315,5.75 19.6495,5.8817 19.8839,6.11612 20.1183,6.35054 20.25,6.66848 20.25,7L20.25,18C20.25,18.0663 20.2237,18.1299 20.1768,18.1768 20.1299,18.2237 20.0663,18.25 20,18.25 19.5858,18.25 19.25,18.5858 19.25,19 19.25,19.4142 19.5858,19.75 20,19.75 20.4641,19.75 20.9092,19.5656 21.2374,19.2374 21.5656,18.9092 21.75,18.4641 21.75,18L21.75,7C21.75,6.27065 21.4603,5.57118 20.9445,5.05546 20.4288,4.53973 19.7293,4.25 19,4.25L5,4.25C4.27065,4.25 3.57118,4.53973 3.05546,5.05546 2.53973,5.57118 2.25,6.27065 2.25,7L2.25,17C2.25,17.7293 2.53973,18.4288 3.05546,18.9445 3.57118,19.4603 4.27065,19.75 5,19.75L8,19.75C8.41421,19.75 8.75,19.4142 8.75,19 8.75,18.5858 8.41421,18.25 8,18.25L5,18.25C4.66848,18.25 4.35054,18.1183 4.11612,17.8839 3.8817,17.6495 3.75,17.3315 3.75,17L3.75,7C3.75,6.66848,3.8817,6.35054,4.11612,6.11612z M11.8232,16.8232C11.8701,16.7763,11.9337,16.75,12,16.75L16,16.75C16.0663,16.75 16.1299,16.7763 16.1768,16.8232 16.2237,16.8701 16.25,16.9337 16.25,17L16.25,18C16.25,18.0663 16.2237,18.1299 16.1768,18.1768 16.1299,18.2237 16.0663,18.25 16,18.25L12,18.25C11.9337,18.25 11.8701,18.2237 11.8232,18.1768 11.7763,18.1299 11.75,18.0663 11.75,18L11.75,17C11.75,16.9337,11.7763,16.8701,11.8232,16.8232z M12,15.25C11.5359,15.25 11.0908,15.4344 10.7626,15.7626 10.4344,16.0908 10.25,16.5359 10.25,17L10.25,18C10.25,18.4641 10.4344,18.9092 10.7626,19.2374 11.0908,19.5656 11.5359,19.75 12,19.75L16,19.75C16.4641,19.75 16.9092,19.5656 17.2374,19.2374 17.5656,18.9092 17.75,18.4641 17.75,18L17.75,17C17.75,16.5359 17.5656,16.0908 17.2374,15.7626 16.9092,15.4344 16.4641,15.25 16,15.25L12,15.25z" />
</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="F0 M24,24z M0,0z M7.98145,10.6889L7.98145,3.97896C7.98145,3.37896 8.21145,2.80897 8.64145,2.38896 9.49145,1.53896 10.9714,1.53896 11.8214,2.38896 12.2414,2.80897 12.4814,3.37896 12.4814,3.97896L12.4814,6.87304C13.2752,6.60639 14.2109,6.77837 14.8214,7.38896 14.9934,7.56094 15.1352,7.75807 15.2427,7.97211 16.0798,7.5855 17.157,7.72439 17.8214,8.38879 17.9978,8.56516 18.1424,8.76797 18.2509,8.98835 19.0867,8.60643 20.1592,8.74658 20.8214,9.40881 21.2414,9.82881 21.4814,10.3988 21.4814,10.9988L21.4814,15.4988C21.4814,17.2788 20.7614,19.0188 19.5014,20.2688 18.2314,21.5488 16.5314,22.2488 14.7314,22.2488L14.7314,22.2288 12.7314,22.2288 12.6214,22.2288C11.6114,22.1788 10.6214,21.9088 9.73138,21.4288 8.75138,20.8988 7.91138,20.1288 7.29138,19.1988L7.09138,18.8988C6.76138,18.3988 5.68138,16.5088 3.78138,13.1288 3.49138,12.6188 3.41138,12.0188 3.57138,11.4488 3.72138,10.8788 4.08138,10.3988 4.59138,10.0988 5.09138,9.79881 5.68138,9.67881 6.26138,9.74881 6.84138,9.81881 7.38138,10.0888 7.79138,10.4988L7.98145,10.6889z M16.9814,11.0086L16.9814,11.4788C16.9814,11.8888 17.3214,12.2288 17.7314,12.2288 18.1414,12.2288 18.4814,11.8888 18.4814,11.4788L18.4814,10.9889C18.484,10.7926 18.5637,10.6065 18.7014,10.4688 18.9814,10.1888 19.4814,10.1888 19.7614,10.4688 19.9014,10.6088 19.9814,10.7988 19.9814,10.9988L19.9814,15.4988C19.9814,16.8788 19.4214,18.2288 18.4414,19.2088 17.4514,20.1988 16.1314,20.7488 14.7314,20.7488L12.9414,20.7488C12.0714,20.7488 11.2114,20.5288 10.4514,20.1188 9.69138,19.7088 9.04138,19.1088 8.56138,18.3888L8.36138,18.0888C8.06138,17.6188 6.96138,15.7088 5.10138,12.3988 5.00138,12.2288 4.98138,12.0288 5.03138,11.8388 5.08138,11.6488 5.20138,11.4888 5.37138,11.3888 5.58138,11.2588 5.83138,11.2088 6.08138,11.2388 6.32138,11.2688 6.55138,11.3888 6.73138,11.5588L8.20138,13.0288C8.49138,13.3188 8.97138,13.3188 9.26138,13.0288 9.38653,12.9037 9.45767,12.7431 9.4748,12.5778 9.47918,12.5454 9.48145,12.5124 9.48145,12.479L9.48145,3.97896C9.48145,3.77897 9.56145,3.58896 9.70145,3.44896 9.98145,3.16896 10.4814,3.16896 10.7614,3.44896 10.9014,3.58896 10.9814,3.77897 10.9814,3.97896L10.9814,8.97896 10.9814,10.979 10.9814,11.479C10.9814,11.889 11.3214,12.229 11.7314,12.229 12.1414,12.229 12.4814,11.889 12.4814,11.479L12.4814,10.979 12.4814,8.97896C12.4814,8.77897 12.5614,8.58897 12.7014,8.44897 12.9814,8.16897 13.4814,8.16897 13.7614,8.44897 13.9014,8.58897 13.9814,8.77897 13.9814,8.97896L13.9814,9.97879 13.9814,11.479C13.9814,11.889 14.3214,12.229 14.7314,12.229 15.1414,12.229 15.4814,11.889 15.4814,11.479L15.4814,9.97879C15.4814,9.77879 15.5614,9.58879 15.7014,9.44879 15.9814,9.16879 16.4814,9.16879 16.7614,9.44879 16.9014,9.58879 16.9814,9.77879 16.9814,9.97879L16.9814,10.9814 16.9814,10.9988 16.9814,11.0086z M3.27144,5.81876C3.04144,5.81876 2.81144,5.70876 2.66144,5.50876 2.42144,5.17876 2.49144,4.70876 2.82144,4.45876 3.63144,3.86876 4.50144,3.35876 5.42144,2.94876 5.80144,2.77876 6.24144,2.94876 6.41144,3.32875 6.58144,3.70876 6.41144,4.14876 6.03144,4.31876 5.21144,4.68876 4.43144,5.13875 3.71144,5.66876 3.58144,5.76876 3.42144,5.80875 3.27144,5.80875L3.27144,5.81876z M18.0113,5.17885C18.1413,5.25885,18.2713,5.29885,18.4113,5.29885L18.4113,5.28885C18.6613,5.28885 18.9113,5.16885 19.0513,4.93885 19.2713,4.58885 19.1613,4.12885 18.8113,3.90885 17.6013,3.14885 16.3013,2.57885 14.9213,2.20885 14.5113,2.09885 14.1113,2.33885 14.0013,2.73885 13.8913,3.13885 14.1313,3.54885 14.5313,3.65885 15.7613,3.98885 16.9313,4.49885 18.0113,5.17885z" />
</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="F0 M24,24z M0,0z M15.1306,4.19378C15.5647,4.01395 16.0301,3.92139 16.5,3.92139 16.9699,3.92139 17.4353,4.01395 17.8694,4.19378 18.3036,4.37361 18.698,4.6372 19.0303,4.96948 19.3626,5.30177 19.6262,5.69625 19.806,6.13041 19.9859,6.56457 20.0784,7.02989 20.0784,7.49981 20.0784,7.96974 19.9859,8.43506 19.806,8.86922 19.6262,9.30337 19.3626,9.69786 19.0303,10.0301L18.0403,11.0202 18.0303,11.0303 18.0202,11.0403 8.53033,20.5301C8.38968,20.6708,8.19891,20.7498,8,20.7498L4,20.7498C3.58579,20.7498,3.25,20.414,3.25,19.9998L3.25,15.9998C3.25,15.8009,3.32902,15.6101,3.46967,15.4695L13.9697,4.96948C14.302,4.6372,14.6964,4.37361,15.1306,4.19378z M17.9697,8.96948L17.4999,9.43925 14.5606,6.49991 15.0303,6.03014C15.2233,5.83714 15.4525,5.68405 15.7046,5.5796 15.9568,5.47515 16.2271,5.42139 16.5,5.42139 16.7729,5.42139 17.0432,5.47515 17.2954,5.5796 17.5475,5.68405 17.7767,5.83714 17.9697,6.03014 18.1627,6.22314 18.3158,6.45227 18.4202,6.70443 18.5247,6.9566 18.5784,7.22687 18.5784,7.49981 18.5784,7.77276 18.5247,8.04303 18.4202,8.29519 18.3158,8.54736 18.1627,8.77648 17.9697,8.96948z M4.75,16.3105L13.4999,7.56057 16.4392,10.4999 7.68934,19.2498 4.75,19.2498 4.75,16.3105z M21.5303,17.5303C21.8232,17.2374 21.8232,16.7626 21.5303,16.4697 21.2374,16.1768 20.7626,16.1768 20.4697,16.4697L17,19.9393 15.5303,18.4697C15.2374,18.1768 14.7626,18.1768 14.4697,18.4697 14.1768,18.7626 14.1768,19.2374 14.4697,19.5303L16.4697,21.5303C16.7626,21.8232,17.2374,21.8232,17.5303,21.5303L21.5303,17.5303z" />
</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="F0 M24,24z M0,0z M12.6955,2.31464C12.8562,2.2432,13.037,2.23053,13.2061,2.27886L20.2061,4.27886C20.5281,4.37085,20.7501,4.66514,20.7501,5L20.7501,18C20.7501,18.3,20.5713,18.5712,20.2955,18.6894L13.2955,21.6894C13.1267,21.7617,12.9372,21.7696,12.7629,21.7115L3.7629,18.7115C3.41393,18.5952 3.20083,18.243 3.25975,17.8799 3.31867,17.5168 3.63223,17.25 4.00007,17.25L12.2501,17.25 12.2501,7.10778 8.75007,8.50778 8.75007,13C8.75007,13.2841,8.58957,13.5438,8.33548,13.6708L4.33548,15.6708C4.10299,15.7871 3.82688,15.7746 3.60577,15.638 3.38466,15.5013 3.25007,15.2599 3.25007,15L3.25007,7C3.25007,6.70361,3.42462,6.43502,3.69546,6.31464L12.6955,2.31464z M13.0558,3.79595L4.75007,7.48741 4.75007,13.7865 7.25007,12.5365 7.25007,8C7.25007,7.69332,7.43678,7.41754,7.72153,7.30364L12.7215,5.30364C12.9526,5.21122 13.2145,5.23943 13.4205,5.37895 13.6266,5.51847 13.7501,5.75113 13.7501,6L13.7501,18C13.7501,18.4142,13.4143,18.75,13.0001,18.75L8.62178,18.75 12.9667,20.1983 19.2501,17.5055 19.2501,5.56573 13.0558,3.79595z" />
</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="F0 M24,24z M0,0z M7.8679,3.80724L10.5302,6.46952C10.6708,6.61018,10.7499,6.80094,10.7499,6.99985L10.7499,9.99985C10.7499,10.4141,10.4141,10.7499,9.99985,10.7499L6.99985,10.7499C6.80094,10.7499,6.61018,10.6708,6.46952,10.5302L3.80724,7.8679C3.64358,8.5543 3.61907,9.27047 3.73968,9.97343 3.92327,11.0435 4.43407,12.0303 5.20176,12.798 5.96944,13.5656 6.95625,14.0764 8.02628,14.26 9.09632,14.4436 10.197,14.291 11.1766,13.8231 11.4634,13.6861 11.8054,13.7448 12.0302,13.9695L18.0302,19.9695C18.2874,20.2267 18.6362,20.3712 18.9999,20.3712 19.3636,20.3712 19.7124,20.2267 19.9695,19.9695 20.2267,19.7124 20.3712,19.3636 20.3712,18.9999 20.3712,18.6362 20.2267,18.2874 19.9695,18.0302L13.9695,12.0302C13.7448,11.8054 13.6861,11.4634 13.8231,11.1766 14.291,10.197 14.4436,9.09632 14.26,8.02628 14.0764,6.95625 13.5656,5.96944 12.798,5.20176 12.0303,4.43407 11.0435,3.92327 9.97343,3.73968 9.27047,3.61907 8.5543,3.64358 7.8679,3.80724z M6.17663,2.82308C7.43621,2.22151 8.85132,2.02523 10.2271,2.26128 11.6028,2.49732 12.8716,3.15407 13.8586,4.1411 14.8456,5.12812 15.5024,6.39687 15.7384,7.77263 15.944,8.97097 15.8216,10.1992 15.3891,11.3284L21.0302,16.9695C21.5687,17.508 21.8712,18.2383 21.8712,18.9999 21.8712,19.7614 21.5687,20.4917 21.0302,21.0302 20.4917,21.5687 19.7614,21.8712 18.9999,21.8712 18.2383,21.8712 17.508,21.5687 16.9695,21.0302L11.3284,15.3891C10.1992,15.8216 8.97097,15.944 7.77263,15.7384 6.39687,15.5024 5.12812,14.8456 4.1411,13.8586 3.15407,12.8716 2.49732,11.6028 2.26128,10.2271 2.02523,8.85132 2.22151,7.43621 2.82308,6.17663 2.92801,5.95693 3.13306,5.80183 3.37303,5.76066 3.613,5.71948 3.85802,5.79736 4.03018,5.96952L7.31051,9.24985 9.24985,9.24985 9.24985,7.31051 5.96952,4.03018C5.79736,3.85802 5.71948,3.613 5.76066,3.37303 5.80183,3.13306 5.95693,2.92801 6.17663,2.82308z" />
</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="F0 M24,24z M0,0z M7.81828,2.27257C8.22012,2.17211,8.62732,2.41643,8.72778,2.81828L9.08572,4.25 14.9146,4.25 15.2726,2.81828C15.373,2.41643 15.7802,2.17211 16.1821,2.27257 16.5839,2.37303 16.8282,2.78023 16.7278,3.18208L16.4608,4.25 18,4.25C18.7293,4.25 19.4288,4.53973 19.9445,5.05546 20.4603,5.57118 20.75,6.27065 20.75,7L20.75,19C20.75,19.7293 20.4603,20.4288 19.9445,20.9445 19.4288,21.4603 18.7293,21.75 18,21.75L6,21.75C5.27065,21.75 4.57118,21.4603 4.05546,20.9445 3.53973,20.4288 3.25,19.7293 3.25,19L3.25,7C3.25,6.27065 3.53973,5.57118 4.05546,5.05546 4.57118,4.53973 5.27065,4.25 6,4.25L7.53955,4.25 7.27257,3.18208C7.17211,2.78023,7.41643,2.37303,7.81828,2.27257z M14.5396,5.75L14.2726,6.81828C14.1721,7.22012 14.4164,7.62732 14.8183,7.72778 15.2201,7.82825 15.6273,7.58393 15.7278,7.18208L16.0858,5.75 18,5.75C18.3315,5.75 18.6495,5.8817 18.8839,6.11612 19.1183,6.35054 19.25,6.66848 19.25,7L19.25,19C19.25,19.3315 19.1183,19.6495 18.8839,19.8839 18.6495,20.1183 18.3315,20.25 18,20.25L6,20.25C5.66848,20.25 5.35054,20.1183 5.11612,19.8839 4.8817,19.6495 4.75,19.3315 4.75,19L4.75,7C4.75,6.66848 4.8817,6.35054 5.11612,6.11612 5.35054,5.8817 5.66848,5.75 6,5.75L7.91455,5.75 8.27257,7.18208C8.37303,7.58393 8.78023,7.82825 9.18208,7.72778 9.58393,7.62732 9.82825,7.22012 9.72778,6.81828L9.46072,5.75 14.5396,5.75z M9.41625,15.3761C9.07166,15.1463 8.60598,15.2393 8.37614,15.5839 8.14629,15.9285 8.23932,16.3942 8.58391,16.624 9.6821,17.3565 10.8245,17.7501 12.0001,17.7501 13.1757,17.7501 14.3181,17.3565 15.4162,16.624 15.7608,16.3942 15.8539,15.9285 15.624,15.5839 15.3942,15.2393 14.9285,15.1463 14.5839,15.3761 13.6821,15.9776 12.8245,16.2501 12.0001,16.2501 11.1757,16.2501 10.3181,15.9776 9.41625,15.3761z M9,10.25C9.41421,10.25,9.75,10.5858,9.75,11L9.75,12C9.75,12.4142 9.41421,12.75 9,12.75 8.58579,12.75 8.25,12.4142 8.25,12L8.25,11C8.25,10.5858,8.58579,10.25,9,10.25z M15.75,11C15.75,10.5858 15.4142,10.25 15,10.25 14.5858,10.25 14.25,10.5858 14.25,11L14.25,12C14.25,12.4142 14.5858,12.75 15,12.75 15.4142,12.75 15.75,12.4142 15.75,12L15.75,11z" />
</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="F0 M24,24z M0,0z M18.5303,3.46967C18.2374,3.17678 17.7626,3.17678 17.4697,3.46967 17.1768,3.76256 17.1768,4.23744 17.4697,4.53033L19.1893,6.25 16,6.25C14.475,6.25 13.0125,6.8558 11.9341,7.93414 11.5659,8.30239 11.2527,8.71546 11,9.16052 10.7473,8.71546 10.4341,8.30239 10.0659,7.93414 8.98753,6.8558 7.52499,6.25 6,6.25L3,6.25C2.58579,6.25 2.25,6.58579 2.25,7 2.25,7.41421 2.58579,7.75 3,7.75L6,7.75C7.12717,7.75 8.20817,8.19777 9.0052,8.9948 9.80223,9.79183 10.25,10.8728 10.25,12 10.25,13.1272 9.80223,14.2082 9.0052,15.0052 8.20817,15.8022 7.12717,16.25 6,16.25L3,16.25C2.58579,16.25 2.25,16.5858 2.25,17 2.25,17.4142 2.58579,17.75 3,17.75L6,17.75C7.52499,17.75 8.98753,17.1442 10.0659,16.0659 10.4341,15.6976 10.7473,15.2845 11,14.8395 11.2527,15.2845 11.5659,15.6976 11.9341,16.0659 13.0125,17.1442 14.475,17.75 16,17.75L19.1893,17.75 17.4697,19.4697C17.1768,19.7626 17.1768,20.2374 17.4697,20.5303 17.7626,20.8232 18.2374,20.8232 18.5303,20.5303L21.5303,17.5303C21.6022,17.4584 21.6565,17.3755 21.6931,17.2871 21.7298,17.1987 21.75,17.1017 21.75,17 21.75,16.8081 21.6768,16.6161 21.5303,16.4697L18.5303,13.4697C18.2374,13.1768 17.7626,13.1768 17.4697,13.4697 17.1768,13.7626 17.1768,14.2374 17.4697,14.5303L19.1893,16.25 16,16.25C14.8728,16.25 13.7918,15.8022 12.9948,15.0052 12.1978,14.2082 11.75,13.1272 11.75,12 11.75,10.8728 12.1978,9.79183 12.9948,8.9948 13.7918,8.19777 14.8728,7.75 16,7.75L19.1893,7.75 17.4697,9.46967C17.1768,9.76256 17.1768,10.2374 17.4697,10.5303 17.7626,10.8232 18.2374,10.8232 18.5303,10.5303L21.5303,7.53033C21.6768,7.38388 21.75,7.19194 21.75,7 21.75,6.89831 21.7298,6.80134 21.6931,6.71291 21.6565,6.62445 21.6022,6.54158 21.5303,6.46967L18.5303,3.46967z" />
</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="F0 M24,24z M0,0z M9.43853,3.39157C9.63411,3.53254 9.75,3.75892 9.75,4.00001 9.75,4.59674 9.98705,5.16904 10.409,5.591 10.831,6.01295 11.4033,6.25001 12,6.25001 12.5967,6.25001 13.169,6.01295 13.591,5.591 14.0129,5.16904 14.25,4.59674 14.25,4.00001 14.25,3.75892 14.3659,3.53254 14.5615,3.39157 14.757,3.25061 15.0085,3.21226 15.2372,3.28849L21.2372,5.28849C21.5434,5.39058,21.75,5.67718,21.75,6.00001L21.75,11C21.75,11.4142,21.4142,11.75,21,11.75L18.75,11.75 18.75,19C18.75,19.4641 18.5656,19.9093 18.2374,20.2374 17.9092,20.5656 17.4641,20.75 17,20.75L7,20.75C6.53587,20.75 6.09075,20.5656 5.76256,20.2374 5.43437,19.9093 5.25,19.4641 5.25,19L5.25,11.75 3,11.75C2.58579,11.75,2.25,11.4142,2.25,11L2.25,6.00001C2.25,5.67718,2.45657,5.39058,2.76283,5.28849L8.76283,3.28849C8.99154,3.21226,9.24296,3.25061,9.43853,3.39157z M3.75,6.54058L3.75,10.25 6,10.25C6.41421,10.25,6.75,10.5858,6.75,11L6.75,19C6.75,19.0663 6.77634,19.1299 6.82322,19.1768 6.87011,19.2237 6.93369,19.25 7,19.25L17,19.25C17.0663,19.25 17.1299,19.2237 17.1768,19.1768 17.2237,19.1299 17.25,19.0663 17.25,19L17.25,11C17.25,10.5858,17.5858,10.25,18,10.25L20.25,10.25 20.25,6.54058 15.6154,4.99571C15.4444,5.61643 15.1149,6.1884 14.6517,6.65166 13.9484,7.35492 12.9946,7.75001 12,7.75001 11.0054,7.75001 10.0516,7.35492 9.34835,6.65166 8.8851,6.1884 8.55557,5.61643 8.3846,4.99571L3.75,6.54058z" />
</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="F0 M24,24z M0,0z M5.10571,5.10571C6.93419,3.27723 9.41414,2.25 12,2.25 14.5859,2.25 17.0658,3.27723 18.8943,5.10571 20.7228,6.93419 21.75,9.41414 21.75,12 21.75,13.2804 21.4978,14.5482 21.0078,15.7312 20.5178,16.9141 19.7997,17.9889 18.8943,18.8943 17.9889,19.7997 16.9141,20.5178 15.7312,21.0078 14.5482,21.4978 13.2804,21.75 12,21.75 10.7196,21.75 9.45176,21.4978 8.26884,21.0078 7.08591,20.5178 6.01108,19.7997 5.10571,18.8943 4.20034,17.9889 3.48216,16.9141 2.99217,15.7312 2.50219,14.5482 2.25,13.2804 2.25,12 2.25,9.41414 3.27723,6.93419 5.10571,5.10571z M12,3.75C9.81196,3.75 7.71354,4.61919 6.16637,6.16637 4.61919,7.71354 3.75,9.81196 3.75,12 3.75,13.0834 3.96339,14.1562 4.37799,15.1571 4.79259,16.1581 5.40029,17.0675 6.16637,17.8336 6.93245,18.5997 7.84193,19.2074 8.84286,19.622 9.8438,20.0366 10.9166,20.25 12,20.25 13.0834,20.25 14.1562,20.0366 15.1571,19.622 16.1581,19.2074 17.0675,18.5997 17.8336,17.8336 18.5997,17.0675 19.2074,16.1581 19.622,15.1571 20.0366,14.1562 20.25,13.0834 20.25,12 20.25,9.81196 19.3808,7.71354 17.8336,6.16637 16.2865,4.61919 14.188,3.75 12,3.75z M11.25,9C11.25,8.58579,11.5858,8.25,12,8.25L12.01,8.25C12.4242,8.25 12.76,8.58579 12.76,9 12.76,9.41421 12.4242,9.75 12.01,9.75L12,9.75C11.5858,9.75,11.25,9.41421,11.25,9z M11,11.25C10.5858,11.25 10.25,11.5858 10.25,12 10.25,12.4142 10.5858,12.75 11,12.75L11.25,12.75 11.25,16C11.25,16.4142,11.5858,16.75,12,16.75L13,16.75C13.4142,16.75 13.75,16.4142 13.75,16 13.75,15.5858 13.4142,15.25 13,15.25L12.75,15.25 12.75,12C12.75,11.5858,12.4142,11.25,12,11.25L11,11.25z" />
</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,22 +572,116 @@
</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"
FontSize="26" /> FontSize="26" />
</GroupBox.Header> </GroupBox.Header>
<ui:SimpleStackPanel Spacing="6"> <ui:SimpleStackPanel Spacing="6">
<ui:ToggleSwitch OnContent="" OffContent="" Visibility="Collapsed" <ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchIsAutoUpdate" Header="自动检查更新" Name="ToggleSwitchIsAutoUpdate" Header="自动检查更新"
FontFamily="Microsoft YaHei UI" FontFamily="Microsoft YaHei UI"
Toggled="ToggleSwitchIsAutoUpdate_Toggled" /> Toggled="ToggleSwitchIsAutoUpdate_Toggled" />
<ui:ToggleSwitch OnContent="" OffContent="" Visibility="Collapsed" <ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchIsAutoUpdateWithSilence" Header="静默更新" Name="ToggleSwitchIsAutoUpdateWithSilence" Header="静默更新"
FontFamily="Microsoft YaHei UI" FontFamily="Microsoft YaHei UI"
Toggled="ToggleSwitchIsAutoUpdateWithSilence_Toggled" /> Toggled="ToggleSwitchIsAutoUpdateWithSilence_Toggled" />
<TextBlock Text="# 静默更新将在软件不使用时自动安装,无需手动操作" TextWrapping="Wrap" Foreground="#a1a1aa" />
<!-- 更新通道选择 -->
<ui:SimpleStackPanel Spacing="8" Margin="0,8,0,0">
<TextBlock Text="更新通道" FontSize="15" FontWeight="Bold" Foreground="#fafafa"/>
<ui:RadioButtons x:Name="UpdateChannelSelector" Margin="0,4,0,0">
<RadioButton Content="稳定版 (Release)" GroupName="UpdateChannel"
Tag="Release" Checked="UpdateChannelSelector_Checked"/>
<RadioButton Content="测试版 (Beta)" GroupName="UpdateChannel"
Tag="Beta" Checked="UpdateChannelSelector_Checked"/>
</ui:RadioButtons>
<TextBlock Text="# 稳定版提供可靠更新,测试版提供新功能抢先体验" TextWrapping="Wrap" Foreground="#a1a1aa" />
</ui:SimpleStackPanel>
<!-- 版本修复按钮 -->
<Button x:Name="FixVersionButton" Content="版本修复" Margin="0,8,0,0"
Width="120" HorizontalAlignment="Left" Click="FixVersionButton_Click"/>
<TextBlock Text="# 版本修复会根据当前选择的通道下载最新版本并执行安装,可用于修复损坏的安装"
TextWrapping="Wrap" Foreground="#a1a1aa" />
<Border BorderBrush="Black" BorderThickness="1" CornerRadius="5" Padding="12" <Border BorderBrush="Black" BorderThickness="1" CornerRadius="5" Padding="12"
Visibility="{Binding ElementName=ToggleSwitchIsAutoUpdateWithSilence, Path=Visibility}"> Visibility="{Binding ElementName=ToggleSwitchIsAutoUpdateWithSilence, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
<ui:SimpleStackPanel Spacing="12"> <ui:SimpleStackPanel Spacing="12">
<TextBlock <TextBlock
Text="# 关闭静默更新后,已完成安装包的下载后将会弹窗询问是否进行更新,开启静默更新后将会在安装包下载完成后每隔十分钟进行如下检测:①处于静默更新时间段内 ②未处于书写模式 ③未处于画板内。若以上检测通过即会关闭软件进行自动更新。" Text="# 关闭静默更新后,已完成安装包的下载后将会弹窗询问是否进行更新,开启静默更新后将会在安装包下载完成后每隔十分钟进行如下检测:①处于静默更新时间段内 ②未处于书写模式 ③未处于画板内。若以上检测通过即会关闭软件进行自动更新。"
@@ -303,6 +748,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 +823,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 +941,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="2.0"
Value="0.20" 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-2.0,越小要求越严格,弯曲的线条越不容易被拉直;值越大越容易识别为直线。" 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">
@@ -1872,6 +2402,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">
@@ -1913,7 +2452,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 修改而成。"
@@ -2213,10 +2752,10 @@
</Grid> </Grid>
<ui:SimpleStackPanel Spacing="3" Orientation="Vertical"> <ui:SimpleStackPanel Spacing="3" Orientation="Vertical">
<TextBlock <TextBlock
Text="© 2024 Dubi906w(Kriastans) 版权所有" FontWeight="Bold" Text="© 2025 CJK_mkp 版权所有" FontWeight="Bold"
TextWrapping="Wrap" Foreground="White" /> TextWrapping="Wrap" Foreground="White" />
<TextBlock <TextBlock
Text="© 2022-2024 HarkoTek Studio 提供技术支持" Text="© 2022-2025 HarkoTek Studio 提供技术支持"
TextWrapping="Wrap" Foreground="#a1a1aa" /> TextWrapping="Wrap" Foreground="#a1a1aa" />
<TextBlock <TextBlock
Text="We love Open-Source forever!" FontWeight="Bold" Text="We love Open-Source forever!" FontWeight="Bold"
@@ -2227,55 +2766,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">
@@ -2288,7 +2813,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"
@@ -4293,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="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">
@@ -4313,7 +4838,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">
@@ -7286,4 +7811,4 @@
</Border> </Border>
</Viewbox> </Viewbox>
</Grid> </Grid>
</Window> </Window>
+514 -21
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 {
@@ -98,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
@@ -147,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;
} }
@@ -207,6 +213,12 @@ namespace Ink_Canvas {
{ {
FoldFloatingBar_MouseUp(null, null); 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) {
@@ -273,8 +285,8 @@ 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(
$"检测到窗口大小变化,已自动恢复到全屏:{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width}x{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height}(缩放比例为{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width / SystemParameters.PrimaryScreenWidth}x{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height / SystemParameters.PrimaryScreenHeight}"); $"检测到窗口大小变化,已自动恢复到全屏:{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width}x{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height}(缩放比例为{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width / SystemParameters.PrimaryScreenWidth}x{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height / SystemParameters.PrimaryScreenHeight}");
@@ -290,30 +302,511 @@ namespace Ink_Canvas {
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(null, Settings.Startup.UpdateChannel);
// 声明下载状态变量,用于整个方法
bool isDownloadSuccessful = false;
if (AvailableLatestVersion != null) { if (AvailableLatestVersion != null) {
var IsDownloadSuccessful = false; // 检测到新版本
IsDownloadSuccessful = await AutoUpdateHelper.DownloadSetupFileAndSaveStatus(AvailableLatestVersion); LogHelper.WriteLogToFile($"AutoUpdate | New version available: {AvailableLatestVersion}");
if (IsDownloadSuccessful) { // 检查是否是用户选择跳过的版本
if (!Settings.Startup.IsAutoUpdateWithSilence) { if (!string.IsNullOrEmpty(Settings.Startup.SkippedVersion) &&
if (MessageBox.Show("InkCanvasForClass 新版本安装包已下载完成,是否立即更新?", Settings.Startup.SkippedVersion == AvailableLatestVersion) {
"InkCanvasForClass New Version Available", MessageBoxButton.YesNo, LogHelper.WriteLogToFile($"AutoUpdate | Version {AvailableLatestVersion} was marked to be skipped by the user");
MessageBoxImage.Question) == return; // 跳过此版本,不执行更新操作
MessageBoxResult.Yes) AutoUpdateHelper.InstallNewVersionApp(AvailableLatestVersion, false); }
} else {
// 如果检测到的版本与跳过的版本不同,则清除跳过版本记录
// 这确保用户只能跳过当前最新版本,而不是永久跳过所有更新
if (!string.IsNullOrEmpty(Settings.Startup.SkippedVersion) &&
Settings.Startup.SkippedVersion != AvailableLatestVersion) {
LogHelper.WriteLogToFile($"AutoUpdate | Detected new version {AvailableLatestVersion} different from skipped version {Settings.Startup.SkippedVersion}, clearing skip record");
Settings.Startup.SkippedVersion = "";
SaveSettingsToFile();
}
// 获取当前版本
string currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
// 如果启用了静默更新,则自动下载更新而不显示提示
if (Settings.Startup.IsAutoUpdateWithSilence) {
LogHelper.WriteLogToFile("AutoUpdate | Silent update enabled, downloading update automatically without notification");
// 静默下载更新,传递当前选择的更新通道
isDownloadSuccessful = await AutoUpdateHelper.DownloadSetupFileAndSaveStatus(AvailableLatestVersion, "", Settings.Startup.UpdateChannel);
if (isDownloadSuccessful) {
LogHelper.WriteLogToFile("AutoUpdate | Update downloaded successfully, will install when conditions are met");
// 启动检查定时器,定期检查是否可以安装
timerCheckAutoUpdateWithSilence.Start(); timerCheckAutoUpdateWithSilence.Start();
} else {
LogHelper.WriteLogToFile("AutoUpdate | Silent update download failed", LogHelper.LogType.Error);
} }
return;
}
// 如果没有启用静默更新,则显示常规更新窗口
string releaseDate = DateTime.Now.ToString("yyyy年MM月dd日");
// 从服务器获取更新日志
string releaseNotes = await AutoUpdateHelper.GetUpdateLog(Settings.Startup.UpdateChannel);
// 如果获取失败,使用默认文本
if (string.IsNullOrEmpty(releaseNotes))
{
releaseNotes = $@"# InkCanvasForClass v{AvailableLatestVersion}更新
无法获取更新日志,但新版本已准备就绪。";
}
// 创建并显示更新窗口
HasNewUpdateWindow updateWindow = new HasNewUpdateWindow(currentVersion, AvailableLatestVersion, releaseDate, releaseNotes);
bool? dialogResult = updateWindow.ShowDialog();
// 如果窗口被关闭但没有点击按钮,则不执行任何操作
if (dialogResult != true) {
LogHelper.WriteLogToFile("AutoUpdate | Update dialog closed without selection");
return;
}
// 不再从更新窗口获取自动更新设置
// 根据用户选择处理更新
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, "", Settings.Startup.UpdateChannel);
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, "", Settings.Startup.UpdateChannel);
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}");
// 记录要跳过的版本号
Settings.Startup.SkippedVersion = AvailableLatestVersion;
// 保存设置到文件
SaveSettingsToFile();
// 通知用户
MessageBox.Show($"已设置跳过版本 {AvailableLatestVersion},在下次发布新版本之前不会再提示更新。",
"已跳过此版本",
MessageBoxButton.OK,
MessageBoxImage.Information);
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();
// 强制应用光标设置
canvas.ForceCursor = true;
// 确保手写笔模式下也能显示光标
if (Tablet.TabletDevices.Count > 0) {
foreach (TabletDevice device in Tablet.TabletDevices) {
if (device.Type == TabletDeviceType.Stylus) {
// 手写笔设备存在,强制显示光标
System.Windows.Forms.Cursor.Show();
break;
}
}
}
} 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;
BorderSettingsMask.Background = null; // 确保清除蒙层背景
}
// 新增:折叠侧边栏
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;
BorderSettingsMask.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(1, 0, 0, 0));
// 获取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
} }
} }
+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;
+4 -36
View File
@@ -36,42 +36,10 @@ namespace Ink_Canvas {
} else { } else {
forceEraser = true; forceEraser = true;
forcePointEraser = true; forcePointEraser = true;
double k = 1;
if (Settings.Canvas.EraserShapeType == 0) { // 使用统一的方法应用橡皮擦形状,确保一致性
switch (BoardComboBoxEraserSize.SelectedIndex) ApplyCurrentEraserShape();
{
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(k * 90, k * 90);
} else if (Settings.Canvas.EraserShapeType == 1) {
switch (BoardComboBoxEraserSize.SelectedIndex)
{
case 0:
k = 0.7;
break;
case 1:
k = 0.9;
break;
case 3:
k = 1.2;
break;
case 4:
k = 1.6;
break;
}
inkCanvas.EraserShape = new RectangleStylusShape(k * 90 * 0.6, k * 90);
}
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint; inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
drawingShapeMode = 0; drawingShapeMode = 0;
+112 -57
View File
@@ -282,6 +282,7 @@ namespace Ink_Canvas {
AnimationsHelper.HideWithSlideAndFade(BoardBorderRightPageListView); AnimationsHelper.HideWithSlideAndFade(BoardBorderRightPageListView);
if (BorderSettings.Visibility == Visibility.Visible) { if (BorderSettings.Visibility == Visibility.Visible) {
// 设置蒙版为不可点击,并移除背景
BorderSettingsMask.IsHitTestVisible = false; BorderSettingsMask.IsHitTestVisible = false;
BorderSettingsMask.Background = null; BorderSettingsMask.Background = null;
var sb = new Storyboard(); var sb = new Storyboard();
@@ -403,6 +404,11 @@ namespace Ink_Canvas {
System.Windows.Controls.Canvas.SetLeft(FloatingbarSelectionBG, 28 * 5); System.Windows.Controls.Canvas.SetLeft(FloatingbarSelectionBG, 28 * 5);
break; break;
} }
case "shape": {
// 对图形模式进行特殊处理,不修改按钮UI状态
// 只隐藏相关面板,但保持图形绘制模式
break;
}
} }
@@ -740,9 +746,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);
@@ -808,14 +816,16 @@ 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) {
@@ -1074,15 +1084,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) {
@@ -1137,12 +1170,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;
@@ -1180,8 +1223,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;
@@ -1385,44 +1428,9 @@ namespace Ink_Canvas {
forceEraser = true; forceEraser = true;
forcePointEraser = true; forcePointEraser = true;
if (Settings.Canvas.EraserShapeType == 0) {
double k = 1; // 即使手掌触发过面积擦,也强制应用当前的EraserShapeType设置
switch (Settings.Canvas.EraserSize) { ApplyCurrentEraserShape();
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(k * 90, k * 90);
}
else if (Settings.Canvas.EraserShapeType == 1) {
double k = 1;
switch (Settings.Canvas.EraserSize) {
case 0:
k = 0.7;
break;
case 1:
k = 0.9;
break;
case 3:
k = 1.2;
break;
case 4:
k = 1.6;
break;
}
inkCanvas.EraserShape = new RectangleStylusShape(k * 90 * 0.6, k * 90);
}
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint) { if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint) {
if (EraserSizePanel.Visibility == Visibility.Collapsed) { if (EraserSizePanel.Visibility == Visibility.Collapsed) {
@@ -1461,6 +1469,33 @@ namespace Ink_Canvas {
inkCanvas_EditingModeChanged(inkCanvas, null); inkCanvas_EditingModeChanged(inkCanvas, null);
CancelSingleFingerDragMode(); CancelSingleFingerDragMode();
} }
// 新增方法,根据当前设置应用橡皮擦形状
public void ApplyCurrentEraserShape() {
double k = 1;
switch (Settings.Canvas.EraserSize) {
case 0:
k = Settings.Canvas.EraserShapeType == 0 ? 0.5 : 0.7;
break;
case 1:
k = Settings.Canvas.EraserShapeType == 0 ? 0.8 : 0.9;
break;
case 3:
k = Settings.Canvas.EraserShapeType == 0 ? 1.25 : 1.2;
break;
case 4:
k = Settings.Canvas.EraserShapeType == 0 ? 1.8 : 1.6;
break;
}
if (Settings.Canvas.EraserShapeType == 0) {
// 圆形擦
inkCanvas.EraserShape = new EllipseStylusShape(k * 90, k * 90);
} else if (Settings.Canvas.EraserShapeType == 1) {
// 矩形黑板擦
inkCanvas.EraserShape = new RectangleStylusShape(k * 90 * 0.6, k * 90);
}
}
private void EraserIconByStrokes_Click(object sender, RoutedEventArgs e) { private void EraserIconByStrokes_Click(object sender, RoutedEventArgs e) {
@@ -1512,7 +1547,8 @@ namespace Ink_Canvas {
private void DrawShapePromptToPen() { private void DrawShapePromptToPen() {
if (isLongPressSelected == true) { if (isLongPressSelected == true) {
HideSubPanels("pen"); // 如果是长按选中的状态,只隐藏面板,不切换到笔模式
HideSubPanels("shape");
} }
else { else {
if (StackPanelCanvasControls.Visibility == Visibility.Visible) if (StackPanelCanvasControls.Visibility == Visibility.Visible)
@@ -1577,20 +1613,38 @@ 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();
} }
private void SettingsOverlayClick(object sender, MouseButtonEventArgs e) { private void SettingsOverlayClick(object sender, MouseButtonEventArgs e) {
if (isOpeningOrHidingSettingsPane == true) return; if (isOpeningOrHidingSettingsPane == true) return;
BtnSettings_Click(null, null);
// 获取点击的位置
Point clickPoint = e.GetPosition(BorderSettingsMask);
// 获取BorderSettings的位置和大小
Point settingsPosition = BorderSettings.TranslatePoint(new Point(0, 0), BorderSettingsMask);
Rect settingsRect = new Rect(
settingsPosition.X,
settingsPosition.Y,
BorderSettings.ActualWidth,
BorderSettings.ActualHeight
);
// 如果点击位置不在设置界面内部,才关闭设置界面
if (!settingsRect.Contains(clickPoint)) {
BtnSettings_Click(null, null);
}
} }
private bool isOpeningOrHidingSettingsPane = false; private bool isOpeningOrHidingSettingsPane = false;
@@ -1600,6 +1654,7 @@ namespace Ink_Canvas {
HideSubPanels(); HideSubPanels();
} }
else { else {
// 设置蒙版为可点击,并添加半透明背景
BorderSettingsMask.IsHitTestVisible = true; BorderSettingsMask.IsHitTestVisible = true;
BorderSettingsMask.Background = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0)); BorderSettingsMask.Background = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
SettingsPanelScrollViewer.ScrollToTop(); SettingsPanelScrollViewer.ScrollToTop();
+408 -405
View File
@@ -15,6 +15,7 @@ using System.Windows.Ink;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Threading; using System.Windows.Threading;
using Microsoft.Win32;
using Application = System.Windows.Application; using Application = System.Windows.Application;
using File = System.IO.File; using File = System.IO.File;
using MessageBox = System.Windows.MessageBox; using MessageBox = System.Windows.MessageBox;
@@ -29,19 +30,26 @@ namespace Ink_Canvas {
private void BtnCheckPPT_Click(object sender, RoutedEventArgs e) { private void BtnCheckPPT_Click(object sender, RoutedEventArgs e) {
try { try {
pptApplication = null;
// 优先检测WPSwpp.Application),获取不到再尝试PowerPoint
try {
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Marshal.GetActiveObject("wpp.Application");
} catch { }
if (pptApplication == null) {
try {
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Marshal.GetActiveObject("PowerPoint.Application");
} catch { }
}
if (pptApplication != null) { if (pptApplication != null) {
//获得演示文稿对象 //获得演示文稿对象
presentation = pptApplication.ActivePresentation; try {
presentation = pptApplication.ActivePresentation;
}
catch (COMException) {
// ActivePresentation 可能因只读等原因抛异常,遍历 Presentations
presentation = null;
foreach (Presentation pres in pptApplication.Presentations) {
try {
if (pres.ReadOnly == MsoTriState.msoFalse) {
presentation = pres;
break;
}
} catch { }
}
// 如果没有可编辑的,选择第一个只读的
if (presentation == null && pptApplication.Presentations.Count > 0)
presentation = pptApplication.Presentations[1];
}
pptApplication.SlideShowBegin += PptApplication_SlideShowBegin; pptApplication.SlideShowBegin += PptApplication_SlideShowBegin;
pptApplication.SlideShowNextSlide += PptApplication_SlideShowNextSlide; pptApplication.SlideShowNextSlide += PptApplication_SlideShowNextSlide;
pptApplication.SlideShowEnd += PptApplication_SlideShowEnd; pptApplication.SlideShowEnd += PptApplication_SlideShowEnd;
@@ -79,6 +87,61 @@ namespace Ink_Canvas {
Settings.PowerPointSettings.IsSupportWPS = ToggleSwitchSupportWPS.IsOn; Settings.PowerPointSettings.IsSupportWPS = ToggleSwitchSupportWPS.IsOn;
SaveSettingsToFile(); SaveSettingsToFile();
// 重置PowerPoint/WPS实例状态
ResetPresentationObjects();
isPowerPointInitialized = false;
}
/// <summary>
/// 重置所有演示相关的COM对象
/// </summary>
private void ResetPresentationObjects()
{
try
{
// 清理对象引用
if (pptApplication != null)
{
try
{
// 尝试解除事件绑定
pptApplication.PresentationOpen -= PptApplication_PresentationOpen;
pptApplication.PresentationClose -= PptApplication_PresentationClose;
pptApplication.SlideShowBegin -= PptApplication_SlideShowBegin;
pptApplication.SlideShowNextSlide -= PptApplication_SlideShowNextSlide;
pptApplication.SlideShowEnd -= PptApplication_SlideShowEnd;
}
catch { }
try { Marshal.ReleaseComObject(pptApplication); } catch { }
pptApplication = null;
}
if (presentation != null)
{
try { Marshal.ReleaseComObject(presentation); } catch { }
presentation = null;
}
if (slides != null)
{
try { Marshal.ReleaseComObject(slides); } catch { }
slides = null;
}
slide = null;
// 强制GC回收
GC.Collect();
GC.WaitForPendingFinalizers();
LogHelper.WriteLogToFile("成功重置所有演示对象", LogHelper.LogType.Info);
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"重置演示对象时出错: {ex.Message}", LogHelper.LogType.Error);
}
} }
private static bool isWPSSupportOn => Settings.PowerPointSettings.IsSupportWPS; private static bool isWPSSupportOn => Settings.PowerPointSettings.IsSupportWPS;
@@ -86,8 +149,34 @@ namespace Ink_Canvas {
public static bool IsShowingRestoreHiddenSlidesWindow = false; public static bool IsShowingRestoreHiddenSlidesWindow = false;
private static bool IsShowingAutoplaySlidesWindow = false; private static bool IsShowingAutoplaySlidesWindow = false;
private bool isPowerPointInitialized = false; private bool isPowerPointInitialized = false;
private bool isWPSMode = false;
/// <summary>
/// 获取所有可能的WPS进程名
/// </summary>
private string[] GetPossibleWPSProcessNames()
{
return new[] { "wpp", "wppmain", "wps", "et" };
}
/// <summary>
/// 检查WPS进程是否正在运行
/// </summary>
/// <param name="writeLog">是否记录日志,默认为true</param>
private bool IsWPSRunning(bool writeLog = true)
{
foreach (var processName in GetPossibleWPSProcessNames())
{
var processes = Process.GetProcessesByName(processName);
if (processes.Length > 0)
{
if (writeLog)
LogHelper.WriteLogToFile($"检测到WPS进程: {processName}", LogHelper.LogType.Info);
return true;
}
}
return false;
}
private void TimerCheckPPT_Elapsed(object sender, ElapsedEventArgs e) private void TimerCheckPPT_Elapsed(object sender, ElapsedEventArgs e)
{ {
@@ -100,118 +189,117 @@ namespace Ink_Canvas {
// 检查是否已有初始化的 PowerPoint 实例 // 检查是否已有初始化的 PowerPoint 实例
if (!isPowerPointInitialized) if (!isPowerPointInitialized)
{ {
// 检WPS 进程(如果不支持则返回) // 检WPS和PowerPoint进程
var wpsProcesses = Process.GetProcessesByName("wpp"); bool wpsRunning = IsWPSRunning(true);
if (wpsProcesses.Length > 0 && !isWPSSupportOn) var pptProcesses = Process.GetProcessesByName("POWERPNT");
return;
// 根据设置和进程状态决定模式
isWPSMode = isWPSSupportOn && wpsRunning;
LogHelper.WriteLogToFile($"初始化模式: {(isWPSMode ? "WPS" : "PowerPoint")}", LogHelper.LogType.Info);
try // 优先获取WPS实例
{ if (isWPSMode)
if (isWPSSupportOn && wpsProcesses.Length > 0)
{
// 优先获取WPS实例
try
{
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Marshal.GetActiveObject("wpp.Application");
}
catch (COMException)
{
// WPS未启动或未注册
pptApplication = null;
}
}
if (pptApplication == null)
{
// 获取PowerPoint实例
try
{
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Marshal.GetActiveObject("PowerPoint.Application");
}
catch (COMException)
{
pptApplication = null;
}
}
}
catch (Exception)
{
pptApplication = null;
}
// 如果没有找到运行中的实例,则创建新实例
if (pptApplication == null)
{ {
try try
{ {
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance( // 尝试多种可能的ProgID
Marshal.GetTypeFromCLSID(new Guid("91493441-5A91-11CF-8700-00AA0060263B"))); string[] possibleProgIds = { "wpp.Application", "WPS.Application" };
}
catch foreach (var progId in possibleProgIds)
{
// 如果WPS支持开启,尝试创建WPS实例
if (isWPSSupportOn)
{ {
try try
{ {
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance( LogHelper.WriteLogToFile($"尝试获取COM对象: {progId}", LogHelper.LogType.Info);
Type.GetTypeFromProgID("wpp.Application")); pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Marshal.GetActiveObject(progId);
if (pptApplication != null)
{
LogHelper.WriteLogToFile($"成功连接到WPS: {progId}", LogHelper.LogType.Info);
break;
}
} }
catch catch
{ {
pptApplication = null; continue;
} }
} }
} }
catch (COMException ex)
{
LogHelper.WriteLogToFile($"获取WPS实例失败: {ex.Message}", LogHelper.LogType.Error);
pptApplication = null;
}
} }
// 如果未获取到WPS实例,尝试获取PowerPoint实例
if (pptApplication == null && pptProcesses.Length > 0)
{
try
{
LogHelper.WriteLogToFile("尝试获取PowerPoint实例", LogHelper.LogType.Info);
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Marshal.GetActiveObject("PowerPoint.Application");
if (pptApplication != null)
LogHelper.WriteLogToFile("成功连接到PowerPoint", LogHelper.LogType.Info);
}
catch (COMException ex)
{
LogHelper.WriteLogToFile($"获取PowerPoint实例失败: {ex.Message}", LogHelper.LogType.Error);
pptApplication = null;
}
}
// 如果都没有找到,且未启用WPS支持,则自动创建PowerPoint进程
if (pptApplication == null && !isWPSMode && pptProcesses.Length == 0)
{
try
{
LogHelper.WriteLogToFile("尝试创建新的PowerPoint实例", LogHelper.LogType.Info);
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance(
Marshal.GetTypeFromCLSID(new Guid("91493441-5A91-11CF-8700-00AA0060263B")));
if (pptApplication != null)
LogHelper.WriteLogToFile("成功创建PowerPoint实例", LogHelper.LogType.Info);
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"创建PowerPoint实例失败: {ex.Message}", LogHelper.LogType.Error);
pptApplication = null;
}
}
isPowerPointInitialized = true; isPowerPointInitialized = true;
return; return;
} }
// 检查进程是否还在
bool currentWpsRunning = IsWPSRunning(false); // 定期检查不输出日志
var currentPptProcesses = Process.GetProcessesByName("POWERPNT");
// 检查 PowerPoint 进程是否还在 // 检测应用程序是否关闭
var pptProcesses = Process.GetProcessesByName("POWERPNT"); bool applicationClosed = isWPSMode ? !currentWpsRunning : currentPptProcesses.Length == 0;
var wpsProcessesCheck = Process.GetProcessesByName("wpp");
bool isWpsMode = isWPSSupportOn && wpsProcessesCheck.Length > 0; if (applicationClosed)
if ((isWpsMode && wpsProcessesCheck.Length == 0) || (!isWpsMode && pptProcesses.Length == 0))
{ {
// 进程已关闭,清理对象 LogHelper.WriteLogToFile($"{(isWPSMode ? "WPS" : "PowerPoint")}进程已关闭,清理对象", LogHelper.LogType.Info);
if (pptApplication != null)
{ // 进程已关闭,调用重置方法清理对象
try { Marshal.ReleaseComObject(pptApplication); } catch { } ResetPresentationObjects();
pptApplication = null;
}
if (presentation != null)
{
try { Marshal.ReleaseComObject(presentation); } catch { }
presentation = null;
}
if (slides != null)
{
try { Marshal.ReleaseComObject(slides); } catch { }
slides = null;
}
slide = null;
isPowerPointInitialized = false; isPowerPointInitialized = false;
// 这里可以选择自动重启 PowerPoint 或 WPS 或等待用户操作
try // PowerPoint进程守护:自动重启PowerPoint进程(仅在未启用WPS支持时)
if (!isWPSSupportOn && !isWPSMode)
{ {
if (isWpsMode) try
{
// 自动重启WPS
Process.Start("wpp.exe");
Thread.Sleep(2000); // 等待WPS启动
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance(
Type.GetTypeFromProgID("wpp.Application"));
}
else
{ {
LogHelper.WriteLogToFile("尝试重启PowerPoint进程", LogHelper.LogType.Info);
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance( pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance(
Marshal.GetTypeFromCLSID(new Guid("91493441-5A91-11CF-8700-00AA0060263B"))); Marshal.GetTypeFromCLSID(new Guid("91493441-5A91-11CF-8700-00AA0060263B")));
isPowerPointInitialized = true;
LogHelper.WriteLogToFile("PowerPoint进程重启成功", LogHelper.LogType.Info);
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"PowerPoint守护重启失败: {ex.Message}", LogHelper.LogType.Error);
} }
isPowerPointInitialized = true;
}
catch (Exception ex)
{
LogHelper.WriteLogToFile("PowerPoint/WPS 守护重启失败: " + ex.ToString(), LogHelper.LogType.Error);
} }
return; return;
} }
@@ -289,7 +377,7 @@ namespace Ink_Canvas {
} }
} }
catch (Exception ex) { catch (Exception ex) {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); LogHelper.WriteLogToFile($"TimerCheckPPT_Elapsed 异常: {ex.Message}", LogHelper.LogType.Error);
Application.Current.Dispatcher.Invoke(() => { Application.Current.Dispatcher.Invoke(() => {
BtnPPTSlideShow.Visibility = Visibility.Collapsed; BtnPPTSlideShow.Visibility = Visibility.Collapsed;
timerCheckPPT.Start(); timerCheckPPT.Start();
@@ -391,8 +479,6 @@ namespace Ink_Canvas {
pptApplication.SlideShowNextSlide -= PptApplication_SlideShowNextSlide; pptApplication.SlideShowNextSlide -= PptApplication_SlideShowNextSlide;
pptApplication.SlideShowEnd -= PptApplication_SlideShowEnd; pptApplication.SlideShowEnd -= PptApplication_SlideShowEnd;
// 释放COM对象
ReleasePptResources();
timerCheckPPT.Start(); timerCheckPPT.Start();
@@ -786,7 +872,7 @@ namespace Ink_Canvas {
await Task.Delay(150); await Task.Delay(150);
Application.Current.Dispatcher.InvokeAsync(() => { await Application.Current.Dispatcher.InvokeAsync(() => {
ViewboxFloatingBarMarginAnimation(100, true); ViewboxFloatingBarMarginAnimation(100, true);
}); });
} }
@@ -842,389 +928,306 @@ namespace Ink_Canvas {
private bool _isPptClickingBtnTurned = false; private bool _isPptClickingBtnTurned = false;
private void BtnPPTSlidesUp_Click(object sender, RoutedEventArgs e) { private void BtnPPTSlidesUp_Click(object sender, RoutedEventArgs e) {
if (currentMode == 1) {
GridBackgroundCover.Visibility = Visibility.Collapsed;
AnimationsHelper.HideWithSlideAndFade(BlackboardLeftSide);
AnimationsHelper.HideWithSlideAndFade(BlackboardCenterSide);
AnimationsHelper.HideWithSlideAndFade(BlackboardRightSide);
currentMode = 0;
}
_isPptClickingBtnTurned = true;
if (inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber &&
Settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint)
SaveScreenShot(true,
pptApplication.SlideShowWindows[1].Presentation.Name + "/" +
pptApplication.SlideShowWindows[1].View.CurrentShowPosition);
try { try {
if (currentMode == 1) {
GridBackgroundCover.Visibility = Visibility.Collapsed;
AnimationsHelper.HideWithSlideAndFade(BlackboardLeftSide);
AnimationsHelper.HideWithSlideAndFade(BlackboardCenterSide);
AnimationsHelper.HideWithSlideAndFade(BlackboardRightSide);
currentMode = 0;
}
_isPptClickingBtnTurned = true;
if (inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber &&
Settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint)
SaveScreenShot(true,
pptApplication.SlideShowWindows[1].Presentation.Name + "/" +
pptApplication.SlideShowWindows[1].View.CurrentShowPosition);
new Thread(new ThreadStart(() => { new Thread(new ThreadStart(() => {
try { try {
pptApplication.SlideShowWindows[1].Activate(); pptApplication.SlideShowWindows[1].Activate();
}
catch {
// ignored
}
try {
pptApplication.SlideShowWindows[1].View.Previous(); pptApplication.SlideShowWindows[1].View.Previous();
} }
catch (Exception ex) { catch {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); // ignored
Application.Current.Dispatcher.Invoke(() => { } // Without this catch{}, app will crash when click the pre-page button in the fir page in some special env.
StackPanelPPTControls.Visibility = Visibility.Collapsed;
LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
});
}
})).Start(); })).Start();
} }
catch (Exception ex) { catch {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); StackPanelPPTControls.Visibility = Visibility.Collapsed;
LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
} }
} }
private void BtnPPTSlidesDown_Click(object sender, RoutedEventArgs e) { private void BtnPPTSlidesDown_Click(object sender, RoutedEventArgs e) {
try { if (currentMode == 1) {
if (currentMode == 1) { GridBackgroundCover.Visibility = Visibility.Collapsed;
GridBackgroundCover.Visibility = Visibility.Collapsed; AnimationsHelper.HideWithSlideAndFade(BlackboardLeftSide);
AnimationsHelper.HideWithSlideAndFade(BlackboardLeftSide); AnimationsHelper.HideWithSlideAndFade(BlackboardCenterSide);
AnimationsHelper.HideWithSlideAndFade(BlackboardCenterSide); AnimationsHelper.HideWithSlideAndFade(BlackboardRightSide);
AnimationsHelper.HideWithSlideAndFade(BlackboardRightSide); currentMode = 0;
currentMode = 0; }
}
_isPptClickingBtnTurned = true; _isPptClickingBtnTurned = true;
if (inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber && if (inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber &&
Settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint) Settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint)
SaveScreenShot(true, SaveScreenShot(true,
pptApplication.SlideShowWindows[1].Presentation.Name + "/" + pptApplication.SlideShowWindows[1].Presentation.Name + "/" +
pptApplication.SlideShowWindows[1].View.CurrentShowPosition); pptApplication.SlideShowWindows[1].View.CurrentShowPosition);
try {
new Thread(new ThreadStart(() => { new Thread(new ThreadStart(() => {
try { try {
pptApplication.SlideShowWindows[1].Activate(); pptApplication.SlideShowWindows[1].Activate();
}
catch {
// ignored
}
try {
pptApplication.SlideShowWindows[1].View.Next(); pptApplication.SlideShowWindows[1].View.Next();
} }
catch (Exception ex) { catch {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); // ignored
Application.Current.Dispatcher.Invoke(() => {
StackPanelPPTControls.Visibility = Visibility.Collapsed;
LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
});
} }
})).Start(); })).Start();
} }
catch (Exception ex) { catch {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); StackPanelPPTControls.Visibility = Visibility.Collapsed;
LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
} }
} }
private void PPTNavigationBtn_MouseDown(object sender, MouseButtonEventArgs e) private async void PPTNavigationBtn_MouseDown(object sender, MouseButtonEventArgs e)
{ {
try lastBorderMouseDownObject = sender;
if (!Settings.PowerPointSettings.EnablePPTButtonPageClickable) return;
if (sender == PPTLSPageButton)
{ {
lastBorderMouseDownObject = sender; PPTLSPageButtonFeedbackBorder.Opacity = 0.15;
if (!Settings.PowerPointSettings.EnablePPTButtonPageClickable) return;
if (sender == PPTLSPageButton)
{
PPTLSPageButtonFeedbackBorder.Opacity = 0.15;
}
else if (sender == PPTRSPageButton)
{
PPTRSPageButtonFeedbackBorder.Opacity = 0.15;
}
else if (sender == PPTLBPageButton)
{
PPTLBPageButtonFeedbackBorder.Opacity = 0.15;
}
else if (sender == PPTRBPageButton)
{
PPTRBPageButtonFeedbackBorder.Opacity = 0.15;
}
} }
catch (Exception ex) else if (sender == PPTRSPageButton)
{ {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); PPTRSPageButtonFeedbackBorder.Opacity = 0.15;
}
else if (sender == PPTLBPageButton)
{
PPTLBPageButtonFeedbackBorder.Opacity = 0.15;
}
else if (sender == PPTRBPageButton)
{
PPTRBPageButtonFeedbackBorder.Opacity = 0.15;
} }
} }
private void PPTNavigationBtn_MouseLeave(object sender, MouseEventArgs e) private async void PPTNavigationBtn_MouseLeave(object sender, MouseEventArgs e)
{ {
try lastBorderMouseDownObject = null;
if (sender == PPTLSPageButton)
{ {
lastBorderMouseDownObject = null; PPTLSPageButtonFeedbackBorder.Opacity = 0;
if (sender == PPTLSPageButton)
{
PPTLSPageButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTRSPageButton)
{
PPTRSPageButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTLBPageButton)
{
PPTLBPageButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTRBPageButton)
{
PPTRBPageButtonFeedbackBorder.Opacity = 0;
}
} }
catch (Exception ex) else if (sender == PPTRSPageButton)
{ {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); PPTRSPageButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTLBPageButton)
{
PPTLBPageButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTRBPageButton)
{
PPTRBPageButtonFeedbackBorder.Opacity = 0;
} }
} }
private async void PPTNavigationBtn_MouseUp(object sender, MouseButtonEventArgs e) { private async void PPTNavigationBtn_MouseUp(object sender, MouseButtonEventArgs e) {
try { if (lastBorderMouseDownObject != sender) return;
if (lastBorderMouseDownObject != sender) return;
if (sender == PPTLSPageButton) if (sender == PPTLSPageButton)
{ {
PPTLSPageButtonFeedbackBorder.Opacity = 0; PPTLSPageButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTRSPageButton)
{
PPTRSPageButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTLBPageButton)
{
PPTLBPageButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTRBPageButton)
{
PPTRBPageButtonFeedbackBorder.Opacity = 0;
}
if (!Settings.PowerPointSettings.EnablePPTButtonPageClickable) return;
GridTransparencyFakeBackground.Opacity = 1;
GridTransparencyFakeBackground.Background = new SolidColorBrush(StringToColor("#01FFFFFF"));
CursorIcon_Click(null, null);
try {
pptApplication.SlideShowWindows[1].SlideNavigation.Visible = true;
}
catch (Exception ex) {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error);
}
// 控制居中
if (!isFloatingBarFolded) {
await Task.Delay(100);
ViewboxFloatingBarMarginAnimation(60);
}
} }
catch (Exception ex) { else if (sender == PPTRSPageButton)
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); {
PPTRSPageButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTLBPageButton)
{
PPTLBPageButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTRBPageButton)
{
PPTRBPageButtonFeedbackBorder.Opacity = 0;
}
if (!Settings.PowerPointSettings.EnablePPTButtonPageClickable) return;
GridTransparencyFakeBackground.Opacity = 1;
GridTransparencyFakeBackground.Background = new SolidColorBrush(StringToColor("#01FFFFFF"));
CursorIcon_Click(null, null);
try {
pptApplication.SlideShowWindows[1].SlideNavigation.Visible = true;
}
catch { }
// 控制居中
if (!isFloatingBarFolded) {
await Task.Delay(100);
ViewboxFloatingBarMarginAnimation(60);
} }
} }
private void BtnPPTSlideShow_Click(object sender, RoutedEventArgs e) { private void BtnPPTSlideShow_Click(object sender, RoutedEventArgs e) {
try { new Thread(new ThreadStart(() => {
new Thread(new ThreadStart(() => { try {
try { presentation.SlideShowSettings.Run();
presentation.SlideShowSettings.Run(); }
} catch { }
catch (Exception ex) { })).Start();
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error);
}
})).Start();
}
catch (Exception ex) {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error);
}
} }
private async void BtnPPTSlideShowEnd_Click(object sender, RoutedEventArgs e) { private async void BtnPPTSlideShowEnd_Click(object sender, RoutedEventArgs e) {
try { Application.Current.Dispatcher.Invoke(() => {
Application.Current.Dispatcher.Invoke(() => { try {
try { var ms = new MemoryStream();
var ms = new MemoryStream(); inkCanvas.Strokes.Save(ms);
inkCanvas.Strokes.Save(ms); ms.Position = 0;
ms.Position = 0; memoryStreams[pptApplication.SlideShowWindows[1].View.CurrentShowPosition] = ms;
memoryStreams[pptApplication.SlideShowWindows[1].View.CurrentShowPosition] = ms; timeMachine.ClearStrokeHistory();
timeMachine.ClearStrokeHistory(); }
} catch {
catch (Exception ex) { // ignored
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); }
} });
}); new Thread(new ThreadStart(() => {
try {
new Thread(new ThreadStart(() => { pptApplication.SlideShowWindows[1].View.Exit();
try { }
pptApplication.SlideShowWindows[1].View.Exit(); catch {
} // ignored
catch (Exception ex) { }
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); })).Start();
}
})).Start();
HideSubPanels("cursor"); HideSubPanels("cursor");
await Task.Delay(150); await Task.Delay(150);
ViewboxFloatingBarMarginAnimation(100, true); ViewboxFloatingBarMarginAnimation(100, true);
}
catch (Exception ex) {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error);
}
} }
private void GridPPTControlPrevious_MouseDown(object sender, MouseButtonEventArgs e) private void GridPPTControlPrevious_MouseDown(object sender, MouseButtonEventArgs e)
{ {
try { lastBorderMouseDownObject = sender;
lastBorderMouseDownObject = sender; if (sender == PPTLSPreviousButtonBorder) {
if (sender == PPTLSPreviousButtonBorder) { PPTLSPreviousButtonFeedbackBorder.Opacity = 0.15;
PPTLSPreviousButtonFeedbackBorder.Opacity = 0.15; } else if (sender == PPTRSPreviousButtonBorder) {
} else if (sender == PPTRSPreviousButtonBorder) { PPTRSPreviousButtonFeedbackBorder.Opacity = 0.15;
PPTRSPreviousButtonFeedbackBorder.Opacity = 0.15; } else if (sender == PPTLBPreviousButtonBorder)
} else if (sender == PPTLBPreviousButtonBorder) {
{ PPTLBPreviousButtonFeedbackBorder.Opacity = 0.15;
PPTLBPreviousButtonFeedbackBorder.Opacity = 0.15;
}
else if (sender == PPTRBPreviousButtonBorder)
{
PPTRBPreviousButtonFeedbackBorder.Opacity = 0.15;
}
} }
catch (Exception ex) { else if (sender == PPTRBPreviousButtonBorder)
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); {
PPTRBPreviousButtonFeedbackBorder.Opacity = 0.15;
} }
} }
private void GridPPTControlPrevious_MouseLeave(object sender, MouseEventArgs e) private void GridPPTControlPrevious_MouseLeave(object sender, MouseEventArgs e)
{ {
try { lastBorderMouseDownObject = null;
lastBorderMouseDownObject = null; if (sender == PPTLSPreviousButtonBorder) {
if (sender == PPTLSPreviousButtonBorder) { PPTLSPreviousButtonFeedbackBorder.Opacity = 0;
PPTLSPreviousButtonFeedbackBorder.Opacity = 0; } else if (sender == PPTRSPreviousButtonBorder) {
} else if (sender == PPTRSPreviousButtonBorder) { PPTRSPreviousButtonFeedbackBorder.Opacity = 0;
PPTRSPreviousButtonFeedbackBorder.Opacity = 0; } else if (sender == PPTLBPreviousButtonBorder)
} else if (sender == PPTLBPreviousButtonBorder) {
{ PPTLBPreviousButtonFeedbackBorder.Opacity = 0;
PPTLBPreviousButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTRBPreviousButtonBorder)
{
PPTRBPreviousButtonFeedbackBorder.Opacity = 0;
}
} }
catch (Exception ex) { else if (sender == PPTRBPreviousButtonBorder)
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); {
PPTRBPreviousButtonFeedbackBorder.Opacity = 0;
} }
} }
private void GridPPTControlPrevious_MouseUp(object sender, MouseButtonEventArgs e) { private void GridPPTControlPrevious_MouseUp(object sender, MouseButtonEventArgs e) {
try { if (lastBorderMouseDownObject != sender) return;
if (lastBorderMouseDownObject != sender) return; if (sender == PPTLSPreviousButtonBorder) {
if (sender == PPTLSPreviousButtonBorder) { PPTLSPreviousButtonFeedbackBorder.Opacity = 0;
PPTLSPreviousButtonFeedbackBorder.Opacity = 0; } else if (sender == PPTRSPreviousButtonBorder) {
} else if (sender == PPTRSPreviousButtonBorder) { PPTRSPreviousButtonFeedbackBorder.Opacity = 0;
PPTRSPreviousButtonFeedbackBorder.Opacity = 0; } else if (sender == PPTLBPreviousButtonBorder)
} else if (sender == PPTLBPreviousButtonBorder) {
{ PPTLBPreviousButtonFeedbackBorder.Opacity = 0;
PPTLBPreviousButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTRBPreviousButtonBorder)
{
PPTRBPreviousButtonFeedbackBorder.Opacity = 0;
}
BtnPPTSlidesUp_Click(BtnPPTSlidesUp, null);
} }
catch (Exception ex) { else if (sender == PPTRBPreviousButtonBorder)
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); {
PPTRBPreviousButtonFeedbackBorder.Opacity = 0;
} }
BtnPPTSlidesUp_Click(BtnPPTSlidesUp, null);
} }
private void GridPPTControlNext_MouseDown(object sender, MouseButtonEventArgs e) { private void GridPPTControlNext_MouseDown(object sender, MouseButtonEventArgs e) {
try { lastBorderMouseDownObject = sender;
lastBorderMouseDownObject = sender; if (sender == PPTLSNextButtonBorder) {
if (sender == PPTLSNextButtonBorder) { PPTLSNextButtonFeedbackBorder.Opacity = 0.15;
PPTLSNextButtonFeedbackBorder.Opacity = 0.15; } else if (sender == PPTRSNextButtonBorder) {
} else if (sender == PPTRSNextButtonBorder) { PPTRSNextButtonFeedbackBorder.Opacity = 0.15;
PPTRSNextButtonFeedbackBorder.Opacity = 0.15; } else if (sender == PPTLBNextButtonBorder)
} else if (sender == PPTLBNextButtonBorder) {
{ PPTLBNextButtonFeedbackBorder.Opacity = 0.15;
PPTLBNextButtonFeedbackBorder.Opacity = 0.15;
}
else if (sender == PPTRBNextButtonBorder)
{
PPTRBNextButtonFeedbackBorder.Opacity = 0.15;
}
} }
catch (Exception ex) { else if (sender == PPTRBNextButtonBorder)
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); {
PPTRBNextButtonFeedbackBorder.Opacity = 0.15;
} }
} }
private void GridPPTControlNext_MouseLeave(object sender, MouseEventArgs e) private void GridPPTControlNext_MouseLeave(object sender, MouseEventArgs e)
{ {
try { lastBorderMouseDownObject = null;
lastBorderMouseDownObject = null; if (sender == PPTLSNextButtonBorder) {
if (sender == PPTLSNextButtonBorder) { PPTLSNextButtonFeedbackBorder.Opacity = 0;
PPTLSNextButtonFeedbackBorder.Opacity = 0; } else if (sender == PPTRSNextButtonBorder) {
} else if (sender == PPTRSNextButtonBorder) { PPTRSNextButtonFeedbackBorder.Opacity = 0;
PPTRSNextButtonFeedbackBorder.Opacity = 0; } else if (sender == PPTLBNextButtonBorder)
} else if (sender == PPTLBNextButtonBorder) {
{ PPTLBNextButtonFeedbackBorder.Opacity = 0;
PPTLBNextButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTRBNextButtonBorder)
{
PPTRBNextButtonFeedbackBorder.Opacity = 0;
}
} }
catch (Exception ex) { else if (sender == PPTRBNextButtonBorder)
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); {
PPTRBNextButtonFeedbackBorder.Opacity = 0;
} }
} }
private void GridPPTControlNext_MouseUp(object sender, MouseButtonEventArgs e) { private void GridPPTControlNext_MouseUp(object sender, MouseButtonEventArgs e) {
try { if (lastBorderMouseDownObject != sender) return;
if (lastBorderMouseDownObject != sender) return; if (sender == PPTLSNextButtonBorder) {
if (sender == PPTLSNextButtonBorder) { PPTLSNextButtonFeedbackBorder.Opacity = 0;
PPTLSNextButtonFeedbackBorder.Opacity = 0; } else if (sender == PPTRSNextButtonBorder) {
} else if (sender == PPTRSNextButtonBorder) { PPTRSNextButtonFeedbackBorder.Opacity = 0;
PPTRSNextButtonFeedbackBorder.Opacity = 0; } else if (sender == PPTLBNextButtonBorder)
} else if (sender == PPTLBNextButtonBorder) {
{ PPTLBNextButtonFeedbackBorder.Opacity = 0;
PPTLBNextButtonFeedbackBorder.Opacity = 0;
}
else if (sender == PPTRBNextButtonBorder)
{
PPTRBNextButtonFeedbackBorder.Opacity = 0;
}
BtnPPTSlidesDown_Click(BtnPPTSlidesDown, null);
} }
catch (Exception ex) { else if (sender == PPTRBNextButtonBorder)
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); {
PPTRBNextButtonFeedbackBorder.Opacity = 0;
} }
BtnPPTSlidesDown_Click(BtnPPTSlidesDown, null);
} }
private void ImagePPTControlEnd_MouseUp(object sender, MouseButtonEventArgs e) { private void ImagePPTControlEnd_MouseUp(object sender, MouseButtonEventArgs e) {
try { BtnPPTSlideShowEnd_Click(BtnPPTSlideShowEnd, null);
BtnPPTSlideShowEnd_Click(BtnPPTSlideShowEnd, null);
}
catch (Exception ex) {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error);
}
}
// 统一释放PPT相关COM对象,防止内存泄漏
private void ReleasePptResources()
{
try { if (slide != null) Marshal.ReleaseComObject(slide); } catch { }
slide = null;
try { if (slides != null) Marshal.ReleaseComObject(slides); } catch { }
slides = null;
try { if (presentation != null) Marshal.ReleaseComObject(presentation); } catch { }
presentation = null;
try { if (pptApplication != null) Marshal.ReleaseComObject(pptApplication); } catch { }
pptApplication = null;
} }
} }
} }
@@ -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;
} }
@@ -316,6 +323,11 @@ namespace Ink_Canvas {
} }
private void GridInkCanvasSelectionCover_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) { private void GridInkCanvasSelectionCover_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) {
// 手掌擦时禁止移动/缩放
if (isLastTouchEraser || inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint)
return;
// 三指及以上禁止缩放
bool disableScale = dec.Count >= 3;
try { try {
if (dec.Count >= 1) { if (dec.Count >= 1) {
var md = e.DeltaManipulation; var md = e.DeltaManipulation;
@@ -334,7 +346,8 @@ namespace Ink_Canvas {
// Update matrix to reflect translation/rotation // Update matrix to reflect translation/rotation
m.Translate(trans.X, trans.Y); // 移动 m.Translate(trans.X, trans.Y); // 移动
m.ScaleAt(scale.X, scale.Y, center.X, center.Y); // 缩放 if (!disableScale)
m.ScaleAt(scale.X, scale.Y, center.X, center.Y); // 缩放
var strokes = inkCanvas.GetSelectedStrokes(); var strokes = inkCanvas.GetSelectedStrokes();
if (StrokesSelectionClone.Count != 0) if (StrokesSelectionClone.Count != 0)
@@ -380,6 +393,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());
}
} }
} }
+215 -79
View File
@@ -21,16 +21,33 @@ namespace Ink_Canvas {
private void ToggleSwitchIsAutoUpdate_Toggled(object sender, RoutedEventArgs e) { private void ToggleSwitchIsAutoUpdate_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Startup.IsAutoUpdate = ToggleSwitchIsAutoUpdate.IsOn; Settings.Startup.IsAutoUpdate = ToggleSwitchIsAutoUpdate.IsOn;
ToggleSwitchIsAutoUpdateWithSilence.Visibility =
// 自动更新关闭时隐藏静默更新选项
ToggleSwitchIsAutoUpdateWithSilence.Visibility =
ToggleSwitchIsAutoUpdate.IsOn ? Visibility.Visible : Visibility.Collapsed; ToggleSwitchIsAutoUpdate.IsOn ? Visibility.Visible : Visibility.Collapsed;
// 如果关闭了自动更新,同时也关闭静默更新
if (!ToggleSwitchIsAutoUpdate.IsOn) {
Settings.Startup.IsAutoUpdateWithSilence = false;
ToggleSwitchIsAutoUpdateWithSilence.IsOn = false;
}
// 无论如何,静默更新时间区域的显示都要跟随静默更新设置
AutoUpdateTimePeriodBlock.Visibility =
(Settings.Startup.IsAutoUpdateWithSilence && Settings.Startup.IsAutoUpdate) ?
Visibility.Visible : Visibility.Collapsed;
SaveSettingsToFile(); SaveSettingsToFile();
} }
private void ToggleSwitchIsAutoUpdateWithSilence_Toggled(object sender, RoutedEventArgs e) { private void ToggleSwitchIsAutoUpdateWithSilence_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Startup.IsAutoUpdateWithSilence = ToggleSwitchIsAutoUpdateWithSilence.IsOn; Settings.Startup.IsAutoUpdateWithSilence = ToggleSwitchIsAutoUpdateWithSilence.IsOn;
// 静默更新的时间设置区域只在静默更新开启时显示
AutoUpdateTimePeriodBlock.Visibility = AutoUpdateTimePeriodBlock.Visibility =
Settings.Startup.IsAutoUpdateWithSilence ? Visibility.Visible : Visibility.Collapsed; Settings.Startup.IsAutoUpdateWithSilence ? Visibility.Visible : Visibility.Collapsed;
SaveSettingsToFile(); SaveSettingsToFile();
} }
@@ -694,6 +711,78 @@ 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;
// 记录旧值用于调试
double oldValue = Settings.InkToShape.LineStraightenSensitivity;
// 确保灵敏度值被正确保存到设置中
Settings.InkToShape.LineStraightenSensitivity = e.NewValue;
// 输出调试信息,观察值变化
System.Diagnostics.Debug.WriteLine($"LineStraightenSensitivity changed: {oldValue} -> {e.NewValue}");
// 立即保存设置到文件,确保设置不会丢失
SaveSettingsToFile();
}
#endregion #endregion
#region Canvas #region Canvas
@@ -729,46 +818,17 @@ namespace Ink_Canvas {
ComboBoxEraserSizeFloatingBar.SelectedIndex = s.SelectedIndex; ComboBoxEraserSizeFloatingBar.SelectedIndex = s.SelectedIndex;
ComboBoxEraserSize.SelectedIndex = s.SelectedIndex; ComboBoxEraserSize.SelectedIndex = s.SelectedIndex;
} }
if (Settings.Canvas.EraserShapeType == 0) {
double k = 1; // 使用统一的方法应用橡皮擦形状
switch (s.SelectedIndex) { ApplyCurrentEraserShape();
case 0:
k = 0.5; // 确保当前处于橡皮擦模式时能立即看到效果
break; if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint) {
case 1: // 先切换一下模式,再切回来,确保橡皮擦形状得到刷新
k = 0.8; inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
break; inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
case 3:
k = 1.25;
break;
case 4:
k = 1.8;
break;
}
inkCanvas.EraserShape = new EllipseStylusShape(k * 90, k * 90);
} else if (Settings.Canvas.EraserShapeType == 1) {
double k = 1;
switch (s.SelectedIndex) {
case 0:
k = 0.7;
break;
case 1:
k = 0.9;
break;
case 3:
k = 1.2;
break;
case 4:
k = 1.6;
break;
}
inkCanvas.EraserShape = new RectangleStylusShape(k * 90 * 0.6, k * 90);
} }
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
SaveSettingsToFile(); SaveSettingsToFile();
} }
@@ -777,23 +837,11 @@ namespace Ink_Canvas {
Settings.Canvas.EraserShapeType = 0; Settings.Canvas.EraserShapeType = 0;
SaveSettingsToFile(); SaveSettingsToFile();
CheckEraserTypeTab(); CheckEraserTypeTab();
double k = 1;
switch (ComboBoxEraserSizeFloatingBar.SelectedIndex) { // 使用统一的方法应用橡皮擦形状
case 0: ApplyCurrentEraserShape();
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(k * 90, k * 90);
inkCanvas.EditingMode = InkCanvasEditingMode.Ink; inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint; inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
} }
@@ -803,23 +851,11 @@ namespace Ink_Canvas {
Settings.Canvas.EraserShapeType = 1; Settings.Canvas.EraserShapeType = 1;
SaveSettingsToFile(); SaveSettingsToFile();
CheckEraserTypeTab(); CheckEraserTypeTab();
double k = 1;
switch (ComboBoxEraserSizeFloatingBar.SelectedIndex) { // 使用统一的方法应用橡皮擦形状
case 0: ApplyCurrentEraserShape();
k = 0.7;
break; // 确保当前处于橡皮擦模式时能立即看到效果
case 1:
k = 0.9;
break;
case 3:
k = 1.2;
break;
case 4:
k = 1.6;
break;
}
inkCanvas.EraserShape = new RectangleStylusShape(k * 90 * 0.6, k * 90);
inkCanvas.EditingMode = InkCanvasEditingMode.Ink; inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint; inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
} }
@@ -1284,29 +1320,52 @@ namespace Ink_Canvas {
BoardToggleSwitchEnableMultiTouchMode.IsOn = ToggleSwitchEnableMultiTouchMode.IsOn; BoardToggleSwitchEnableMultiTouchMode.IsOn = ToggleSwitchEnableMultiTouchMode.IsOn;
else else
ToggleSwitchEnableMultiTouchMode.IsOn = BoardToggleSwitchEnableMultiTouchMode.IsOn; ToggleSwitchEnableMultiTouchMode.IsOn = BoardToggleSwitchEnableMultiTouchMode.IsOn;
if (ToggleSwitchEnableMultiTouchMode.IsOn) { if (ToggleSwitchEnableMultiTouchMode.IsOn) {
if (!isInMultiTouchMode) { if (!isInMultiTouchMode) {
// 保存当前编辑模式和绘图工具状态
InkCanvasEditingMode currentEditingMode = inkCanvas.EditingMode;
int currentDrawingShapeMode = drawingShapeMode;
bool currentForceEraser = forceEraser;
inkCanvas.StylusDown += MainWindow_StylusDown; inkCanvas.StylusDown += MainWindow_StylusDown;
inkCanvas.StylusMove += MainWindow_StylusMove; inkCanvas.StylusMove += MainWindow_StylusMove;
inkCanvas.StylusUp += MainWindow_StylusUp; inkCanvas.StylusUp += MainWindow_StylusUp;
inkCanvas.TouchDown += MainWindow_TouchDown; inkCanvas.TouchDown += MainWindow_TouchDown;
inkCanvas.TouchDown -= Main_Grid_TouchDown; inkCanvas.TouchDown -= Main_Grid_TouchDown;
// 先设为None再设回原来的模式,避免可能的事件冲突
inkCanvas.EditingMode = InkCanvasEditingMode.None; inkCanvas.EditingMode = InkCanvasEditingMode.None;
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
inkCanvas.Children.Clear(); inkCanvas.Children.Clear();
isInMultiTouchMode = true; isInMultiTouchMode = true;
// 恢复到之前的编辑状态
inkCanvas.EditingMode = currentEditingMode;
drawingShapeMode = currentDrawingShapeMode;
forceEraser = currentForceEraser;
} }
} else { } else {
if (isInMultiTouchMode) { if (isInMultiTouchMode) {
// 保存当前编辑模式和绘图工具状态
InkCanvasEditingMode currentEditingMode = inkCanvas.EditingMode;
int currentDrawingShapeMode = drawingShapeMode;
bool currentForceEraser = forceEraser;
inkCanvas.StylusDown -= MainWindow_StylusDown; inkCanvas.StylusDown -= MainWindow_StylusDown;
inkCanvas.StylusMove -= MainWindow_StylusMove; inkCanvas.StylusMove -= MainWindow_StylusMove;
inkCanvas.StylusUp -= MainWindow_StylusUp; inkCanvas.StylusUp -= MainWindow_StylusUp;
inkCanvas.TouchDown -= MainWindow_TouchDown; inkCanvas.TouchDown -= MainWindow_TouchDown;
inkCanvas.TouchDown += Main_Grid_TouchDown; inkCanvas.TouchDown += Main_Grid_TouchDown;
// 先设为None再设回原来的模式,避免可能的事件冲突
inkCanvas.EditingMode = InkCanvasEditingMode.None; inkCanvas.EditingMode = InkCanvasEditingMode.None;
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
inkCanvas.Children.Clear(); inkCanvas.Children.Clear();
isInMultiTouchMode = false; isInMultiTouchMode = false;
// 恢复到之前的编辑状态
inkCanvas.EditingMode = currentEditingMode;
drawingShapeMode = currentDrawingShapeMode;
forceEraser = currentForceEraser;
} }
} }
@@ -1412,7 +1471,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;
@@ -1447,6 +1506,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;
@@ -1467,8 +1532,8 @@ namespace Ink_Canvas {
Settings.Startup.IsEnableNibMode = false; Settings.Startup.IsEnableNibMode = false;
Settings.Startup.IsAutoUpdate = true; Settings.Startup.IsAutoUpdate = true;
Settings.Startup.IsAutoUpdateWithSilence = true; Settings.Startup.IsAutoUpdateWithSilence = true;
Settings.Startup.AutoUpdateWithSilenceStartTime = "18:20"; Settings.Startup.AutoUpdateWithSilenceStartTime = "06:00";
Settings.Startup.AutoUpdateWithSilenceEndTime = "07:40"; Settings.Startup.AutoUpdateWithSilenceEndTime = "22:00";
Settings.Startup.IsFoldAtStartup = false; Settings.Startup.IsFoldAtStartup = false;
} }
@@ -1690,6 +1755,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() {
@@ -1718,5 +1798,61 @@ namespace Ink_Canvas {
Process.Start("https://github.com/WXRIW/Ink-Canvas"); Process.Start("https://github.com/WXRIW/Ink-Canvas");
HideSubPanels(); HideSubPanels();
} }
private void UpdateChannelSelector_Checked(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
var radioButton = sender as System.Windows.Controls.RadioButton;
if (radioButton != null) {
string channel = radioButton.Tag.ToString();
Settings.Startup.UpdateChannel = channel == "Beta" ? UpdateChannel.Beta : UpdateChannel.Release;
LogHelper.WriteLogToFile($"Settings | Update channel changed to {Settings.Startup.UpdateChannel}");
SaveSettingsToFile();
}
}
private async void FixVersionButton_Click(object sender, RoutedEventArgs e) {
// 显示确认对话框
var confirm = MessageBox.Show(
"此操作将下载当前选择通道的最新版本并安装,软件将自动关闭并更新。\n\n确定要执行版本修复吗?",
"版本修复确认",
MessageBoxButton.YesNo,
MessageBoxImage.Question);
if (confirm == MessageBoxResult.Yes) {
// 禁用按钮,避免重复点击
FixVersionButton.IsEnabled = false;
FixVersionButton.Content = "正在修复...";
try {
// 执行版本修复
bool result = await AutoUpdateHelper.FixVersion(Settings.Startup.UpdateChannel);
if (!result) {
MessageBox.Show(
"版本修复失败,可能是网络问题或当前已是最新版本。",
"修复失败",
MessageBoxButton.OK,
MessageBoxImage.Error);
// 恢复按钮状态
FixVersionButton.IsEnabled = true;
FixVersionButton.Content = "版本修复";
}
// 成功则会自动关闭应用程序并安装
}
catch (Exception ex) {
LogHelper.WriteLogToFile($"Error in FixVersionButton_Click: {ex.Message}", LogHelper.LogType.Error);
MessageBox.Show(
$"版本修复过程中发生错误: {ex.Message}",
"修复错误",
MessageBoxButton.OK,
MessageBoxImage.Error);
// 恢复按钮状态
FixVersionButton.IsEnabled = true;
FixVersionButton.Content = "版本修复";
}
}
}
} }
} }
+48 -2
View File
@@ -70,16 +70,37 @@ namespace Ink_Canvas {
BoundsWidth = Settings.Advanced.FingerModeBoundsWidth; BoundsWidth = Settings.Advanced.FingerModeBoundsWidth;
} }
// 设置自动更新相关选项
ToggleSwitchIsAutoUpdate.IsOn = Settings.Startup.IsAutoUpdate;
// 只有在启用了自动更新功能时才检查更新
if (Settings.Startup.IsAutoUpdate) { if (Settings.Startup.IsAutoUpdate) {
ToggleSwitchIsAutoUpdate.IsOn = true; if (isStartup) {
LogHelper.WriteLogToFile("AutoUpdate | Running auto-update check at startup");
AutoUpdate(); AutoUpdate();
} }
// 当设置被修改时也检查更新(非启动时)
else {
LogHelper.WriteLogToFile("AutoUpdate | Running auto-update check after settings change");
AutoUpdate();
}
}
// ToggleSwitchIsAutoUpdateWithSilence.Visibility = Settings.Startup.IsAutoUpdate ? Visibility.Visible : Visibility.Collapsed; // ToggleSwitchIsAutoUpdateWithSilence.Visibility = Settings.Startup.IsAutoUpdate ? Visibility.Visible : Visibility.Collapsed;
if (Settings.Startup.IsAutoUpdateWithSilence) { if (Settings.Startup.IsAutoUpdateWithSilence) {
ToggleSwitchIsAutoUpdateWithSilence.IsOn = true; ToggleSwitchIsAutoUpdateWithSilence.IsOn = true;
} }
// 初始化更新通道选择
foreach (var radioButton in UpdateChannelSelector.Items) {
if (radioButton is System.Windows.Controls.RadioButton rb) {
if (rb.Tag.ToString() == Settings.Startup.UpdateChannel.ToString()) {
rb.IsChecked = true;
break;
}
}
}
AutoUpdateTimePeriodBlock.Visibility = Settings.Startup.IsAutoUpdateWithSilence AutoUpdateTimePeriodBlock.Visibility = Settings.Startup.IsAutoUpdateWithSilence
? Visibility.Visible ? Visibility.Visible
: Visibility.Collapsed; : Visibility.Collapsed;
@@ -434,6 +455,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 +527,16 @@ 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;
// 直线拉直灵敏度也在这里初始化,即使它存储在InkToShape中
LineStraightenSensitivitySlider.Value = Settings.InkToShape.LineStraightenSensitivity;
// 初始化直线端点吸附相关设置
ToggleSwitchLineEndpointSnapping.IsOn = Settings.Canvas.LineEndpointSnapping;
LineEndpointSnappingThresholdSlider.Value = Settings.Canvas.LineEndpointSnappingThreshold;
} else { } else {
Settings.Canvas = new Canvas(); Settings.Canvas = new Canvas();
} }
@@ -564,12 +601,21 @@ namespace Ink_Canvas {
ToggleCheckboxEnableInkToShapeRectangle.IsChecked = Settings.InkToShape.IsInkToShapeRectangle; ToggleCheckboxEnableInkToShapeRectangle.IsChecked = Settings.InkToShape.IsInkToShapeRectangle;
ToggleCheckboxEnableInkToShapeRounded.IsChecked = Settings.InkToShape.IsInkToShapeRounded; ToggleCheckboxEnableInkToShapeRounded.IsChecked = Settings.InkToShape.IsInkToShapeRounded;
// 直线拉直灵敏度在Canvas部分已经初始化,这里不再重复
} 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;
+204 -15
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
@@ -113,7 +113,16 @@ namespace Ink_Canvas {
private Task<bool> CheckIsDrawingShapesInMultiTouchMode() { private Task<bool> CheckIsDrawingShapesInMultiTouchMode() {
if (isInMultiTouchMode) { if (isInMultiTouchMode) {
ToggleSwitchEnableMultiTouchMode.IsOn = false; // 不关闭多指书写模式,而是保存状态,暂时禁用多指书写相关的事件处理
// 不再调用 ToggleSwitchEnableMultiTouchMode.IsOn = false;
// 暂时禁用多指书写事件处理,以避免冲突
inkCanvas.StylusDown -= MainWindow_StylusDown;
inkCanvas.StylusMove -= MainWindow_StylusMove;
inkCanvas.StylusUp -= MainWindow_StylusUp;
inkCanvas.TouchDown -= MainWindow_TouchDown;
// 记录已暂时禁用多指书写模式,但实际上多指书写开关仍然为打开状态
lastIsInMultiTouchMode = true; lastIsInMultiTouchMode = true;
} }
@@ -129,6 +138,14 @@ namespace Ink_Canvas {
inkCanvas.IsManipulationEnabled = true; inkCanvas.IsManipulationEnabled = true;
CancelSingleFingerDragMode(); CancelSingleFingerDragMode();
} }
else {
// 即使不是长按,也设置必要的绘图状态
forceEraser = true;
drawingShapeMode = 1;
inkCanvas.EditingMode = InkCanvasEditingMode.None;
inkCanvas.IsManipulationEnabled = true;
isLongPressSelected = true; // 设置为选中状态,避免抬笔后切换回笔模式
}
lastMouseDownSender = null; lastMouseDownSender = null;
if (isLongPressSelected) { if (isLongPressSelected) {
@@ -189,6 +206,14 @@ namespace Ink_Canvas {
inkCanvas.IsManipulationEnabled = true; inkCanvas.IsManipulationEnabled = true;
CancelSingleFingerDragMode(); CancelSingleFingerDragMode();
} }
else {
// 即使不是长按,也设置必要的绘图状态
forceEraser = true;
drawingShapeMode = 2;
inkCanvas.EditingMode = InkCanvasEditingMode.None;
inkCanvas.IsManipulationEnabled = true;
isLongPressSelected = true; // 设置为选中状态,避免抬笔后切换回笔模式
}
lastMouseDownSender = null; lastMouseDownSender = null;
if (isLongPressSelected) { if (isLongPressSelected) {
@@ -276,6 +301,7 @@ namespace Ink_Canvas {
drawingShapeMode = 3; drawingShapeMode = 3;
inkCanvas.EditingMode = InkCanvasEditingMode.None; inkCanvas.EditingMode = InkCanvasEditingMode.None;
inkCanvas.IsManipulationEnabled = true; inkCanvas.IsManipulationEnabled = true;
isLongPressSelected = true; // 设置为选中状态,避免抬笔后切换回笔模式
CancelSingleFingerDragMode(); CancelSingleFingerDragMode();
DrawShapePromptToPen(); DrawShapePromptToPen();
} }
@@ -428,12 +454,26 @@ namespace Ink_Canvas {
#endregion #endregion
private void inkCanvas_TouchMove(object sender, TouchEventArgs e) { private void inkCanvas_TouchMove(object sender, TouchEventArgs e) {
// 如果处于手掌擦状态,继续使用相同的橡皮形状
if (isLastTouchEraser && currentPalmEraserShape != null) {
inkCanvas.EraserShape = currentPalmEraserShape;
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
return;
}
if (isSingleFingerDragMode) return; if (isSingleFingerDragMode) return;
// 处理形状绘制模式
if (drawingShapeMode != 0) { if (drawingShapeMode != 0) {
if (isLastTouchEraser) return; if (isLastTouchEraser) return;
//EraserContainer.Background = null; //EraserContainer.Background = null;
//ImageEraser.Visibility = Visibility.Visible; //ImageEraser.Visibility = Visibility.Visible;
if (isWaitUntilNextTouchDown) return;
// 修复触屏状态下几何绘制功能不可用的问题
// 在几何绘制模式下,即使isWaitUntilNextTouchDown为true,也应该处理触摸移动事件
// 只有当多点触控时才需要等待下一次触摸
if (isWaitUntilNextTouchDown && dec.Count > 1) return;
if (dec.Count > 1) { if (dec.Count > 1) {
isWaitUntilNextTouchDown = true; isWaitUntilNextTouchDown = true;
try { try {
@@ -443,15 +483,87 @@ namespace Ink_Canvas {
catch { catch {
Trace.WriteLine("lastTempStrokeCollection failed."); Trace.WriteLine("lastTempStrokeCollection failed.");
} }
return; return;
} }
if (inkCanvas.EditingMode != InkCanvasEditingMode.None) // 在几何绘制模式下,确保处理单点触控的移动事件
inkCanvas.EditingMode = InkCanvasEditingMode.None; Point touchPoint = e.GetTouchPoint(inkCanvas).Position;
MouseTouchMove(touchPoint);
return; // 处理完几何绘制后直接返回,不执行后面的代码
} }
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; //多笔完成的图形 当前所处在的笔画
@@ -1277,8 +1389,34 @@ namespace Ink_Canvas {
ViewboxFloatingBar.IsHitTestVisible = true; ViewboxFloatingBar.IsHitTestVisible = true;
BlackboardUIGridForInkReplay.IsHitTestVisible = true; BlackboardUIGridForInkReplay.IsHitTestVisible = true;
// 在几何绘制模式下,确保正确处理触摸抬起事件
if (drawingShapeMode != 0) {
// 如果是几何绘制模式,确保将临时绘制的图形添加到永久图形中
if (lastTempStroke != null) {
// 将临时笔画添加到历史记录中
var strokes = new StrokeCollection();
strokes.Add(lastTempStroke);
timeMachine.CommitStrokeUserInputHistory(strokes);
// 清除临时笔画引用,以便下次绘制
lastTempStroke = null;
}
if (lastTempStrokeCollection != null && lastTempStrokeCollection.Count > 0) {
// 将临时笔画集合添加到历史记录中
timeMachine.CommitStrokeUserInputHistory(lastTempStrokeCollection);
// 清除临时笔画集合引用,以便下次绘制
lastTempStrokeCollection = new StrokeCollection();
}
// 如果不是长按选中的状态,则需要在抬起手指后重置isWaitUntilNextTouchDown
if (!isLongPressSelected && dec.Count == 0) {
isWaitUntilNextTouchDown = false;
}
}
inkCanvas_MouseUp(sender, null); inkCanvas_MouseUp(sender, null);
if (dec.Count == 0) isWaitUntilNextTouchDown = false; // 修改此处逻辑,在长按选择图形模式下保持isWaitUntilNextTouchDown
if (dec.Count == 0 && !isLongPressSelected) isWaitUntilNextTouchDown = false;
} }
private Stroke lastTempStroke = null; private Stroke lastTempStroke = null;
@@ -1468,17 +1606,37 @@ namespace Ink_Canvas {
} }
if (lastIsInMultiTouchMode) { if (lastIsInMultiTouchMode) {
ToggleSwitchEnableMultiTouchMode.IsOn = true; // 不再重新启用开关,而是恢复多指书写相关的事件处理
// ToggleSwitchEnableMultiTouchMode.IsOn = true;
// 恢复多指书写事件处理
inkCanvas.StylusDown += MainWindow_StylusDown;
inkCanvas.StylusMove += MainWindow_StylusMove;
inkCanvas.StylusUp += MainWindow_StylusUp;
inkCanvas.TouchDown += MainWindow_TouchDown;
lastIsInMultiTouchMode = false; lastIsInMultiTouchMode = false;
} }
} }
// 修改此处逻辑,确保在正确的情况下才切换回笔模式
if (drawingShapeMode != 9 && drawingShapeMode != 0 && drawingShapeMode != 24 && drawingShapeMode != 25) { if (drawingShapeMode != 9 && drawingShapeMode != 0 && drawingShapeMode != 24 && drawingShapeMode != 25) {
if (isLongPressSelected) { } if (isLongPressSelected) {
// 如果是长按选中的情况,保持图形模式,不做任何切换
isWaitUntilNextTouchDown = true; // 保持当前绘图模式直到下一次触摸
}
else { else {
BtnPen_Click(null, null); //画完一次还原到笔模式 BtnPen_Click(null, null); //画完一次还原到笔模式
if (lastIsInMultiTouchMode) { if (lastIsInMultiTouchMode) {
ToggleSwitchEnableMultiTouchMode.IsOn = true; // 不再重新启用开关,而是恢复多指书写相关的事件处理
// ToggleSwitchEnableMultiTouchMode.IsOn = true;
// 恢复多指书写事件处理
inkCanvas.StylusDown += MainWindow_StylusDown;
inkCanvas.StylusMove += MainWindow_StylusMove;
inkCanvas.StylusUp += MainWindow_StylusUp;
inkCanvas.TouchDown += MainWindow_TouchDown;
lastIsInMultiTouchMode = false; lastIsInMultiTouchMode = false;
} }
} }
@@ -1504,7 +1662,15 @@ namespace Ink_Canvas {
else { else {
BtnPen_Click(null, null); //画完还原到笔模式 BtnPen_Click(null, null); //画完还原到笔模式
if (lastIsInMultiTouchMode) { if (lastIsInMultiTouchMode) {
ToggleSwitchEnableMultiTouchMode.IsOn = true; // 不再重新启用开关,而是恢复多指书写相关的事件处理
// ToggleSwitchEnableMultiTouchMode.IsOn = true;
// 恢复多指书写事件处理
inkCanvas.StylusDown += MainWindow_StylusDown;
inkCanvas.StylusMove += MainWindow_StylusMove;
inkCanvas.StylusUp += MainWindow_StylusUp;
inkCanvas.TouchDown += MainWindow_TouchDown;
lastIsInMultiTouchMode = false; lastIsInMultiTouchMode = false;
} }
@@ -1550,7 +1716,15 @@ namespace Ink_Canvas {
BtnPen_Click(null, null); //画完还原到笔模式 BtnPen_Click(null, null); //画完还原到笔模式
if (lastIsInMultiTouchMode) { if (lastIsInMultiTouchMode) {
ToggleSwitchEnableMultiTouchMode.IsOn = true; // 不再重新启用开关,而是恢复多指书写相关的事件处理
// ToggleSwitchEnableMultiTouchMode.IsOn = true;
// 恢复多指书写事件处理
inkCanvas.StylusDown += MainWindow_StylusDown;
inkCanvas.StylusMove += MainWindow_StylusMove;
inkCanvas.StylusUp += MainWindow_StylusUp;
inkCanvas.TouchDown += MainWindow_TouchDown;
lastIsInMultiTouchMode = false; lastIsInMultiTouchMode = false;
} }
} }
@@ -1607,9 +1781,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,171 @@ 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 LINE_STRAIGHTEN_THRESHOLD = 0.20; // 默认灵敏度阈值,与UI默认值对应
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) {
// 检查是否启用了直线自动拉直功能
if (Settings.Canvas.AutoStraightenLine && 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();
// 记录是否需要拉直线条,默认不拉直
bool shouldStraighten = false;
bool snapped = false;
// 首先检查是否应该拉直线条(使用灵敏度设置),这是主要判断条件
// 读取实际的灵敏度设置值
double sensitivity = Settings.InkToShape.LineStraightenSensitivity;
System.Diagnostics.Debug.WriteLine($"当前灵敏度值: {sensitivity}");
// 将灵敏度值传递给判断函数
shouldStraighten = ShouldStraightenLine(e.Stroke);
// 输出一些调试信息,帮助理解灵敏度设置的效果
System.Diagnostics.Debug.WriteLine($"LineStraightenSensitivity: {Settings.InkToShape.LineStraightenSensitivity}, ShouldStraighten: {shouldStraighten}");
// 再检查端点吸附功能,这是独立的可选功能
if (Settings.Canvas.LineEndpointSnapping) {
// 只有在启用了形状识别(矩形或三角形)时才执行端点吸附
if (Settings.InkToShape.IsInkToShapeRectangle || Settings.InkToShape.IsInkToShapeTriangle) {
Point[] snappedPoints = GetSnappedEndpoints(startPoint, endPoint);
if (snappedPoints != null) {
startPoint = snappedPoints[0];
endPoint = snappedPoints[1];
snapped = true;
}
}
}
// 如果满足任一条件(需要拉直或成功吸附),则创建直线
// 这确保灵敏度设置独立于端点吸附功能发挥作用
if (shouldStraighten || snapped) {
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 +581,302 @@ 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);
// 线条必须足够长才考虑拉直,使用设置中的阈值
if (lineLength < Settings.Canvas.AutoStraightenLineThreshold)
return false;
// 获取用户设置的灵敏度值,确保使用正确的设置
double sensitivity = Settings.InkToShape.LineStraightenSensitivity;
// 输出当前灵敏度值(调试用)
System.Diagnostics.Debug.WriteLine($"IsPotentialStraightLine - sensitivity: {sensitivity}, length: {lineLength}");
// 根据灵敏度调整快速检查阈值
double quickThreshold;
// 如果灵敏度超过1.0,使用更宽松的快速检查标准
if (sensitivity > 1.0) {
// 高灵敏度模式 - 使用更宽松的阈值
quickThreshold = Math.Min(0.2 + (sensitivity - 1.0) * 0.3, 0.5); // 映射到0.2-0.5范围
} else {
// 常规灵敏度模式
quickThreshold = Math.Min(sensitivity * 1.5, 0.20);
}
System.Diagnostics.Debug.WriteLine($"使用快速检查阈值: {quickThreshold}");
// 快速检查:计算几个关键点与直线的距离
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;
// 记录检测到的偏差(调试用)
System.Diagnostics.Debug.WriteLine($"Deviations: q={quarterDeviation}, m={midDeviation}, tq={threeQuarterDeviation}, threshold={quickRelativeThreshold}");
// 如果灵敏度超过1.5,则即使有一个点满足条件也认为可能是直线
if (sensitivity > 1.5) {
// 超高灵敏度模式:只要有一个关键点偏差小,就认为可能是直线
if (quarterDeviation <= quickRelativeThreshold ||
midDeviation <= quickRelativeThreshold ||
threeQuarterDeviation <= quickRelativeThreshold) {
return true;
}
} else {
// 常规判断:如果任一点偏离太大,直接排除
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 < Settings.Canvas.AutoStraightenLineThreshold) {
// 显示调试信息 - 线条长度不足
// MessageBox.Show($"线条太短: {lineLength} < {Settings.Canvas.AutoStraightenLineThreshold}", "调试信息");
return false;
}
// 获取用户设置的灵敏度值,确保使用正确的值进行后续判断
double sensitivity = Settings.InkToShape.LineStraightenSensitivity;
// 输出详细的调试信息
System.Diagnostics.Debug.WriteLine($"ShouldStraightenLine - sensitivity: {sensitivity}, length: {lineLength}");
// 临时:显示调试消息框
// MessageBox.Show($"灵敏度值: {sensitivity}", "调试信息");
// 计算点与直线的偏差
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;
// 更详细的调试信息
System.Diagnostics.Debug.WriteLine($"Max deviation: {maxDeviation}, Avg: {avgDeviation}, Threshold: {sensitivity * lineLength}");
// 支持更广泛的灵敏度范围 (0.05-2.0)
// 如果灵敏度高于1.0,使用更宽松的判断标准
if (sensitivity > 1.0) {
// 高灵敏度模式 - 允许更大的偏差
double adjustedSensitivity = 0.5 + (sensitivity - 1.0) * 1.5; // 映射到0.5-2.0范围
// 只判断平均偏差和相对偏差
if (maxDeviation / lineLength < adjustedSensitivity && avgDeviation < lineLength * 0.1 * adjustedSensitivity) {
System.Diagnostics.Debug.WriteLine("接受拉直 (高灵敏度模式)");
return true;
}
System.Diagnostics.Debug.WriteLine("拒绝拉直 (高灵敏度模式)");
return false;
}
// 否则使用常规判断标准
else {
// 检查点分布的一致性 - 如果有些点偏离很大而其他点很接近直线,表明线条有明显弯曲
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;
// 输出更多调试信息
System.Diagnostics.Debug.WriteLine($"Deviation variance: {deviationVariance}, Threshold: {sensitivity * lineLength * 0.05}");
// 如果最大偏差超过线长的阈值比例,或者偏差方差较大(表示不均匀弯曲),则不拉直
// 灵敏度越大,容许的偏差越大,更容易将线条识别为直线
if ((maxDeviation / lineLength) > sensitivity) {
System.Diagnostics.Debug.WriteLine("拒绝拉直:最大偏差过大");
return false;
}
// 如果偏差方差大,说明线条弯曲不均匀
// 灵敏度越大,容许的偏差方差越大
if (deviationVariance > (sensitivity * lineLength * 0.05)) {
System.Diagnostics.Debug.WriteLine("拒绝拉直:偏差方差过大");
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);
// 输出中点偏差信息
System.Diagnostics.Debug.WriteLine($"Mid deviation: {midDeviation}, Threshold: {lineLength * sensitivity * 0.8}");
// 如果中点偏离过大,不拉直
// 使用灵敏度作为判断基准,灵敏度越大,容许的中点偏离越大
if (midDeviation > (lineLength * sensitivity * 0.8)) {
System.Diagnostics.Debug.WriteLine("拒绝拉直:中点偏差过大");
return false;
}
}
System.Diagnostics.Debug.WriteLine("接受拉直");
return true;
}
}
// New method: Creates a straight line stroke between two points
private StylusPointCollection CreateStraightLine(Point start, Point end) {
StylusPointCollection points = new StylusPointCollection();
// 根据是否启用压感触屏模式决定如何设置压感
// 如果未启用压感触屏模式,则使用均匀粗细
if (!Settings.Canvas.EnablePressureTouchMode || Settings.Canvas.DisablePressure ||
Settings.InkToShape.IsInkToShapeNoFakePressureRectangle == true || penType == 1) {
// 使用均匀粗细(所有点压感值都是0.5f)
points.Add(new StylusPoint(start.X, start.Y, 0.5f));
// 可以添加一些额外的中间点使线条更平滑(均匀粗细)
double distance = GetDistance(start, end);
if (distance > 100) {
// 对于较长的线条,添加几个中间点
for (int i = 1; i < 3; i++) {
double ratio = i / 3.0;
Point midPoint = new Point(
start.X + (end.X - start.X) * ratio,
start.Y + (end.Y - start.Y) * ratio);
points.Add(new StylusPoint(midPoint.X, midPoint.Y, 0.5f));
}
}
points.Add(new StylusPoint(end.X, end.Y, 0.5f));
} else {
// 启用了压感触屏模式,使用变化的粗细(原有行为)
points.Add(new StylusPoint(start.X, start.Y, 0.4f));
// 添加中点,压感值较高,使线条中间较粗
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) {
// 如果端点吸附功能关闭,直接返回null
// 这里不再返回原始点,因为调用此方法的地方会判断返回值是否为null
if (!Settings.Canvas.LineEndpointSnapping)
return null;
bool startSnapped = false;
bool endSnapped = false;
Point snappedStart = start;
Point snappedEnd = end;
// 使用设置中的吸附距离阈值
double snapThreshold = Settings.Canvas.LineEndpointSnappingThreshold;
// 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) < snapThreshold) {
snappedStart = strokeStart;
startSnapped = true;
} else if (GetDistance(start, strokeEnd) < snapThreshold) {
snappedStart = strokeEnd;
startSnapped = true;
}
}
// Check if end point should snap to an endpoint
if (!endSnapped) {
if (GetDistance(end, strokeStart) < snapThreshold) {
snappedEnd = strokeStart;
endSnapped = true;
} else if (GetDistance(end, strokeEnd) < snapThreshold) {
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;
+97 -13
View File
@@ -6,6 +6,10 @@ using System.Runtime.CompilerServices;
using System.Timers; using System.Timers;
using System.Windows; using System.Windows;
using MessageBox = System.Windows.MessageBox; using MessageBox = System.Windows.MessageBox;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace Ink_Canvas { namespace Ink_Canvas {
public class TimeViewModel : INotifyPropertyChanged { public class TimeViewModel : INotifyPropertyChanged {
@@ -302,24 +306,104 @@ namespace Ink_Canvas {
} }
private void timerCheckAutoUpdateWithSilence_Elapsed(object sender, ElapsedEventArgs e) { private void timerCheckAutoUpdateWithSilence_Elapsed(object sender, ElapsedEventArgs e) {
Dispatcher.Invoke(() => { // 停止计时器,避免重复触发
try { timerCheckAutoUpdateWithSilence.Stop();
if (!Topmost || inkCanvas.Strokes.Count > 0) return;
}
catch (Exception ex) {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error);
}
});
try { try {
if (AutoUpdateWithSilenceTimeComboBox.CheckIsInSilencePeriod( // 检查是否有可用的更新
Settings.Startup.AutoUpdateWithSilenceStartTime, if (string.IsNullOrEmpty(AvailableLatestVersion)) {
Settings.Startup.AutoUpdateWithSilenceEndTime)) { LogHelper.WriteLogToFile("AutoUpdate | No available update version found");
return;
}
// 检查是否启用了静默更新
if (!Settings.Startup.IsAutoUpdateWithSilence) {
LogHelper.WriteLogToFile("AutoUpdate | Silent update is disabled");
return;
}
// 检查更新文件是否已下载
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 | Update file not downloaded yet");
// 尝试下载更新文件
Task.Run(async () => {
bool isDownloadSuccessful = await AutoUpdateHelper.DownloadSetupFileAndSaveStatus(AvailableLatestVersion);
if (isDownloadSuccessful) {
LogHelper.WriteLogToFile("AutoUpdate | Update downloaded successfully, will check again for installation");
// 重新启动计时器,下次检查时安装
timerCheckAutoUpdateWithSilence.Start();
} else {
LogHelper.WriteLogToFile("AutoUpdate | Failed to download update", LogHelper.LogType.Error);
}
});
return;
}
// 检查是否在静默更新时间段内
bool isInSilencePeriod = AutoUpdateWithSilenceTimeComboBox.CheckIsInSilencePeriod(
Settings.Startup.AutoUpdateWithSilenceStartTime,
Settings.Startup.AutoUpdateWithSilenceEndTime);
if (!isInSilencePeriod) {
LogHelper.WriteLogToFile("AutoUpdate | Not in silence update time period");
// 重新启动计时器,稍后再检查
timerCheckAutoUpdateWithSilence.Start();
return;
}
// 检查应用程序状态,确保可以安全更新
// 空闲状态的判定为不处于批注模式和画板模式
bool canSafelyUpdate = false;
Dispatcher.Invoke(() => {
try {
// 判断是否处于批注模式(inkCanvas.EditingMode == InkCanvasEditingMode.Ink
// 判断是否处于画板模式(!Topmost)
if (inkCanvas.EditingMode != InkCanvasEditingMode.Ink && Topmost) {
// 检查是否有未保存的内容或正在进行的操作
if (!isHidingSubPanelsWhenInking) {
canSafelyUpdate = true;
LogHelper.WriteLogToFile("AutoUpdate | Application is in a safe state for update - not in ink or board mode");
} else {
LogHelper.WriteLogToFile("AutoUpdate | Application is currently performing operations");
}
} else {
LogHelper.WriteLogToFile("AutoUpdate | Application is in ink or board mode, cannot update now");
}
}
catch (Exception ex) {
LogHelper.WriteLogToFile($"AutoUpdate | Error checking application state: {ex.Message}", LogHelper.LogType.Error);
}
});
if (canSafelyUpdate) {
LogHelper.WriteLogToFile("AutoUpdate | Installing update now");
// 设置为用户主动退出,避免被看门狗判定为崩溃
App.IsAppExitByUser = true;
// 执行更新安装
AutoUpdateHelper.InstallNewVersionApp(AvailableLatestVersion, true); AutoUpdateHelper.InstallNewVersionApp(AvailableLatestVersion, true);
timerCheckAutoUpdateWithSilence.Stop();
// 关闭应用程序
Dispatcher.Invoke(() => {
Application.Current.Shutdown();
});
} else {
LogHelper.WriteLogToFile("AutoUpdate | Cannot safely update now, will try again later");
// 重新启动计时器,稍后再检查
timerCheckAutoUpdateWithSilence.Start();
} }
} }
catch (Exception ex) { catch (Exception ex) {
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); LogHelper.WriteLogToFile($"AutoUpdate | Error in silent update check: {ex.Message}", LogHelper.LogType.Error);
// 出错时重新启动计时器,稍后再检查
timerCheckAutoUpdateWithSilence.Start();
} }
} }
} }
+79 -28
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;
} }
} }
@@ -89,6 +91,24 @@ namespace Ink_Canvas {
ViewboxFloatingBar.IsHitTestVisible = false; ViewboxFloatingBar.IsHitTestVisible = false;
BlackboardUIGridForInkReplay.IsHitTestVisible = false; BlackboardUIGridForInkReplay.IsHitTestVisible = false;
// 确保手写笔模式下显示光标
if (Settings.Canvas.IsShowCursor) {
inkCanvas.ForceCursor = true;
inkCanvas.UseCustomCursor = true;
// 根据当前编辑模式设置不同的光标
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint) {
inkCanvas.Cursor = Cursors.Cross;
} else if (inkCanvas.EditingMode == InkCanvasEditingMode.Ink) {
var sri = Application.GetResourceStream(new Uri("Resources/Cursors/Pen.cur", UriKind.Relative));
if (sri != null)
inkCanvas.Cursor = new Cursor(sri.Stream);
}
// 强制显示光标
System.Windows.Forms.Cursor.Show();
}
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint
|| inkCanvas.EditingMode == InkCanvasEditingMode.EraseByStroke || inkCanvas.EditingMode == InkCanvasEditingMode.EraseByStroke
|| inkCanvas.EditingMode == InkCanvasEditingMode.Select) return; || inkCanvas.EditingMode == InkCanvasEditingMode.Select) return;
@@ -135,6 +155,13 @@ namespace Ink_Canvas {
} }
catch { } catch { }
// 确保手写笔移动时光标保持可见
if (Settings.Canvas.IsShowCursor) {
inkCanvas.ForceCursor = true;
inkCanvas.UseCustomCursor = true;
System.Windows.Forms.Cursor.Show();
}
var strokeVisual = GetStrokeVisual(e.StylusDevice.Id); var strokeVisual = GetStrokeVisual(e.StylusDevice.Id);
var stylusPointCollection = e.GetStylusPoints(this); var stylusPointCollection = e.GetStylusPoints(this);
foreach (var stylusPoint in stylusPointCollection) foreach (var stylusPoint in stylusPointCollection)
@@ -179,8 +206,15 @@ namespace Ink_Canvas {
private Point iniP = new Point(0, 0); private Point iniP = new Point(0, 0);
private bool isLastTouchEraser = false; private bool isLastTouchEraser = false;
private bool forcePointEraser = true; private bool forcePointEraser = true;
// 用于记录手掌擦的尺寸和形状
private StylusShape currentPalmEraserShape = null;
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;
@@ -194,6 +228,14 @@ namespace Ink_Canvas {
if (NeedUpdateIniP()) iniP = e.GetTouchPoint(inkCanvas).Position; if (NeedUpdateIniP()) iniP = e.GetTouchPoint(inkCanvas).Position;
if (drawingShapeMode == 9 && isFirstTouchCuboid == false) MouseTouchMove(iniP); if (drawingShapeMode == 9 && isFirstTouchCuboid == false) MouseTouchMove(iniP);
inkCanvas.Opacity = 1; inkCanvas.Opacity = 1;
// 如果已经处于手掌擦状态,保持状态不变
if (isLastTouchEraser && currentPalmEraserShape != null) {
inkCanvas.EraserShape = currentPalmEraserShape;
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
return;
}
double boundsWidth = GetTouchBoundWidth(e), eraserMultiplier = 1.0; double boundsWidth = GetTouchBoundWidth(e), eraserMultiplier = 1.0;
if (!Settings.Advanced.EraserBindTouchMultiplier && Settings.Advanced.IsSpecialScreen) if (!Settings.Advanced.EraserBindTouchMultiplier && Settings.Advanced.IsSpecialScreen)
eraserMultiplier = 1 / Settings.Advanced.TouchMultiplier; eraserMultiplier = 1 / Settings.Advanced.TouchMultiplier;
@@ -217,28 +259,42 @@ namespace Ink_Canvas {
break; break;
} }
inkCanvas.EraserShape = new EllipseStylusShape(boundsWidth * k * eraserMultiplier, // 根据EraserShapeType设置合适的橡皮擦形状并保存
boundsWidth * k * eraserMultiplier); if (Settings.Canvas.EraserShapeType == 0) {
// 圆形擦
currentPalmEraserShape = new EllipseStylusShape(boundsWidth * k * eraserMultiplier,
boundsWidth * k * eraserMultiplier);
} else if (Settings.Canvas.EraserShapeType == 1) {
// 矩形黑板擦
currentPalmEraserShape = new RectangleStylusShape(boundsWidth * k * eraserMultiplier * 0.6,
boundsWidth * k * eraserMultiplier);
}
inkCanvas.EraserShape = currentPalmEraserShape;
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint; inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
} }
else { else {
if (StackPanelPPTControls.Visibility == Visibility.Visible && inkCanvas.Strokes.Count == 0 && if (StackPanelPPTControls.Visibility == Visibility.Visible && inkCanvas.Strokes.Count == 0 &&
Settings.PowerPointSettings.IsEnableFingerGestureSlideShowControl) { Settings.PowerPointSettings.IsEnableFingerGestureSlideShowControl) {
isLastTouchEraser = false; isLastTouchEraser = false;
currentPalmEraserShape = null;
inkCanvas.EditingMode = InkCanvasEditingMode.GestureOnly; inkCanvas.EditingMode = InkCanvasEditingMode.GestureOnly;
inkCanvas.Opacity = 0.1; inkCanvas.Opacity = 0.1;
} }
else { else {
inkCanvas.EraserShape = new EllipseStylusShape(5, 5); currentPalmEraserShape = new EllipseStylusShape(5, 5);
inkCanvas.EraserShape = currentPalmEraserShape;
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke; inkCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
} }
} }
} }
else { else {
isLastTouchEraser = false; isLastTouchEraser = false;
inkCanvas.EraserShape = currentPalmEraserShape = null;
forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5); // 修复面积擦时不显示橡皮形状:无论 forcePointEraser 状态,均显示 50x50 橡皮
if (forceEraser) return; inkCanvas.EraserShape = new EllipseStylusShape(50, 50);
// 修复触屏状态下几何绘制功能不可用的问题:在几何绘制模式下不应该因为forceEraser而直接返回
if (forceEraser && drawingShapeMode == 0) return;
inkCanvas.EditingMode = InkCanvasEditingMode.Ink; inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
} }
} }
@@ -286,7 +342,6 @@ namespace Ink_Canvas {
} }
private void inkCanvas_PreviewTouchUp(object sender, TouchEventArgs e) { private void inkCanvas_PreviewTouchUp(object sender, TouchEventArgs e) {
inkCanvas.ReleaseAllTouchCaptures(); inkCanvas.ReleaseAllTouchCaptures();
ViewboxFloatingBar.IsHitTestVisible = true; ViewboxFloatingBar.IsHitTestVisible = true;
BlackboardUIGridForInkReplay.IsHitTestVisible = true; BlackboardUIGridForInkReplay.IsHitTestVisible = true;
@@ -297,6 +352,17 @@ namespace Ink_Canvas {
inkCanvas.EditingMode = lastInkCanvasEditingMode; inkCanvas.EditingMode = lastInkCanvasEditingMode;
dec.Remove(e.TouchDevice.Id); dec.Remove(e.TouchDevice.Id);
inkCanvas.Opacity = 1; inkCanvas.Opacity = 1;
// 如果是手掌触发的面积擦抬起,需要确保橡皮擦形状被正确重置
if (isLastTouchEraser && dec.Count == 0) {
isLastTouchEraser = false;
currentPalmEraserShape = null; // 清除保存的手掌擦形状
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint && forcePointEraser) {
// 重新应用当前设置的橡皮擦形状
ApplyCurrentEraserShape();
}
}
if (dec.Count == 0) if (dec.Count == 0)
if (lastTouchDownStrokeCollection.Count() != inkCanvas.Strokes.Count() && if (lastTouchDownStrokeCollection.Count() != inkCanvas.Strokes.Count() &&
!(drawingShapeMode == 9 && !isFirstTouchCuboid)) { !(drawingShapeMode == 9 && !isFirstTouchCuboid)) {
@@ -318,27 +384,12 @@ namespace Ink_Canvas {
inkCanvas.EditingMode = InkCanvasEditingMode.Ink; inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
} }
// -- removed --
//
//private void inkCanvas_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
//{
// if (isInMultiTouchMode || !Settings.Gesture.IsEnableTwoFingerGesture || inkCanvas.Strokes.Count == 0 || dec.Count() < 2) return;
// _currentCommitType = CommitReason.Manipulation;
// StrokeCollection strokes = inkCanvas.GetSelectedStrokes();
// if (strokes.Count != 0)
// {
// inkCanvas.Strokes.Replace(strokes, strokes.Clone());
// }
// else
// {
// var originalStrokes = inkCanvas.Strokes;
// var targetStrokes = originalStrokes.Clone();
// originalStrokes.Replace(originalStrokes, targetStrokes);
// }
// _currentCommitType = CommitReason.UserInput;
//}
private void Main_Grid_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) { private void Main_Grid_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) {
// 手掌擦时禁止移动/缩放
if (isLastTouchEraser || inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint)
return;
// 三指及以上禁止缩放
bool disableScale = dec.Count >= 3;
if (isInMultiTouchMode || !Settings.Gesture.IsEnableTwoFingerGesture) return; if (isInMultiTouchMode || !Settings.Gesture.IsEnableTwoFingerGesture) return;
if ((dec.Count >= 2 && (Settings.PowerPointSettings.IsEnableTwoFingerGestureInPresentationMode || if ((dec.Count >= 2 && (Settings.PowerPointSettings.IsEnableTwoFingerGestureInPresentationMode ||
StackPanelPPTControls.Visibility != Visibility.Visible || StackPanelPPTControls.Visibility != Visibility.Visible ||
@@ -363,7 +414,7 @@ namespace Ink_Canvas {
if (Settings.Gesture.IsEnableTwoFingerRotation) if (Settings.Gesture.IsEnableTwoFingerRotation)
m.RotateAt(rotate, center.X, center.Y); // 旋转 m.RotateAt(rotate, center.X, center.Y); // 旋转
if (Settings.Gesture.IsEnableTwoFingerZoom) if (Settings.Gesture.IsEnableTwoFingerZoom && !disableScale)
m.ScaleAt(scale.X, scale.Y, center.X, center.Y); // 缩放 m.ScaleAt(scale.X, scale.Y, center.X, center.Y); // 缩放
} }
+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.7.0.0")]
[assembly: AssemblyFileVersion("5.0.5.1")] [assembly: AssemblyFileVersion("1.7.0.0")]
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+31 -3
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; }
@@ -83,6 +95,13 @@ namespace Ink_Canvas
public bool IsEnableTwoFingerRotationOnSelection { get; set; } = false; public bool IsEnableTwoFingerRotationOnSelection { get; set; } = false;
} }
// 更新通道枚举
public enum UpdateChannel
{
Release,
Beta
}
public class Startup public class Startup
{ {
[JsonProperty("isAutoUpdate")] [JsonProperty("isAutoUpdate")]
@@ -90,9 +109,14 @@ namespace Ink_Canvas
[JsonProperty("isAutoUpdateWithSilence")] [JsonProperty("isAutoUpdateWithSilence")]
public bool IsAutoUpdateWithSilence { get; set; } = false; public bool IsAutoUpdateWithSilence { get; set; } = false;
[JsonProperty("isAutoUpdateWithSilenceStartTime")] [JsonProperty("isAutoUpdateWithSilenceStartTime")]
public string AutoUpdateWithSilenceStartTime { get; set; } = "00:00"; public string AutoUpdateWithSilenceStartTime { get; set; } = "06:00";
[JsonProperty("isAutoUpdateWithSilenceEndTime")] [JsonProperty("isAutoUpdateWithSilenceEndTime")]
public string AutoUpdateWithSilenceEndTime { get; set; } = "00:00"; public string AutoUpdateWithSilenceEndTime { get; set; } = "22:00";
[JsonProperty("updateChannel")]
public UpdateChannel UpdateChannel { get; set; } = UpdateChannel.Release;
[JsonProperty("skippedVersion")]
public string SkippedVersion { get; set; } = "";
[JsonProperty("isEnableNibMode")] [JsonProperty("isEnableNibMode")]
public bool IsEnableNibMode { get; set; } = false; public bool IsEnableNibMode { get; set; } = false;
@@ -308,7 +332,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;
@@ -397,6 +421,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.20; // 直线检测灵敏度,值越小越严格(0.05-2.0)
} }
public class RandSettings { public class RandSettings {
@@ -406,5 +432,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;
} }
} }
+49 -24
View File
@@ -10,23 +10,27 @@
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="600" 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 Community Edition更新带来了如下新功能供您探索:
1. 全新设计的UI界面,包括浮动工具栏和白板页面均经过重新设计,更加现代化的UI让您在使用的过程中更加舒适。 1. 全新设计的UI界面,包括浮动工具栏和白板页面均经过重新设计,更加现代化的UI让您在使用的过程中更加舒适。
2. 带来了实时修改橡皮大小和橡皮形状的菜单。您可以选择使用圆形橡皮,方形橡皮,和类似希沃白板的真实黑板擦(矩形)橡皮。 2. 带来了实时修改橡皮大小和橡皮形状的菜单。您可以选择使用圆形橡皮,方形橡皮,和类似希沃白板的真实黑板擦(矩形)橡皮。
@@ -39,21 +43,42 @@
</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="#f1f5f9" BorderBrush="#e2e8f0" BorderThickness="1" CornerRadius="4" Margin="24,16,24,20">
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundKey}" Color="#15803d"/> <ui:SimpleStackPanel Orientation="Vertical" HorizontalAlignment="Center" Spacing="14" Margin="0,16,0,16">
<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> <!-- 立即更新按钮 -->
</Button> <Button x:Name="UpdateNowButton" Content="立刻下载并安装" Foreground="White" FontSize="15" FontWeight="SemiBold"
<Button Content="下次更新" Foreground="Black" HorizontalAlignment="Center" Margin="0,10,0,0"/> Padding="20,10" Width="360" Height="48" HorizontalAlignment="Center"
<Button Content="跳过该版本" HorizontalAlignment="Center" Foreground="#71717a" Margin="0,10,0,0"/> 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>
+229 -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,238 @@ 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 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;
}
// 自动更新和静默更新设置已移至设置界面,此处不再需要
// 确保按钮可见且可用
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");
// 设置结果为立即更新
Result = UpdateResult.UpdateNow;
// 关闭窗口,返回到MainWindow处理后续下载和安装流程
DialogResult = true;
Close();
}
private void UpdateLaterButton_Click(object sender, RoutedEventArgs e)
{
LogHelper.WriteLogToFile("AutoUpdate | Update Later button clicked");
// 设置结果为稍后更新
Result = UpdateResult.UpdateLater;
// 关闭窗口
DialogResult = true;
Close();
}
private void SkipVersionButton_Click(object sender, RoutedEventArgs e)
{
LogHelper.WriteLogToFile("AutoUpdate | Skip Version button clicked");
// 设置结果为跳过该版本
Result = UpdateResult.SkipVersion;
// 关闭窗口
DialogResult = true;
Close();
}
// 根据屏幕分辨率调整窗口大小
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;
}
}
}
} }
} }
} }
-1
View File
@@ -11,7 +11,6 @@
Title="Ink Canvas 抽奖" Height="500" Width="900"> Title="Ink Canvas 抽奖" Height="500" Width="900">
<Border Background="#F0F3F9" CornerRadius="10" BorderThickness="1" BorderBrush="#0066BF" Margin="0" ClipToBounds="True"> <Border Background="#F0F3F9" CornerRadius="10" BorderThickness="1" BorderBrush="#0066BF" Margin="0" ClipToBounds="True">
<Canvas> <Canvas>
<Image Source="/Resources/hatsune-miku1.png" Width="300" Canvas.Bottom="-140" Canvas.Left="-48" Canvas.Top="304"></Image>
<Grid Canvas.Left="0" Canvas.Right="0" Canvas.Top="0" Canvas.Bottom="0" Width="900" Height="309" HorizontalAlignment="Center" VerticalAlignment="Top"> <Grid Canvas.Left="0" Canvas.Right="0" Canvas.Top="0" Canvas.Bottom="0" Width="900" Height="309" HorizontalAlignment="Center" VerticalAlignment="Top">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/> <ColumnDefinition Width="1.8*"/>
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.
-7
View File
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
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,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
-201
View File
@@ -1,201 +0,0 @@
#pragma checksum "..\..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1E327457A4903FFFEEF5296A4E0B282BD14654E1"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using Hardcodet.Wpf.TaskbarNotification;
using Ink_Canvas;
using NHotkey.Wpf;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Common;
using iNKORE.UI.WPF.Modern.Common.Converters;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using iNKORE.UI.WPF.Modern.Helpers;
using iNKORE.UI.WPF.Modern.Helpers.Styles;
using iNKORE.UI.WPF.Modern.Input;
using iNKORE.UI.WPF.Modern.Markup;
using iNKORE.UI.WPF.Modern.Media;
using iNKORE.UI.WPF.Modern.Media.Animation;
using iNKORE.UI.WPF.Modern.Native;
using iNKORE.UI.WPF.Modern.Themes.DesignTime;
namespace Ink_Canvas {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application, System.Windows.Markup.IComponentConnector, System.Windows.Markup.IStyleConnector {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
#line 7 "..\..\..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
System.Uri resourceLocater = new System.Uri("/InkCanvasForClass;component/app.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\App.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 2:
#line 13 "..\..\..\..\App.xaml"
((System.Windows.Controls.ContextMenu)(target)).Opened += new System.Windows.RoutedEventHandler(this.SysTrayMenu_Opened);
#line default
#line hidden
return;
case 3:
#line 14 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Checked += new System.Windows.RoutedEventHandler(this.HideICCMainWindowTrayIconMenuItem_Checked);
#line default
#line hidden
#line 14 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Unchecked += new System.Windows.RoutedEventHandler(this.HideICCMainWindowTrayIconMenuItem_UnChecked);
#line default
#line hidden
return;
case 4:
#line 55 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ForceFullScreenTrayIconMenuItem_Clicked);
#line default
#line hidden
return;
case 5:
#line 88 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.FoldFloatingBarTrayIconMenuItem_Clicked);
#line default
#line hidden
return;
case 6:
#line 133 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ResetFloatingBarPositionTrayIconMenuItem_Clicked);
#line default
#line hidden
return;
case 7:
#line 164 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.RestartAppTrayIconMenuItem_Clicked);
#line default
#line hidden
return;
case 8:
#line 196 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.CloseAppTrayIconMenuItem_Clicked);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.PreviewMouseWheelEvent;
#line 11 "..\..\..\..\App.xaml"
eventSetter.Handler = new System.Windows.Input.MouseWheelEventHandler(this.ScrollViewer_PreviewMouseWheel);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
}
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public static void Main() {
Ink_Canvas.App app = new Ink_Canvas.App();
app.InitializeComponent();
app.Run();
}
}
}
@@ -1,62 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.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);
}
}
}
@@ -1,8 +0,0 @@
is_global = true
build_property.RootNamespace = Ink_Canvas
build_property.ProjectDir = C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false
build_property.EffectiveAnalysisLevelStyle =
build_property.EnableCodeStyleSeverity =
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
@@ -1,20 +0,0 @@
InkCanvasForClass
winexe
C#
.cs
C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\obj\ARM64\Debug\net472\
Ink_Canvas
none
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
C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\App.xaml
13173459795
55-769182680
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;
True
@@ -1,11 +0,0 @@
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 CE 1.2.5\Ink Canvas\App.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\MainWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\CountdownTimerWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\CycleProcessBar.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\HasNewUpdateWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\NamesInputWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\OperatingGuideWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\RandWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\YesOrNoNotificationWindow.xaml;;
File diff suppressed because it is too large Load Diff
@@ -1,533 +0,0 @@
#pragma checksum "..\..\..\..\..\Windows\CountdownTimerWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6F0867438FA51D9A7933293AB63597EAB4BB202C"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using Ink_Canvas;
using Ink_Canvas.ProcessBars;
using NHotkey.Wpf;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Common;
using iNKORE.UI.WPF.Modern.Common.Converters;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using iNKORE.UI.WPF.Modern.Helpers;
using iNKORE.UI.WPF.Modern.Helpers.Styles;
using iNKORE.UI.WPF.Modern.Input;
using iNKORE.UI.WPF.Modern.Markup;
using iNKORE.UI.WPF.Modern.Media;
using iNKORE.UI.WPF.Modern.Media.Animation;
using iNKORE.UI.WPF.Modern.Native;
using iNKORE.UI.WPF.Modern.Themes.DesignTime;
namespace Ink_Canvas {
/// <summary>
/// CountdownTimerWindow
/// </summary>
public partial class CountdownTimerWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 15 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock TbCurrentTime;
#line default
#line hidden
#line 17 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Viewbox BigViewController;
#line default
#line hidden
#line 19 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal Ink_Canvas.ProcessBars.CycleProcessBar ProcessBarTime;
#line default
#line hidden
#line 23 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock TextBlockHour;
#line default
#line hidden
#line 27 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ItemsControl TextControlHour;
#line default
#line hidden
#line 44 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Grid GridAdjustHour;
#line default
#line hidden
#line 70 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock TextBlockMinute;
#line default
#line hidden
#line 74 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ItemsControl TextControlMinute;
#line default
#line hidden
#line 108 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnTimeSetOkay;
#line default
#line hidden
#line 129 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock TextBlockSecond;
#line default
#line hidden
#line 133 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ItemsControl TextControlSecond;
#line default
#line hidden
#line 170 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BorderStopTime;
#line default
#line hidden
#line 175 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock TextBlockStopTime;
#line default
#line hidden
#line 180 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnStart;
#line default
#line hidden
#line 182 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal iNKORE.UI.WPF.Modern.Controls.SymbolIcon SymbolIconStart;
#line default
#line hidden
#line 185 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnStartCover;
#line default
#line hidden
#line 192 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnReset;
#line default
#line hidden
#line 200 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnResetCover;
#line default
#line hidden
#line 211 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnMinimal;
#line default
#line hidden
#line 218 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal iNKORE.UI.WPF.Modern.Controls.SymbolIcon SymbolIconMinimal;
#line default
#line hidden
#line 221 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnFullscreen;
#line default
#line hidden
#line 228 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal iNKORE.UI.WPF.Modern.Controls.SymbolIcon SymbolIconFullscreen;
#line default
#line hidden
#line 231 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnClose;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/InkCanvasForClass;component/windows/countdowntimerwindow.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
return System.Delegate.CreateDelegate(delegateType, this, handler);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
#line 11 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((Ink_Canvas.CountdownTimerWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
#line default
#line hidden
#line 11 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((Ink_Canvas.CountdownTimerWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);
#line default
#line hidden
return;
case 2:
this.TbCurrentTime = ((System.Windows.Controls.TextBlock)(target));
#line 15 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
this.TbCurrentTime.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.BtnMinimal_OnMouseUp);
#line default
#line hidden
return;
case 3:
#line 16 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Border)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.WindowDragMove);
#line default
#line hidden
return;
case 4:
this.BigViewController = ((System.Windows.Controls.Viewbox)(target));
return;
case 5:
this.ProcessBarTime = ((Ink_Canvas.ProcessBars.CycleProcessBar)(target));
return;
case 6:
#line 20 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((iNKORE.UI.WPF.Modern.Controls.SimpleStackPanel)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.WindowDragMove);
#line default
#line hidden
return;
case 7:
this.TextBlockHour = ((System.Windows.Controls.TextBlock)(target));
return;
case 8:
this.TextControlHour = ((System.Windows.Controls.ItemsControl)(target));
return;
case 9:
this.GridAdjustHour = ((System.Windows.Controls.Grid)(target));
return;
case 10:
#line 46 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
#line default
#line hidden
return;
case 11:
#line 49 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
return;
case 12:
#line 54 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);
#line default
#line hidden
return;
case 13:
#line 57 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_3);
#line default
#line hidden
return;
case 14:
this.TextBlockMinute = ((System.Windows.Controls.TextBlock)(target));
return;
case 15:
this.TextControlMinute = ((System.Windows.Controls.ItemsControl)(target));
return;
case 16:
#line 93 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_5);
#line default
#line hidden
return;
case 17:
#line 96 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_4);
#line default
#line hidden
return;
case 18:
#line 101 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_6);
#line default
#line hidden
return;
case 19:
#line 104 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_7);
#line default
#line hidden
return;
case 20:
this.BtnTimeSetOkay = ((System.Windows.Controls.Border)(target));
#line 108 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
this.BtnTimeSetOkay.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseUp);
#line default
#line hidden
return;
case 21:
this.TextBlockSecond = ((System.Windows.Controls.TextBlock)(target));
return;
case 22:
this.TextControlSecond = ((System.Windows.Controls.ItemsControl)(target));
return;
case 23:
#line 150 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Grid)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseUp);
#line default
#line hidden
return;
case 24:
#line 153 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_8);
#line default
#line hidden
return;
case 25:
#line 156 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_9);
#line default
#line hidden
return;
case 26:
#line 161 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_10);
#line default
#line hidden
return;
case 27:
#line 164 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_11);
#line default
#line hidden
return;
case 28:
this.BorderStopTime = ((System.Windows.Controls.Border)(target));
return;
case 29:
this.TextBlockStopTime = ((System.Windows.Controls.TextBlock)(target));
return;
case 30:
this.BtnStart = ((System.Windows.Controls.Border)(target));
#line 180 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
this.BtnStart.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BtnStart_MouseUp);
#line default
#line hidden
return;
case 31:
this.SymbolIconStart = ((iNKORE.UI.WPF.Modern.Controls.SymbolIcon)(target));
return;
case 32:
this.BtnStartCover = ((System.Windows.Controls.Border)(target));
return;
case 33:
this.BtnReset = ((System.Windows.Controls.Border)(target));
#line 192 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
this.BtnReset.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BtnReset_MouseUp);
#line default
#line hidden
return;
case 34:
this.BtnResetCover = ((System.Windows.Controls.Border)(target));
return;
case 35:
this.BtnMinimal = ((System.Windows.Controls.Border)(target));
#line 211 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
this.BtnMinimal.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BtnMinimal_OnMouseUp);
#line default
#line hidden
return;
case 36:
this.SymbolIconMinimal = ((iNKORE.UI.WPF.Modern.Controls.SymbolIcon)(target));
return;
case 37:
this.BtnFullscreen = ((System.Windows.Controls.Border)(target));
#line 221 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
this.BtnFullscreen.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BtnFullscreen_MouseUp);
#line default
#line hidden
return;
case 38:
this.SymbolIconFullscreen = ((iNKORE.UI.WPF.Modern.Controls.SymbolIcon)(target));
return;
case 39:
this.BtnClose = ((System.Windows.Controls.Border)(target));
#line 231 "..\..\..\..\..\Windows\CountdownTimerWindow.xaml"
this.BtnClose.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BtnClose_MouseUp);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}
@@ -1,103 +0,0 @@
#pragma checksum "..\..\..\..\..\Windows\CycleProcessBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BA19DDDB9767BC7236A1FD27CF7870819D17BDF6"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using Ink_Canvas.ProcessBars;
using NHotkey.Wpf;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace Ink_Canvas.ProcessBars {
/// <summary>
/// CycleProcessBar
/// </summary>
public partial class CycleProcessBar : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 11 "..\..\..\..\..\Windows\CycleProcessBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Path myCycleProcessBar;
#line default
#line hidden
#line 12 "..\..\..\..\..\Windows\CycleProcessBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Label lbValue;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/InkCanvasForClass;component/windows/cycleprocessbar.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\..\Windows\CycleProcessBar.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.myCycleProcessBar = ((System.Windows.Shapes.Path)(target));
return;
case 2:
this.lbValue = ((System.Windows.Controls.Label)(target));
return;
}
this._contentLoaded = true;
}
}
}
@@ -1,94 +0,0 @@
#pragma checksum "..\..\..\..\..\Windows\HasNewUpdateWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "F175FD074CC52DB5BA92934B39B401618F102C52"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using Ink_Canvas;
using MdXaml;
using NHotkey.Wpf;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Common;
using iNKORE.UI.WPF.Modern.Common.Converters;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using iNKORE.UI.WPF.Modern.Helpers;
using iNKORE.UI.WPF.Modern.Helpers.Styles;
using iNKORE.UI.WPF.Modern.Input;
using iNKORE.UI.WPF.Modern.Markup;
using iNKORE.UI.WPF.Modern.Media;
using iNKORE.UI.WPF.Modern.Media.Animation;
using iNKORE.UI.WPF.Modern.Native;
using iNKORE.UI.WPF.Modern.Themes.DesignTime;
namespace Ink_Canvas {
/// <summary>
/// HasNewUpdateWindow
/// </summary>
public partial class HasNewUpdateWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/InkCanvasForClass;component/windows/hasnewupdatewindow.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\..\Windows\HasNewUpdateWindow.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
this._contentLoaded = true;
}
}
}
@@ -1,129 +0,0 @@
#pragma checksum "..\..\..\..\..\Windows\NamesInputWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "94598B72FAE3B046C627B4D990E7014E73354BFE"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using Ink_Canvas;
using NHotkey.Wpf;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Common;
using iNKORE.UI.WPF.Modern.Common.Converters;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using iNKORE.UI.WPF.Modern.Helpers;
using iNKORE.UI.WPF.Modern.Helpers.Styles;
using iNKORE.UI.WPF.Modern.Input;
using iNKORE.UI.WPF.Modern.Markup;
using iNKORE.UI.WPF.Modern.Media;
using iNKORE.UI.WPF.Modern.Media.Animation;
using iNKORE.UI.WPF.Modern.Native;
using iNKORE.UI.WPF.Modern.Themes.DesignTime;
namespace Ink_Canvas {
/// <summary>
/// NamesInputWindow
/// </summary>
public partial class NamesInputWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 14 "..\..\..\..\..\Windows\NamesInputWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox TextBoxNames;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/InkCanvasForClass;component/windows/namesinputwindow.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\..\Windows\NamesInputWindow.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
#line 11 "..\..\..\..\..\Windows\NamesInputWindow.xaml"
((Ink_Canvas.NamesInputWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
#line default
#line hidden
#line 11 "..\..\..\..\..\Windows\NamesInputWindow.xaml"
((Ink_Canvas.NamesInputWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);
#line default
#line hidden
return;
case 2:
this.TextBoxNames = ((System.Windows.Controls.TextBox)(target));
return;
case 3:
#line 17 "..\..\..\..\..\Windows\NamesInputWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}
@@ -1,157 +0,0 @@
#pragma checksum "..\..\..\..\..\Windows\OperatingGuideWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "064624323549B036812125DBE67746F73944DF2D"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using Ink_Canvas;
using NHotkey.Wpf;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Common;
using iNKORE.UI.WPF.Modern.Common.Converters;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using iNKORE.UI.WPF.Modern.Helpers;
using iNKORE.UI.WPF.Modern.Helpers.Styles;
using iNKORE.UI.WPF.Modern.Input;
using iNKORE.UI.WPF.Modern.Markup;
using iNKORE.UI.WPF.Modern.Media;
using iNKORE.UI.WPF.Modern.Media.Animation;
using iNKORE.UI.WPF.Modern.Native;
using iNKORE.UI.WPF.Modern.Themes.DesignTime;
namespace Ink_Canvas {
/// <summary>
/// OperatingGuideWindow
/// </summary>
public partial class OperatingGuideWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 76 "..\..\..\..\..\Windows\OperatingGuideWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnFullscreen;
#line default
#line hidden
#line 83 "..\..\..\..\..\Windows\OperatingGuideWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal iNKORE.UI.WPF.Modern.Controls.SymbolIcon SymbolIconFullscreen;
#line default
#line hidden
#line 86 "..\..\..\..\..\Windows\OperatingGuideWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnClose;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/InkCanvasForClass;component/windows/operatingguidewindow.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\..\Windows\OperatingGuideWindow.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
#line 15 "..\..\..\..\..\Windows\OperatingGuideWindow.xaml"
((System.Windows.Controls.Border)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.WindowDragMove);
#line default
#line hidden
return;
case 2:
#line 18 "..\..\..\..\..\Windows\OperatingGuideWindow.xaml"
((System.Windows.Controls.ScrollViewer)(target)).ManipulationBoundaryFeedback += new System.EventHandler<System.Windows.Input.ManipulationBoundaryFeedbackEventArgs>(this.SCManipulationBoundaryFeedback);
#line default
#line hidden
return;
case 3:
this.BtnFullscreen = ((System.Windows.Controls.Border)(target));
#line 76 "..\..\..\..\..\Windows\OperatingGuideWindow.xaml"
this.BtnFullscreen.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BtnFullscreen_MouseUp);
#line default
#line hidden
return;
case 4:
this.SymbolIconFullscreen = ((iNKORE.UI.WPF.Modern.Controls.SymbolIcon)(target));
return;
case 5:
this.BtnClose = ((System.Windows.Controls.Border)(target));
#line 86 "..\..\..\..\..\Windows\OperatingGuideWindow.xaml"
this.BtnClose.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BtnClose_MouseUp);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}
@@ -1,299 +0,0 @@
#pragma checksum "..\..\..\..\..\Windows\RandWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "FD9A73B991636613BD6C7B0522D40D93923F9AAC"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using Ink_Canvas;
using NHotkey.Wpf;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Common;
using iNKORE.UI.WPF.Modern.Common.Converters;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using iNKORE.UI.WPF.Modern.Helpers;
using iNKORE.UI.WPF.Modern.Helpers.Styles;
using iNKORE.UI.WPF.Modern.Input;
using iNKORE.UI.WPF.Modern.Markup;
using iNKORE.UI.WPF.Modern.Media;
using iNKORE.UI.WPF.Modern.Media.Animation;
using iNKORE.UI.WPF.Modern.Native;
using iNKORE.UI.WPF.Modern.Themes.DesignTime;
namespace Ink_Canvas {
/// <summary>
/// RandWindow
/// </summary>
public partial class RandWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 22 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Label LabelOutput;
#line default
#line hidden
#line 23 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Label LabelOutput2;
#line default
#line hidden
#line 24 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Label LabelOutput3;
#line default
#line hidden
#line 27 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal iNKORE.UI.WPF.Modern.Controls.SimpleStackPanel PeopleControlPane;
#line default
#line hidden
#line 29 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BorderBtnMinus;
#line default
#line hidden
#line 52 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock LabelNumberCount;
#line default
#line hidden
#line 53 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BorderBtnAdd;
#line default
#line hidden
#line 78 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox NoHotStudents;
#line default
#line hidden
#line 81 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox NoShengPiZi;
#line default
#line hidden
#line 86 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox ComboBoxRandMode;
#line default
#line hidden
#line 96 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BorderBtnRand;
#line default
#line hidden
#line 99 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal iNKORE.UI.WPF.Modern.Controls.SymbolIcon SymbolIconStart;
#line default
#line hidden
#line 106 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BorderBtnHelp;
#line default
#line hidden
#line 114 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock TextBlockPeopleCount;
#line default
#line hidden
#line 117 "..\..\..\..\..\Windows\RandWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Border BtnClose;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/InkCanvasForClass;component/windows/randwindow.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\..\Windows\RandWindow.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
#line 9 "..\..\..\..\..\Windows\RandWindow.xaml"
((Ink_Canvas.RandWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
#line default
#line hidden
return;
case 2:
this.LabelOutput = ((System.Windows.Controls.Label)(target));
return;
case 3:
this.LabelOutput2 = ((System.Windows.Controls.Label)(target));
return;
case 4:
this.LabelOutput3 = ((System.Windows.Controls.Label)(target));
return;
case 5:
this.PeopleControlPane = ((iNKORE.UI.WPF.Modern.Controls.SimpleStackPanel)(target));
return;
case 6:
this.BorderBtnMinus = ((System.Windows.Controls.Border)(target));
#line 29 "..\..\..\..\..\Windows\RandWindow.xaml"
this.BorderBtnMinus.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BorderBtnMinus_MouseUp);
#line default
#line hidden
return;
case 7:
this.LabelNumberCount = ((System.Windows.Controls.TextBlock)(target));
return;
case 8:
this.BorderBtnAdd = ((System.Windows.Controls.Border)(target));
#line 53 "..\..\..\..\..\Windows\RandWindow.xaml"
this.BorderBtnAdd.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BorderBtnAdd_MouseUp);
#line default
#line hidden
return;
case 9:
this.NoHotStudents = ((System.Windows.Controls.CheckBox)(target));
return;
case 10:
this.NoShengPiZi = ((System.Windows.Controls.CheckBox)(target));
return;
case 11:
this.ComboBoxRandMode = ((System.Windows.Controls.ComboBox)(target));
return;
case 12:
this.BorderBtnRand = ((System.Windows.Controls.Border)(target));
#line 96 "..\..\..\..\..\Windows\RandWindow.xaml"
this.BorderBtnRand.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BorderBtnRand_MouseUp);
#line default
#line hidden
return;
case 13:
this.SymbolIconStart = ((iNKORE.UI.WPF.Modern.Controls.SymbolIcon)(target));
return;
case 14:
this.BorderBtnHelp = ((System.Windows.Controls.Border)(target));
#line 106 "..\..\..\..\..\Windows\RandWindow.xaml"
this.BorderBtnHelp.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BorderBtnHelp_MouseUp);
#line default
#line hidden
return;
case 15:
this.TextBlockPeopleCount = ((System.Windows.Controls.TextBlock)(target));
return;
case 16:
this.BtnClose = ((System.Windows.Controls.Border)(target));
#line 117 "..\..\..\..\..\Windows\RandWindow.xaml"
this.BtnClose.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.BtnClose_MouseUp);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}
@@ -1,131 +0,0 @@
#pragma checksum "..\..\..\..\..\Windows\YesOrNoNotificationWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6FDB33A27E5749FEDB5D64193EE52D5001933FAD"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using Ink_Canvas;
using NHotkey.Wpf;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Common;
using iNKORE.UI.WPF.Modern.Common.Converters;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using iNKORE.UI.WPF.Modern.Helpers;
using iNKORE.UI.WPF.Modern.Helpers.Styles;
using iNKORE.UI.WPF.Modern.Input;
using iNKORE.UI.WPF.Modern.Markup;
using iNKORE.UI.WPF.Modern.Media;
using iNKORE.UI.WPF.Modern.Media.Animation;
using iNKORE.UI.WPF.Modern.Native;
using iNKORE.UI.WPF.Modern.Themes.DesignTime;
namespace Ink_Canvas {
/// <summary>
/// YesOrNoNotificationWindow
/// </summary>
public partial class YesOrNoNotificationWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 19 "..\..\..\..\..\Windows\YesOrNoNotificationWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock Label;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/InkCanvasForClass;component/windows/yesornonotificationwindow.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\..\Windows\YesOrNoNotificationWindow.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
#line 8 "..\..\..\..\..\Windows\YesOrNoNotificationWindow.xaml"
((Ink_Canvas.YesOrNoNotificationWindow)(target)).Closed += new System.EventHandler(this.Window_Closed);
#line default
#line hidden
return;
case 2:
this.Label = ((System.Windows.Controls.TextBlock)(target));
return;
case 3:
#line 21 "..\..\..\..\..\Windows\YesOrNoNotificationWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ButtonYes_Click);
#line default
#line hidden
return;
case 4:
#line 28 "..\..\..\..\..\Windows\YesOrNoNotificationWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ButtonNo_Click);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}
@@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
@@ -1,201 +0,0 @@
#pragma checksum "..\..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1E327457A4903FFFEEF5296A4E0B282BD14654E1"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using Hardcodet.Wpf.TaskbarNotification;
using Ink_Canvas;
using NHotkey.Wpf;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Common;
using iNKORE.UI.WPF.Modern.Common.Converters;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using iNKORE.UI.WPF.Modern.Helpers;
using iNKORE.UI.WPF.Modern.Helpers.Styles;
using iNKORE.UI.WPF.Modern.Input;
using iNKORE.UI.WPF.Modern.Markup;
using iNKORE.UI.WPF.Modern.Media;
using iNKORE.UI.WPF.Modern.Media.Animation;
using iNKORE.UI.WPF.Modern.Native;
using iNKORE.UI.WPF.Modern.Themes.DesignTime;
namespace Ink_Canvas {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application, System.Windows.Markup.IComponentConnector, System.Windows.Markup.IStyleConnector {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
#line 7 "..\..\..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
System.Uri resourceLocater = new System.Uri("/InkCanvasForClass;component/app.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\App.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 2:
#line 13 "..\..\..\..\App.xaml"
((System.Windows.Controls.ContextMenu)(target)).Opened += new System.Windows.RoutedEventHandler(this.SysTrayMenu_Opened);
#line default
#line hidden
return;
case 3:
#line 14 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Checked += new System.Windows.RoutedEventHandler(this.HideICCMainWindowTrayIconMenuItem_Checked);
#line default
#line hidden
#line 14 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Unchecked += new System.Windows.RoutedEventHandler(this.HideICCMainWindowTrayIconMenuItem_UnChecked);
#line default
#line hidden
return;
case 4:
#line 55 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ForceFullScreenTrayIconMenuItem_Clicked);
#line default
#line hidden
return;
case 5:
#line 88 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.FoldFloatingBarTrayIconMenuItem_Clicked);
#line default
#line hidden
return;
case 6:
#line 133 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ResetFloatingBarPositionTrayIconMenuItem_Clicked);
#line default
#line hidden
return;
case 7:
#line 164 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.RestartAppTrayIconMenuItem_Clicked);
#line default
#line hidden
return;
case 8:
#line 196 "..\..\..\..\App.xaml"
((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.CloseAppTrayIconMenuItem_Clicked);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.PreviewMouseWheelEvent;
#line 11 "..\..\..\..\App.xaml"
eventSetter.Handler = new System.Windows.Input.MouseWheelEventHandler(this.ScrollViewer_PreviewMouseWheel);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
}
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.0")]
public static void Main() {
Ink_Canvas.App app = new Ink_Canvas.App();
app.InitializeComponent();
app.Run();
}
}
}
@@ -1,62 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "9.0.5.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);
}
}
}
@@ -1,8 +0,0 @@
is_global = true
build_property.RootNamespace = Ink_Canvas
build_property.ProjectDir = C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false
build_property.EffectiveAnalysisLevelStyle =
build_property.EnableCodeStyleSeverity =
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
@@ -1,20 +0,0 @@
InkCanvasForClass
winexe
C#
.cs
C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\obj\ARM64\Release\net472\
Ink_Canvas
none
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
C:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\App.xaml
13173459795
55-769182680
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;
True
@@ -1,11 +0,0 @@
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 CE 1.2.5\Ink Canvas\App.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\MainWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\CountdownTimerWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\CycleProcessBar.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\HasNewUpdateWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\NamesInputWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\OperatingGuideWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\RandWindow.xaml;;
FC:\Users\Administrator\Desktop\ICC CE\ICC CE 1.2.5\Ink Canvas\Windows\YesOrNoNotificationWindow.xaml;;
File diff suppressed because it is too large Load Diff

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