Compare commits
245 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9ec424625 | |||
| 1e96477127 | |||
| 87ffa48265 | |||
| 8b64df435c | |||
| dcf88ee510 | |||
| b21a15376d | |||
| 3e87ed4f9b | |||
| a6cd9c955b | |||
| 86b52b76ed | |||
| 853f380e5d | |||
| 027686a3b5 | |||
| 79b87e59be | |||
| 3a37e55162 | |||
| 1ff40c0016 | |||
| 4f7c1021c8 | |||
| e687c78ba8 | |||
| 2c2f46a0d8 | |||
| 29fa565258 | |||
| 51f3d410c9 | |||
| a0d159da9d | |||
| 9edb58ee27 | |||
| a8de65ab0e | |||
| ef8a894489 | |||
| 992f388a56 | |||
| a54e7206a0 | |||
| c4e74b21fc | |||
| 7b9e07bdda | |||
| 19f5204253 | |||
| c4ad5c5f81 | |||
| e888118a20 | |||
| 7afce136f6 | |||
| 71c4dadeee | |||
| c6a95c99ef | |||
| a6d44685b3 | |||
| a8ce61dad9 | |||
| 0f47d1473d | |||
| 2134ee516a | |||
| 6c60306bee | |||
| 816748833c | |||
| cac0fca3bb | |||
| 5ed28b121e | |||
| c4180eba6f | |||
| 0065a1f81f | |||
| e1f3a6ada4 | |||
| ed7ffbcb13 | |||
| 6a8d9db407 | |||
| 81140837f1 | |||
| 70232645a8 | |||
| 4d3b3ef3df | |||
| d203314424 | |||
| b95da2d8d5 | |||
| a8c5ccda17 | |||
| 86b996637c | |||
| 1480d4a14e | |||
| 8586735ca8 | |||
| b8013afd64 | |||
| 812bc83939 | |||
| d6829744bb | |||
| a7a03544b6 | |||
| ffa8729d10 | |||
| ce291d3a77 | |||
| 297dbad60c | |||
| 54982218f5 | |||
| c14f4df494 | |||
| f53f23aa4b | |||
| 10c59fb4b4 | |||
| a5cffc5ea4 | |||
| 200c299ce7 | |||
| 8547276549 | |||
| b09afcf725 | |||
| a2860be7a3 | |||
| de9d026e3a | |||
| 27a1baae7b | |||
| f2584309d1 | |||
| 831fd09615 | |||
| e0e22a09c0 | |||
| 60c6e0632d | |||
| 6da13c4fc0 | |||
| ec330aea69 | |||
| 318682b63a | |||
| dd53d7ff0a | |||
| b03207d287 | |||
| 7db87b7c36 | |||
| 54d0aaca04 | |||
| 352aa886c8 | |||
| 8fada629f0 | |||
| 34bb3cd0bd | |||
| 5555a67422 | |||
| 3631d35946 | |||
| 460d4a5ac1 | |||
| b7b5db18fd | |||
| 58d877af6b | |||
| ab20e0d8f2 | |||
| 42e55c51b0 | |||
| ca82c24c76 | |||
| 66874e7a85 | |||
| e365a94f71 | |||
| 81298e5980 | |||
| 4eb920553b | |||
| 1be5408302 | |||
| 1e9a7b037a | |||
| e79ed438ef | |||
| ff658409be | |||
| 9c26353fed | |||
| 2a3ce9549a | |||
| 8093f55b4f | |||
| 4a46892486 | |||
| 35fafc39a8 | |||
| 3976970bb5 | |||
| 1a3ab49849 | |||
| 32d75ae23d | |||
| 29c6844390 | |||
| 9c6eee59a8 | |||
| 4ff2be67d3 | |||
| 47d3eb13ce | |||
| 5de3043544 | |||
| 4b1d544c6b | |||
| 6cb8fe3a6e | |||
| 1acf2e044e | |||
| 9e9e960fa3 | |||
| e767873ff1 | |||
| b57762afed | |||
| 24526c5a48 | |||
| ed1b62ec50 | |||
| 98e727cf55 | |||
| 6c4ed850b0 | |||
| db6b9da945 | |||
| 52c930624a | |||
| b7ddcb5419 | |||
| 34f27c8e8d | |||
| 3f7055327b | |||
| 51fb13b448 | |||
| 5273990305 | |||
| a44badddaa | |||
| 3e8d186dc8 | |||
| 51f8a0541d | |||
| 808da0a3a7 | |||
| 1c522840cd | |||
| 6fb8506551 | |||
| 7bf0438960 | |||
| fe02ec1852 | |||
| 4020925af1 | |||
| 863b42f516 | |||
| 7f6b03be27 | |||
| 880770b718 | |||
| ed74f98919 | |||
| 4a1e42d5ee | |||
| b21e608eea | |||
| 671ec2fba6 | |||
| 293a89575a | |||
| 542812eb74 | |||
| e44cb715d0 | |||
| f7a1a1c851 | |||
| 757c08cd02 | |||
| 15fcd50151 | |||
| 867a747853 | |||
| 02dfbb54b6 | |||
| c42c6c8dfe | |||
| 316d568cbc | |||
| 0b72b1f1b3 | |||
| 25b52def92 | |||
| ab67ea48f0 | |||
| 912c1b91e4 | |||
| d4f1d21634 | |||
| 6c0e7c2e64 | |||
| e054a50b55 | |||
| ff005e6398 | |||
| 74cc8e7dda | |||
| 254d70a787 | |||
| 28b728822c | |||
| 5a53471bcd | |||
| a3fee5d77c | |||
| 6f961225d7 | |||
| 1b0b4f7505 | |||
| fac66fafbd | |||
| b9d6ac3047 | |||
| e7c723de46 | |||
| 10629b253c | |||
| dace6ad486 | |||
| 4c70f35714 | |||
| 7b4d13c16f | |||
| 0e561ad24e | |||
| d09d8223c9 | |||
| 6dafde9735 | |||
| a0f84bf017 | |||
| 7049c53889 | |||
| 7750fa799d | |||
| 5f828736de | |||
| 869c8ce31b | |||
| 0b7b55224f | |||
| 2a23be44f2 | |||
| fa0cbb4d3f | |||
| 38bc4decf6 | |||
| b5ec6e0d79 | |||
| 82486c707d | |||
| 5ff437bed5 | |||
| 2f7e0b85c0 | |||
| c9548af008 | |||
| b20e4a041f | |||
| 87f64ccc81 | |||
| 58028ea95c | |||
| 35fa062cc3 | |||
| 9de6555519 | |||
| a9baf47823 | |||
| a9b64d2899 | |||
| 4d9fa754e8 | |||
| 862ac27212 | |||
| 4ada8b05e7 | |||
| d250e83df9 | |||
| 8e8f4256ac | |||
| d6502251e1 | |||
| c3159c61ee | |||
| 0e5b31a8e4 | |||
| ad18277223 | |||
| 661fd21626 | |||
| d8fd231476 | |||
| 8d611a22a2 | |||
| 6cb8b188ec | |||
| d1d0e00959 | |||
| cbc317795e | |||
| ab88c34abc | |||
| 18b0556f7a | |||
| 7bea23005d | |||
| b46cbcc15f | |||
| 71ad15ce25 | |||
| 5a3101a182 | |||
| eba888082a | |||
| 43beffeadd | |||
| 3645906067 | |||
| 0206273200 | |||
| 0a50d15da0 | |||
| 85d98c0b70 | |||
| 6a02bf01d5 | |||
| 9b1d9c117e | |||
| f2b32b40a4 | |||
| 457e9e5e74 | |||
| 4b4aaae001 | |||
| 11369aedf8 | |||
| cc38e8f148 | |||
| b0c6bbb8f7 | |||
| 5399c9c7b9 | |||
| fe58c5c4d1 | |||
| a42aa75308 | |||
| a3b61d984d | |||
| c2f2f3a9af |
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"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",
|
||||
"doc",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Hydro11451",
|
||||
"name": "Hydrogen",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/214308559?v=4",
|
||||
"profile": "http://hydro11451.qzz.io",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "CreeperAWA",
|
||||
"name": "CreeperAWA",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/134939494?v=4",
|
||||
"profile": "https://github.com/CreeperAWA",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
|
||||
## Reproduction
|
||||
|
||||
|
||||
## Expected behavior
|
||||
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
||||
## Additional context
|
||||
@@ -0,0 +1,56 @@
|
||||
name: Bug 报告 | Bug Report
|
||||
description: 反馈软件缺陷或异常 | Report a bug to help us improve
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
感谢你的反馈!请详细填写以下内容,便于我们定位问题。
|
||||
Thank you for your feedback! Please fill out the following information to help us locate the issue.
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: 软件版本 | App Version
|
||||
description: 可在设置中的“关于”界面查看 | You can find it on the "About" interface in the settings
|
||||
placeholder: 例如 v1.2.3 | e.g. v1.2.3
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: os
|
||||
attributes:
|
||||
label: 操作系统及版本 | OS & Version
|
||||
placeholder: 例如 Windows 10 22H2 64位 | e.g. Windows 10 22H2 64bit
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: 问题描述 | Description
|
||||
description: 简要描述遇到的问题 | Briefly describe the problem
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: steps
|
||||
attributes:
|
||||
label: 复现步骤 | Steps to Reproduce
|
||||
description: 如何复现该问题?如有必要可附截图/录屏 | How to reproduce this bug? Screenshots/recordings if needed
|
||||
placeholder: |
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: 期望结果 | Expected Behavior
|
||||
description: 你期望的正确行为或结果 | What did you expect to happen?
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: extra
|
||||
attributes:
|
||||
label: 其他补充信息 | Additional Info
|
||||
description: 其他相关信息(如日志、配置、特殊环境等)| Any other context, logs, configs, special environment, etc.
|
||||
validations:
|
||||
required: false
|
||||
@@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Description
|
||||
@@ -0,0 +1,37 @@
|
||||
name: 功能请求 | Feature Request
|
||||
description: 提出你对本项目的功能建议 | Suggest an idea for this project
|
||||
labels: [enhancement]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
感谢你的建议!请详细描述你的需求。
|
||||
Thank you for your suggestion! Please describe your needs in detail.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: 功能描述 | Description
|
||||
description: 请描述你希望添加的功能 | Describe the feature you want
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: motivation
|
||||
attributes:
|
||||
label: 需求动机 | Motivation
|
||||
description: 为什么需要这个功能?| Why do you need this feature?
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: design
|
||||
attributes:
|
||||
label: 期望设计 | Expected Design
|
||||
description: (可选)描述或画出你期望的界面或交互 | (Optional) Describe or sketch the expected UI/UX
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: extra
|
||||
attributes:
|
||||
label: 其他补充信息 | Additional Info
|
||||
description: 其他补充说明或建议 | Any other context or suggestions
|
||||
validations:
|
||||
required: false
|
||||
@@ -1,3 +1,3 @@
|
||||
/Ink Canvas/obj
|
||||
/Ink Canvas/bin
|
||||
/.vs
|
||||
obj/
|
||||
bin/
|
||||
.vs
|
||||
@@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<attachedFolders>
|
||||
<Path>../../ICC CE main</Path>
|
||||
</attachedFolders>
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\",
|
||||
"WorkspaceRootPath": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\",
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
@@ -47,18 +47,210 @@
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 0,
|
||||
"DockedWidth": 210,
|
||||
"SelectedChildIndex": 48,
|
||||
"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",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "MW_FloatingBarIcons.cs",
|
||||
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
|
||||
"DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
|
||||
"RelativeDocumentMoniker": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
|
||||
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs*",
|
||||
"RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs*",
|
||||
"ViewState": "AgIAAFgHAAAAAAAAAAAgwGcHAAAIAAAAAAAAAA==",
|
||||
"ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
|
||||
"RelativeToolTip": "Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
|
||||
"ViewState": "AgIAAOgCAAAAAAAAAAAuwEoGAAAIAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-05-31T10:49:24.719Z",
|
||||
"EditorCaption": ""
|
||||
@@ -67,22 +259,21 @@
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"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",
|
||||
"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",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
|
||||
"WhenOpened": "2025-05-31T10:48:22.883Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2025-05-31T10:48:22.883Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 7,
|
||||
"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",
|
||||
"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",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
|
||||
"WhenOpened": "2025-05-24T13:22:56.715Z"
|
||||
@@ -103,9 +294,9 @@
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 6,
|
||||
"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",
|
||||
"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",
|
||||
"ViewState": "AgIAAFgAAAAAAAAAAAAUwHQAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
@@ -116,9 +307,9 @@
|
||||
"DocumentIndex": 8,
|
||||
"Title": "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",
|
||||
"RelativeToolTip": "..\\icc-0610.2.3\\README.md",
|
||||
"RelativeToolTip": "..\\..\\..\\..\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
|
||||
"WhenOpened": "2025-05-24T13:04:01.407Z"
|
||||
@@ -127,53 +318,77 @@
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"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",
|
||||
"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",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003109|",
|
||||
"WhenOpened": "2025-05-24T13:04:01.337Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2025-05-24T13:04:01.337Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 3,
|
||||
"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",
|
||||
"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",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
|
||||
"WhenOpened": "2025-05-24T13:04:00.986Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2025-05-24T13:04:00.986Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 4,
|
||||
"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",
|
||||
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE",
|
||||
"ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\LICENSE",
|
||||
"RelativeToolTip": "LICENSE",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
|
||||
"WhenOpened": "2025-05-24T13:04:00.902Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2025-05-24T13:04:00.902Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 5,
|
||||
"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",
|
||||
"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",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003464|",
|
||||
"WhenOpened": "2025-05-24T13:04:00.792Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2025-05-24T13:04:00.792Z"
|
||||
},
|
||||
{
|
||||
"$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}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\",
|
||||
"WorkspaceRootPath": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\",
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
"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}"
|
||||
},
|
||||
{
|
||||
@@ -47,18 +47,210 @@
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 0,
|
||||
"DockedWidth": 210,
|
||||
"SelectedChildIndex": 48,
|
||||
"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",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "MW_FloatingBarIcons.cs",
|
||||
"DocumentMoniker": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\Ink Canvas\\MainWindow_cs\\MW_FloatingBarIcons.cs",
|
||||
"DocumentMoniker": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\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",
|
||||
"ViewState": "AgIAAFgHAAAAAAAAAAAgwGcHAAAIAAAAAAAAAA==",
|
||||
"ViewState": "AgIAAOgCAAAAAAAAAAAuwEoGAAAIAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-05-31T10:49:24.719Z",
|
||||
"EditorCaption": ""
|
||||
@@ -67,22 +259,21 @@
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"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",
|
||||
"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",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
|
||||
"WhenOpened": "2025-05-31T10:48:22.883Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2025-05-31T10:48:22.883Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 7,
|
||||
"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",
|
||||
"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",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
|
||||
"WhenOpened": "2025-05-24T13:22:56.715Z"
|
||||
@@ -103,9 +294,9 @@
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 6,
|
||||
"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",
|
||||
"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",
|
||||
"ViewState": "AgIAAFgAAAAAAAAAAAAUwHQAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
@@ -116,9 +307,9 @@
|
||||
"DocumentIndex": 8,
|
||||
"Title": "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",
|
||||
"RelativeToolTip": "..\\icc-0610.2.3\\README.md",
|
||||
"RelativeToolTip": "..\\..\\..\\..\\Administrator\\Desktop\\ICC CE\\icc-0610.2.3\\README.md",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
|
||||
"WhenOpened": "2025-05-24T13:04:01.407Z"
|
||||
@@ -127,53 +318,77 @@
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"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",
|
||||
"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",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003109|",
|
||||
"WhenOpened": "2025-05-24T13:04:01.337Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2025-05-24T13:04:01.337Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 3,
|
||||
"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",
|
||||
"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",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001818|",
|
||||
"WhenOpened": "2025-05-24T13:04:00.986Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2025-05-24T13:04:00.986Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 4,
|
||||
"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",
|
||||
"ToolTip": "C:\\Users\\Administrator\\Desktop\\ICC CE\\ICC CE 1.2.5\\LICENSE",
|
||||
"ToolTip": "C:\\Users\\dubi906w\\source\\repos\\icc-ce\\LICENSE",
|
||||
"RelativeToolTip": "LICENSE",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
|
||||
"WhenOpened": "2025-05-24T13:04:00.902Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2025-05-24T13:04:00.902Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 5,
|
||||
"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",
|
||||
"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",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003464|",
|
||||
"WhenOpened": "2025-05-24T13:04:00.792Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2025-05-24T13:04:00.792Z"
|
||||
},
|
||||
{
|
||||
"$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}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"ExpandedNodes": [
|
||||
""
|
||||
],
|
||||
"SelectedNode": "\\Ink Canvas.sln",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
5.0.1
|
||||
1.7.1.0
|
||||
|
||||
|
After Width: | Height: | Size: 550 KiB |
|
Before Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 1.7 MiB |
@@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
@@ -49,5 +49,5 @@ using System.Windows;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("5.0.2.0")]
|
||||
[assembly: AssemblyFileVersion("5.0.2.0")]
|
||||
[assembly: AssemblyVersion("1.7.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.7.1.0")]
|
||||
|
||||
@@ -8,40 +8,80 @@ using System.Windows;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Controls;
|
||||
using System.IO.Compression;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ink_Canvas.Helpers
|
||||
{
|
||||
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
|
||||
{
|
||||
string localVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Local version: {localVersion}");
|
||||
|
||||
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/main/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);
|
||||
|
||||
// 如果主地址失败,尝试备用地址
|
||||
if (remoteVersion == null)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Primary URL failed, trying fallback URL");
|
||||
remoteVersion = await GetRemoteVersion(proxy + fallbackUrl);
|
||||
}
|
||||
|
||||
if (remoteVersion != null)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Remote version: {remoteVersion}");
|
||||
Version local = new Version(localVersion);
|
||||
Version remote = new Version(remoteVersion);
|
||||
if (remote > local)
|
||||
{
|
||||
LogHelper.WriteLogToFile("AutoUpdate | New version Availble: " + remoteVersion);
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | New version available: {remoteVersion}");
|
||||
return remoteVersion;
|
||||
}
|
||||
else return null;
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Current version is up to date");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"AutoUpdate | Error: {ex.Message}");
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Error in CheckForUpdates: {ex.Message}", LogHelper.LogType.Error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -52,15 +92,72 @@ namespace Ink_Canvas.Helpers
|
||||
{
|
||||
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();
|
||||
|
||||
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)
|
||||
{
|
||||
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);
|
||||
@@ -70,10 +167,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;
|
||||
|
||||
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
|
||||
{
|
||||
@@ -85,49 +182,214 @@ namespace Ink_Canvas.Helpers
|
||||
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);
|
||||
await DownloadFile(downloadUrl, $"{updatesFolderPath}\\Ink.Canvas.Annotation.V{version}.Setup.exe");
|
||||
SaveDownloadStatus(true);
|
||||
|
||||
LogHelper.WriteLogToFile("AutoUpdate | Setup file successfully downloaded.");
|
||||
return true;
|
||||
string zipFilePath = Path.Combine(updatesFolderPath, $"InkCanvasForClass.CE.{version}.zip");
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Target file path: {zipFilePath}");
|
||||
|
||||
// 先尝试主地址下载
|
||||
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)
|
||||
{
|
||||
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);
|
||||
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())
|
||||
{
|
||||
try
|
||||
{
|
||||
HttpResponseMessage response = await client.GetAsync(fileUrl);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
using (FileStream fileStream = File.Create(destinationPath))
|
||||
// Configure client
|
||||
client.Timeout = TimeSpan.FromMinutes(5); // 下载文件需要更长的超时时间
|
||||
client.DefaultRequestHeaders.Add("User-Agent", "ICC-CE Auto Updater");
|
||||
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Downloading from: {fileUrl}");
|
||||
|
||||
// 创建临时文件路径
|
||||
string tempFilePath = destinationPath + ".tmp";
|
||||
|
||||
// 确保目标目录存在
|
||||
string directory = Path.GetDirectoryName(destinationPath);
|
||||
if (!Directory.Exists(directory))
|
||||
{
|
||||
await response.Content.CopyToAsync(fileStream);
|
||||
fileStream.Close();
|
||||
Directory.CreateDirectory(directory);
|
||||
}
|
||||
|
||||
// 使用带超时的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)
|
||||
{
|
||||
Console.WriteLine($"AutoUpdate | HTTP request error: {ex.Message}");
|
||||
throw;
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | HTTP request error: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
catch (TaskCanceledException ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Download timed out: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"AutoUpdate | Error: {ex.Message}");
|
||||
throw;
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Error downloading file: {ex.Message}", LogHelper.LogType.Error);
|
||||
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,66 +417,437 @@ namespace Ink_Canvas.Helpers
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
string InstallCommand = $"\"{setupFilePath}\" /SILENT";
|
||||
if (isInSilence) InstallCommand += " /VERYSILENT";
|
||||
ExecuteCommandLine(InstallCommand);
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
// Verify ZIP file size and validity
|
||||
FileInfo fileInfo = new FileInfo(zipFilePath);
|
||||
if (fileInfo.Length == 0)
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
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 installing update: {ex.Message}", LogHelper.LogType.Error);
|
||||
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 void ExecuteCommandLine(string command)
|
||||
private static async Task<long> GetUrlDelay(string url)
|
||||
{
|
||||
try
|
||||
{
|
||||
ProcessStartInfo processStartInfo = new ProcessStartInfo
|
||||
using (var client = new System.Net.Http.HttpClient())
|
||||
{
|
||||
FileName = "cmd.exe",
|
||||
Arguments = $"/c {command}",
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true,
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true
|
||||
};
|
||||
|
||||
using (Process process = new Process { StartInfo = processStartInfo })
|
||||
{
|
||||
process.Start();
|
||||
Application.Current.Shutdown();
|
||||
/*process.WaitForExit();
|
||||
int exitCode = process.ExitCode;*/
|
||||
client.Timeout = TimeSpan.FromSeconds(5);
|
||||
var sw = System.Diagnostics.Stopwatch.StartNew();
|
||||
var resp = await client.SendAsync(new System.Net.Http.HttpRequestMessage(System.Net.Http.HttpMethod.Head, url));
|
||||
sw.Stop();
|
||||
if (resp.IsSuccessStatusCode)
|
||||
return sw.ElapsedMilliseconds;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 线路组结构体(包含版本、下载、日志地址)
|
||||
public class UpdateLineGroup
|
||||
{
|
||||
public string GroupName { get; set; } // 组名
|
||||
public string VersionUrl { get; set; } // 版本检测地址
|
||||
public string DownloadUrlFormat { get; set; } // 下载地址格式(带{0}占位符)
|
||||
public string LogUrl { get; set; } // 更新日志地址
|
||||
}
|
||||
|
||||
// 通道-线路组映射
|
||||
private static readonly Dictionary<UpdateChannel, List<UpdateLineGroup>> ChannelLineGroups = new Dictionary<UpdateChannel, List<UpdateLineGroup>>
|
||||
{
|
||||
{ UpdateChannel.Release, new List<UpdateLineGroup>
|
||||
{
|
||||
new UpdateLineGroup
|
||||
{
|
||||
GroupName = "GitHub主线",
|
||||
VersionUrl = "https://github.com/InkCanvasForClass/community/raw/refs/heads/beta/AutomaticUpdateVersionControl.txt",
|
||||
DownloadUrlFormat = "https://github.com/InkCanvasForClass/community/releases/download/{0}/InkCanvasForClass.CE.{0}.zip",
|
||||
LogUrl = "https://github.com/InkCanvasForClass/community/raw/refs/heads/beta/UpdateLog.md"
|
||||
},
|
||||
new UpdateLineGroup
|
||||
{
|
||||
GroupName = "bgithub备用",
|
||||
VersionUrl = "https://bgithub.xyz/InkCanvasForClass/community/raw/refs/heads/main/AutomaticUpdateVersionControl.txt",
|
||||
DownloadUrlFormat = "https://bgithub.xyz/InkCanvasForClass/community/releases/download/{0}/InkCanvasForClass.CE.{0}.zip",
|
||||
LogUrl = "https://bgithub.xyz/InkCanvasForClass/community/raw/refs/heads/main/UpdateLog.md"
|
||||
},
|
||||
new UpdateLineGroup
|
||||
{
|
||||
GroupName = "kkgithub线路",
|
||||
VersionUrl = "https://kkgithub.com/InkCanvasForClass/community/raw/refs/heads/beta/AutomaticUpdateVersionControl.txt",
|
||||
DownloadUrlFormat = "https://kkgithub.com/InkCanvasForClass/community/releases/download/{0}/InkCanvasForClass.CE.{0}.zip",
|
||||
LogUrl = "https://kkgithub.com/InkCanvasForClass/community/raw/refs/heads/beta/UpdateLog.md"
|
||||
}
|
||||
}
|
||||
},
|
||||
{ UpdateChannel.Beta, new List<UpdateLineGroup>
|
||||
{
|
||||
new UpdateLineGroup
|
||||
{
|
||||
GroupName = "GitHub主线",
|
||||
VersionUrl = "https://github.com/InkCanvasForClass/community-beta/raw/refs/heads/main/AutomaticUpdateVersionControl.txt",
|
||||
DownloadUrlFormat = "https://github.com/InkCanvasForClass/community-beta/releases/download/{0}/InkCanvasForClass.CE.{0}.zip",
|
||||
LogUrl = "https://github.com/InkCanvasForClass/community-beta/raw/refs/heads/main/UpdateLog.md"
|
||||
},
|
||||
new UpdateLineGroup
|
||||
{
|
||||
GroupName = "bgithub备用",
|
||||
VersionUrl = "https://bgithub.xyz/InkCanvasForClass/community-beta/raw/refs/heads/main/AutomaticUpdateVersionControl.txt",
|
||||
DownloadUrlFormat = "https://bgithub.xyz/InkCanvasForClass/community-beta/releases/download/{0}/InkCanvasForClass.CE.{0}.zip",
|
||||
LogUrl = "https://bgithub.xyz/InkCanvasForClass/community-beta/raw/refs/heads/main/UpdateLog.md"
|
||||
},
|
||||
new UpdateLineGroup
|
||||
{
|
||||
GroupName = "kkgithub线路",
|
||||
VersionUrl = "https://kkgithub.com/InkCanvasForClass/community-beta/raw/refs/heads/main/AutomaticUpdateVersionControl.txt",
|
||||
DownloadUrlFormat = "https://kkgithub.com/InkCanvasForClass/community-beta/releases/download/{0}/InkCanvasForClass.CE.{0}.zip",
|
||||
LogUrl = "https://kkgithub.com/InkCanvasForClass/community-beta/raw/refs/heads/main/UpdateLog.md"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 检测线路组延迟,只检测当前通道下的所有线路组,返回最快组
|
||||
private static async Task<UpdateLineGroup> GetFastestLineGroup(UpdateChannel channel)
|
||||
{
|
||||
var groups = ChannelLineGroups[channel];
|
||||
long minDelay = long.MaxValue;
|
||||
UpdateLineGroup bestGroup = null;
|
||||
foreach (var group in groups)
|
||||
{
|
||||
var delay = await GetUrlDelay(group.VersionUrl);
|
||||
if (delay >= 0 && delay < minDelay)
|
||||
{
|
||||
minDelay = delay;
|
||||
bestGroup = group;
|
||||
}
|
||||
}
|
||||
return bestGroup;
|
||||
}
|
||||
|
||||
// 新的自动选择线路组的更新检测方法,返回远程版本号和所用线路组
|
||||
public static async Task<(string remoteVersion, UpdateLineGroup lineGroup)> CheckForUpdatesWithAutoLine(UpdateChannel channel = UpdateChannel.Release, bool alwaysGetRemote = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
string localVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Local version: {localVersion}");
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | 检测通道 {channel} 下最快线路组...");
|
||||
var bestGroup = await GetFastestLineGroup(channel);
|
||||
if (bestGroup == null)
|
||||
{
|
||||
LogHelper.WriteLogToFile("AutoUpdate | 所有线路组均不可用", LogHelper.LogType.Error);
|
||||
return (null, null);
|
||||
}
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | 选择最快线路组: {bestGroup.GroupName} {bestGroup.VersionUrl}");
|
||||
string remoteVersion = await GetRemoteVersion(bestGroup.VersionUrl);
|
||||
if (remoteVersion != null)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Remote version: {remoteVersion}");
|
||||
Version local = new Version(localVersion);
|
||||
Version remote = new Version(remoteVersion);
|
||||
if (remote > local || alwaysGetRemote)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | New version available or alwaysGetRemote: {remoteVersion}");
|
||||
return (remoteVersion, bestGroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Current version is up to date");
|
||||
return (null, bestGroup);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogToFile("AutoUpdate | 获取远程版本失败", LogHelper.LogType.Error);
|
||||
return (null, bestGroup);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Error in CheckForUpdatesWithAutoLine: {ex.Message}", LogHelper.LogType.Error);
|
||||
return (null, null);
|
||||
}
|
||||
}
|
||||
|
||||
// 使用指定线路组下载新版
|
||||
public static async Task<bool> DownloadSetupFileWithLineGroup(string version, UpdateLineGroup group)
|
||||
{
|
||||
try
|
||||
{
|
||||
string url = string.Format(group.DownloadUrlFormat, version);
|
||||
string zipFilePath = Path.Combine(updatesFolderPath, $"InkCanvasForClass.CE.{version}.zip");
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Downloading from: {url}");
|
||||
return await DownloadFile(url, zipFilePath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Error in DownloadSetupFileWithLineGroup: {ex.Message}", LogHelper.LogType.Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 使用指定线路组获取更新日志
|
||||
public static async Task<string> GetUpdateLogWithLineGroup(UpdateLineGroup group)
|
||||
{
|
||||
return await AutoUpdateHelper.GetRemoteContent(group.LogUrl);
|
||||
}
|
||||
|
||||
// 获取远程内容的通用方法(public 以便线路组方法调用)
|
||||
public 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}");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// 兼容旧接口:获取更新日志(自动选择最快线路组)
|
||||
public static async Task<string> GetUpdateLog(UpdateChannel channel = UpdateChannel.Release)
|
||||
{
|
||||
var group = await GetFastestLineGroup(channel);
|
||||
if (group == null) return "# 无法获取更新日志\n\n所有线路均不可用。";
|
||||
return await GetUpdateLogWithLineGroup(group);
|
||||
}
|
||||
|
||||
// 兼容旧接口:删除更新文件夹
|
||||
public static void DeleteUpdatesFolder()
|
||||
{
|
||||
try
|
||||
{
|
||||
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); } catch { }
|
||||
}
|
||||
foreach (string dir in Directory.GetDirectories(updatesFolderPath))
|
||||
{
|
||||
try { Directory.Delete(dir, true); } catch { }
|
||||
}
|
||||
try { Directory.Delete(updatesFolderPath, true); } catch { }
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
// 兼容旧接口:版本修复方法,强制下载并安装指定通道的最新版本
|
||||
public static async Task<bool> FixVersion(UpdateChannel channel = UpdateChannel.Release)
|
||||
{
|
||||
try
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Starting version fix for {channel} channel");
|
||||
// 获取远程版本号(自动选择最快线路组,始终下载远程版本)
|
||||
var (remoteVersion, group) = await CheckForUpdatesWithAutoLine(channel, true);
|
||||
if (string.IsNullOrEmpty(remoteVersion) || group == null)
|
||||
{
|
||||
LogHelper.WriteLogToFile("AutoUpdate | Failed to retrieve remote version for fixing", LogHelper.LogType.Error);
|
||||
return false;
|
||||
}
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Remote version for fixing: {remoteVersion}");
|
||||
// 无论版本是否为最新,都下载远程版本
|
||||
bool downloadResult = await DownloadSetupFileWithLineGroup(remoteVersion, group);
|
||||
if (!downloadResult)
|
||||
{
|
||||
LogHelper.WriteLogToFile("AutoUpdate | Failed to download update for fixing", LogHelper.LogType.Error);
|
||||
return false;
|
||||
}
|
||||
// 执行安装,非静默模式
|
||||
InstallNewVersionApp(remoteVersion, false);
|
||||
App.IsAppExitByUser = true;
|
||||
Application.Current.Dispatcher.Invoke(() => {
|
||||
Application.Current.Shutdown();
|
||||
});
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate clearing| Error deleting updates folder: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Error in FixVersion: {ex.Message}", LogHelper.LogType.Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -256,3 +889,4 @@ namespace Ink_Canvas.Helpers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,4 @@
|
||||
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.CompilerServices;
|
||||
|
||||
|
||||
@@ -23,6 +23,44 @@ namespace Ink_Canvas.Helpers
|
||||
[DllImport("user32.dll")]
|
||||
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)]
|
||||
public struct RECT {
|
||||
public int Left;
|
||||
@@ -34,6 +72,72 @@ namespace Ink_Canvas.Helpers
|
||||
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() {
|
||||
IntPtr foregroundWindowHandle = GetForegroundWindow();
|
||||
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace Ink_Canvas.Helpers
|
||||
{
|
||||
class LogHelper
|
||||
{
|
||||
public static string LogFile = "Log.txt";
|
||||
private static string LogsFolder = "Logs";
|
||||
private static string AppStartTime = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
|
||||
private static readonly long MaxLogsFolderSizeBytes = 5 * 1024 * 1024; // 5MB
|
||||
|
||||
public static void NewLog(string str)
|
||||
{
|
||||
@@ -14,41 +19,115 @@ namespace Ink_Canvas.Helpers
|
||||
|
||||
public static void NewLog(Exception ex)
|
||||
{
|
||||
|
||||
if (ex == null) return;
|
||||
var stackTrace = ex.StackTrace ?? "<no stack trace>";
|
||||
var msg = $"[Exception] Type: {ex.GetType().FullName}\nMessage: {ex.Message}\nStackTrace: {stackTrace}";
|
||||
if (ex.InnerException != null)
|
||||
{
|
||||
msg += $"\nInnerException: {ex.InnerException.GetType().FullName} - {ex.InnerException.Message}\n{ex.InnerException.StackTrace}";
|
||||
}
|
||||
WriteLogToFile(msg, LogType.Error);
|
||||
}
|
||||
|
||||
public static void WriteLogToFile(string str, LogType logType = LogType.Info)
|
||||
{
|
||||
string strLogType = "Info";
|
||||
switch (logType)
|
||||
{
|
||||
case LogType.Event:
|
||||
strLogType = "Event";
|
||||
break;
|
||||
case LogType.Trace:
|
||||
strLogType = "Trace";
|
||||
break;
|
||||
case LogType.Error:
|
||||
strLogType = "Error";
|
||||
break;
|
||||
}
|
||||
// 检查日志是否启用
|
||||
if (MainWindow.Settings != null && MainWindow.Settings.Advanced != null && !MainWindow.Settings.Advanced.IsLogEnabled) return;
|
||||
|
||||
string strLogType = logType.ToString();
|
||||
try
|
||||
{
|
||||
var file = App.RootPath + LogFile;
|
||||
string file;
|
||||
|
||||
// 检查是否启用了日期保存功能
|
||||
if (MainWindow.Settings != null && MainWindow.Settings.Advanced != null && MainWindow.Settings.Advanced.IsSaveLogByDate)
|
||||
{
|
||||
// 确保Logs文件夹存在
|
||||
string logsPath = Path.Combine(App.RootPath, LogsFolder);
|
||||
if (!Directory.Exists(logsPath))
|
||||
{
|
||||
Directory.CreateDirectory(logsPath);
|
||||
}
|
||||
|
||||
// 检查Logs文件夹大小,如果超过5MB则清空
|
||||
CheckAndCleanLogsFolder(logsPath);
|
||||
|
||||
// 使用软件启动时间作为日志文件名
|
||||
file = Path.Combine(logsPath, $"Log_{AppStartTime}.txt");
|
||||
}
|
||||
else
|
||||
{
|
||||
file = App.RootPath + LogFile;
|
||||
}
|
||||
|
||||
if (!Directory.Exists(App.RootPath))
|
||||
{
|
||||
Directory.CreateDirectory(App.RootPath);
|
||||
}
|
||||
StreamWriter sw = new StreamWriter(file, true);
|
||||
sw.WriteLine(string.Format("{0} [{1}] {2}", DateTime.Now.ToString("O"), strLogType, str));
|
||||
sw.Close();
|
||||
|
||||
var threadId = Thread.CurrentThread.ManagedThreadId;
|
||||
var callingMethod = new StackTrace(2, true).GetFrame(0);
|
||||
string callerInfo = "<unknown>";
|
||||
if (callingMethod != null)
|
||||
{
|
||||
var method = callingMethod.GetMethod();
|
||||
if (method != null)
|
||||
{
|
||||
var className = method.DeclaringType != null ? method.DeclaringType.FullName : "<no class>";
|
||||
callerInfo = $"{className}.{method.Name}";
|
||||
}
|
||||
}
|
||||
string logLine = string.Format("{0} [T{1}] [{2}] [{3}] {4}", DateTime.Now.ToString("O"), threadId, strLogType, callerInfo, str);
|
||||
using (StreamWriter sw = new StreamWriter(file, true))
|
||||
{
|
||||
sw.WriteLine(logLine);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private static void CheckAndCleanLogsFolder(string logsPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
long totalSize = 0;
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(logsPath);
|
||||
|
||||
// 如果目录不存在,直接返回
|
||||
if (!dirInfo.Exists) return;
|
||||
|
||||
// 计算文件夹大小
|
||||
foreach (FileInfo file in dirInfo.GetFiles())
|
||||
{
|
||||
totalSize += file.Length;
|
||||
}
|
||||
|
||||
// 如果超过5MB,清空文件夹
|
||||
if (totalSize > MaxLogsFolderSizeBytes)
|
||||
{
|
||||
foreach (FileInfo file in dirInfo.GetFiles())
|
||||
{
|
||||
try
|
||||
{
|
||||
file.Delete();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
// 记录清理操作
|
||||
string cleanupMessage = $"Logs folder exceeded size limit ({totalSize / 1024.0 / 1024.0:F2} MB > {MaxLogsFolderSizeBytes / 1024.0 / 1024.0:F2} MB). Folder cleaned.";
|
||||
using (StreamWriter sw = new StreamWriter(Path.Combine(logsPath, $"Log_{AppStartTime}.txt"), true))
|
||||
{
|
||||
sw.WriteLine($"{DateTime.Now:O} [Cleanup] {cleanupMessage}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
internal static void WriteLogToFile(string v, object warning)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
WriteLogToFile($"[Warning] {v}", LogType.Warning);
|
||||
}
|
||||
|
||||
public enum LogType
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// 启动台按钮控件
|
||||
/// </summary>
|
||||
public class LauncherButton
|
||||
{
|
||||
/// <summary>
|
||||
/// 父插件
|
||||
/// </summary>
|
||||
private readonly SuperLauncherPlugin _plugin;
|
||||
|
||||
/// <summary>
|
||||
/// 实际按钮控件
|
||||
/// </summary>
|
||||
private readonly SimpleStackPanel _panel;
|
||||
|
||||
/// <summary>
|
||||
/// 获取按钮UI元素
|
||||
/// </summary>
|
||||
public UIElement Element => _panel;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="plugin">父插件</param>
|
||||
public LauncherButton(SuperLauncherPlugin plugin)
|
||||
{
|
||||
try
|
||||
{
|
||||
_plugin = plugin;
|
||||
LogHelper.WriteLogToFile("开始创建启动台按钮", LogHelper.LogType.Info);
|
||||
|
||||
// 创建SimpleStackPanel
|
||||
_panel = new SimpleStackPanel
|
||||
{
|
||||
Name = "Launcher_Icon",
|
||||
Orientation = Orientation.Vertical,
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
Width = 28,
|
||||
Margin = new Thickness(0, -2, 0, 0),
|
||||
Background = Brushes.Transparent
|
||||
};
|
||||
|
||||
LogHelper.WriteLogToFile("创建SimpleStackPanel完成", LogHelper.LogType.Info);
|
||||
|
||||
// 添加图标
|
||||
var image = CreateIconImage();
|
||||
_panel.Children.Add(image);
|
||||
|
||||
// 添加文本
|
||||
TextBlock textBlock = new TextBlock
|
||||
{
|
||||
Text = "启动台",
|
||||
Foreground = Brushes.Black,
|
||||
FontSize = 8,
|
||||
Margin = new Thickness(0, 1, 0, 0),
|
||||
TextAlignment = TextAlignment.Center
|
||||
};
|
||||
_panel.Children.Add(textBlock);
|
||||
|
||||
// 设置鼠标事件
|
||||
_panel.MouseDown += Panel_MouseDown;
|
||||
_panel.MouseUp += Panel_MouseUp;
|
||||
_panel.MouseLeave += Panel_MouseLeave;
|
||||
|
||||
// 右键菜单支持
|
||||
_panel.ContextMenu = CreateContextMenu();
|
||||
|
||||
// 设置工具提示
|
||||
_panel.ToolTip = "启动台";
|
||||
|
||||
LogHelper.WriteLogToFile("启动台按钮创建完成", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"创建启动台按钮时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.NewLog(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建右键菜单
|
||||
/// </summary>
|
||||
private ContextMenu CreateContextMenu()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 创建菜单
|
||||
ContextMenu menu = new ContextMenu();
|
||||
|
||||
// 创建位置切换菜单项
|
||||
MenuItem positionMenuItem = new MenuItem();
|
||||
positionMenuItem.Header = _plugin.Config.ButtonPosition == LauncherButtonPosition.Left ?
|
||||
"移至右侧" : "移至左侧";
|
||||
positionMenuItem.Click += (s, e) =>
|
||||
{
|
||||
// 切换位置
|
||||
_plugin.Config.ButtonPosition = _plugin.Config.ButtonPosition == LauncherButtonPosition.Left ?
|
||||
LauncherButtonPosition.Right : LauncherButtonPosition.Left;
|
||||
|
||||
// 更新按钮位置
|
||||
_plugin.UpdateButtonPosition();
|
||||
|
||||
// 保存配置
|
||||
_plugin.SaveConfig();
|
||||
|
||||
LogHelper.WriteLogToFile($"通过右键菜单切换启动台按钮位置为: {_plugin.Config.ButtonPosition}",
|
||||
LogHelper.LogType.Info);
|
||||
};
|
||||
menu.Items.Add(positionMenuItem);
|
||||
|
||||
// 添加设置菜单项
|
||||
MenuItem settingsMenuItem = new MenuItem();
|
||||
settingsMenuItem.Header = "打开设置";
|
||||
settingsMenuItem.Click += (s, e) =>
|
||||
{
|
||||
// 打开插件设置窗口
|
||||
var mainWindow = Application.Current.MainWindow;
|
||||
if (mainWindow != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 使用反射调用主窗口的ShowPluginSettings方法
|
||||
var method = mainWindow.GetType().GetMethod("ShowPluginSettings");
|
||||
if (method != null)
|
||||
{
|
||||
method.Invoke(mainWindow, null);
|
||||
LogHelper.WriteLogToFile("已打开插件设置窗口", LogHelper.LogType.Info);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"打开插件设置窗口失败: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
};
|
||||
menu.Items.Add(settingsMenuItem);
|
||||
|
||||
return menu;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"创建右键菜单时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取实际的UI元素
|
||||
/// </summary>
|
||||
[Obsolete("使用Element属性代替")]
|
||||
public UIElement GetUIElement()
|
||||
{
|
||||
return _panel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建图标图像
|
||||
/// </summary>
|
||||
private Image CreateIconImage()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 创建图像
|
||||
Image image = new Image
|
||||
{
|
||||
Height = 17,
|
||||
Margin = new Thickness(0, 3, 0, 0)
|
||||
};
|
||||
|
||||
// 设置位图缩放模式
|
||||
RenderOptions.SetBitmapScalingMode(image, BitmapScalingMode.HighQuality);
|
||||
|
||||
// 创建绘图图像
|
||||
DrawingImage drawingImage = new DrawingImage();
|
||||
DrawingGroup drawingGroup = new DrawingGroup();
|
||||
drawingGroup.ClipGeometry = Geometry.Parse("M0,0 V24 H24 V0 H0 Z");
|
||||
|
||||
// 使用提供的应用网格图标
|
||||
GeometryDrawing geometryDrawing = new GeometryDrawing
|
||||
{
|
||||
Brush = new SolidColorBrush(Color.FromRgb(0x1B, 0x1B, 0x1B)),
|
||||
Geometry = Geometry.Parse("F0 M24,24z M0,0z M4.41721,4.29873C4.35178,4.29873,4.29873,4.35178,4.29873,4.41721L4.29873,9.15646C4.29873,9.22189,4.35178,9.27494,4.41721,9.27494L9.15646,9.27494C9.22189,9.27494,9.27494,9.22189,9.27494,9.15646L9.27494,4.41721C9.27494,4.35178,9.22189,4.29873,9.15646,4.29873L4.41721,4.29873z M2.64,4.41721C2.64,3.43569,3.43569,2.64,4.41721,2.64L9.15646,2.64C10.138,2.64,10.9337,3.43569,10.9337,4.41721L10.9337,9.15646C10.9337,10.138,10.138,10.9337,9.15646,10.9337L4.41721,10.9337C3.43569,10.9337,2.64,10.138,2.64,9.15646L2.64,4.41721z M14.8435,4.29873C14.7781,4.29873,14.7251,4.35178,14.7251,4.41721L14.7251,9.15646C14.7251,9.22189,14.7781,9.27494,14.8435,9.27494L19.5828,9.27494C19.6482,9.27494,19.7013,9.22189,19.7013,9.15646L19.7013,4.41721C19.7013,4.35178,19.6482,4.29873,19.5828,4.29873L14.8435,4.29873z M13.0663,4.41721C13.0663,3.43569,13.862,2.64,14.8435,2.64L19.5828,2.64C20.5643,2.64,21.36,3.43569,21.36,4.41721L21.36,9.15646C21.36,10.138,20.5643,10.9337,19.5828,10.9337L14.8435,10.9337C13.862,10.9337,13.0663,10.138,13.0663,9.15646L13.0663,4.41721z M14.8435,14.7251C14.7781,14.7251,14.7251,14.7781,14.7251,14.8435L14.7251,19.5828C14.7251,19.6482,14.7781,19.7013,14.8435,19.7013L19.5828,19.7013C19.6482,19.7013,19.7013,19.6482,19.7013,19.5828L19.7013,14.8435C19.7013,14.7781,19.6482,14.7251,19.5828,14.7251L14.8435,14.7251z M13.0663,14.8435C13.0663,13.862,13.862,13.0663,14.8435,13.0663L19.5828,13.0663C20.5643,13.0663,21.36,13.862,21.36,14.8435L21.36,19.5828C21.36,20.5643,20.5643,21.36,19.5828,21.36L14.8435,21.36C13.862,21.36,13.0663,20.5643,13.0663,19.5828L13.0663,14.8435z M4.41721,14.7251C4.35178,14.7251,4.29873,14.7781,4.29873,14.8435L4.29873,19.5828C4.29873,19.6482,4.35178,19.7013,4.41721,19.7013L9.15646,19.7013C9.22189,19.7013,9.27494,19.6482,9.27494,19.5828L9.27494,14.8435C9.27494,14.7781,9.22189,14.7251,9.15646,14.7251L4.41721,14.7251z M2.64,14.8435C2.64,13.862,3.43569,13.0663,4.41721,13.0663L9.15646,13.0663C10.138,13.0663,10.9337,13.862,10.9337,14.8435L10.9337,19.5828C10.9337,20.5643,10.138,21.36,9.15646,21.36L4.41721,21.36C3.43569,21.36,2.64,20.5643,2.64,19.5828L2.64,14.8435z")
|
||||
};
|
||||
|
||||
drawingGroup.Children.Add(geometryDrawing);
|
||||
|
||||
// 设置图像源
|
||||
drawingImage.Drawing = drawingGroup;
|
||||
image.Source = drawingImage;
|
||||
|
||||
return image;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"创建图标图像时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.NewLog(ex);
|
||||
|
||||
// 返回一个空图像
|
||||
return new Image();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标按下事件
|
||||
/// </summary>
|
||||
private void Panel_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 提供反馈
|
||||
_panel.Background = new SolidColorBrush(Color.FromArgb(40, 0, 0, 0));
|
||||
LogHelper.WriteLogToFile("启动台按钮鼠标按下", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"启动台按钮鼠标按下事件出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标抬起事件
|
||||
/// </summary>
|
||||
private void Panel_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 只有左键点击才显示启动台窗口
|
||||
if (e.ChangedButton != MouseButton.Left)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 恢复背景
|
||||
_panel.Background = Brushes.Transparent;
|
||||
LogHelper.WriteLogToFile("启动台按钮鼠标抬起,准备显示启动台窗口", LogHelper.LogType.Info);
|
||||
|
||||
// 获取按钮在屏幕上的位置
|
||||
Point buttonPosition = _panel.PointToScreen(new Point(_panel.ActualWidth / 2, 0));
|
||||
|
||||
// 显示启动台窗口
|
||||
_plugin.ShowLauncherWindow(buttonPosition);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"启动台按钮鼠标抬起事件出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.NewLog(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标离开事件
|
||||
/// </summary>
|
||||
private void Panel_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 恢复背景
|
||||
_panel.Background = Brushes.Transparent;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"启动台按钮鼠标离开事件出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// 启动台按钮位置
|
||||
/// </summary>
|
||||
public enum LauncherButtonPosition
|
||||
{
|
||||
/// <summary>
|
||||
/// 左侧
|
||||
/// </summary>
|
||||
Left,
|
||||
|
||||
/// <summary>
|
||||
/// 右侧
|
||||
/// </summary>
|
||||
Right
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启动台配置
|
||||
/// </summary>
|
||||
public class LauncherConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 启动台按钮位置
|
||||
/// </summary>
|
||||
public LauncherButtonPosition ButtonPosition { get; set; } = LauncherButtonPosition.Right;
|
||||
|
||||
/// <summary>
|
||||
/// 启动台应用程序列表
|
||||
/// </summary>
|
||||
public List<LauncherItem> Items { get; set; } = new List<LauncherItem>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启动台应用项
|
||||
/// </summary>
|
||||
public class LauncherItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用程序名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 应用程序路径
|
||||
/// </summary>
|
||||
public string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否可见
|
||||
/// </summary>
|
||||
public bool IsVisible { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 在启动台中的位置(0-39)
|
||||
/// </summary>
|
||||
public int Position { get; set; } = -1;
|
||||
|
||||
/// <summary>
|
||||
/// 是否已固定位置
|
||||
/// </summary>
|
||||
public bool IsPositionFixed { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 图标缓存
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
private ImageSource _iconCache;
|
||||
|
||||
/// <summary>
|
||||
/// 获取应用程序图标
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
public ImageSource Icon
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_iconCache != null)
|
||||
{
|
||||
return _iconCache;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (File.Exists(Path))
|
||||
{
|
||||
// 从文件中获取图标
|
||||
Icon icon = System.Drawing.Icon.ExtractAssociatedIcon(Path);
|
||||
if (icon != null)
|
||||
{
|
||||
_iconCache = Imaging.CreateBitmapSourceFromHIcon(
|
||||
icon.Handle,
|
||||
Int32Rect.Empty,
|
||||
BitmapSizeOptions.FromEmptyOptions());
|
||||
|
||||
icon.Dispose();
|
||||
return _iconCache;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 从注册表中获取文件类型关联图标
|
||||
string extension = System.IO.Path.GetExtension(Path);
|
||||
if (!string.IsNullOrEmpty(extension))
|
||||
{
|
||||
string fileType = Registry.ClassesRoot.OpenSubKey(extension)?.GetValue(string.Empty) as string;
|
||||
if (!string.IsNullOrEmpty(fileType))
|
||||
{
|
||||
string iconPath = Registry.ClassesRoot.OpenSubKey(fileType + "\\DefaultIcon")?.GetValue(string.Empty) as string;
|
||||
if (!string.IsNullOrEmpty(iconPath))
|
||||
{
|
||||
string[] parts = iconPath.Split(',');
|
||||
string iconFile = parts[0].Trim('"');
|
||||
int iconIndex = parts.Length > 1 ? Convert.ToInt32(parts[1]) : 0;
|
||||
|
||||
if (File.Exists(iconFile))
|
||||
{
|
||||
Icon icon = IconExtractor.Extract(iconFile, iconIndex, true);
|
||||
if (icon != null)
|
||||
{
|
||||
_iconCache = Imaging.CreateBitmapSourceFromHIcon(
|
||||
icon.Handle,
|
||||
Int32Rect.Empty,
|
||||
BitmapSizeOptions.FromEmptyOptions());
|
||||
|
||||
icon.Dispose();
|
||||
return _iconCache;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"获取应用图标时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
|
||||
// 返回默认图标
|
||||
return GetDefaultIcon();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取默认图标
|
||||
/// </summary>
|
||||
private ImageSource GetDefaultIcon()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 对于资源管理器,使用特定图标
|
||||
if (Path.EndsWith("explorer.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
try
|
||||
{
|
||||
// 直接从C:\Windows\explorer.exe获取图标
|
||||
string explorerPath = @"C:\Windows\explorer.exe";
|
||||
if (File.Exists(explorerPath))
|
||||
{
|
||||
Icon icon = System.Drawing.Icon.ExtractAssociatedIcon(explorerPath);
|
||||
if (icon != null)
|
||||
{
|
||||
_iconCache = Imaging.CreateBitmapSourceFromHIcon(
|
||||
icon.Handle,
|
||||
Int32Rect.Empty,
|
||||
BitmapSizeOptions.FromEmptyOptions());
|
||||
|
||||
icon.Dispose();
|
||||
return _iconCache;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"获取资源管理器图标时出错: {ex.Message}", LogHelper.LogType.Warning);
|
||||
// 如果获取Windows图标失败,回退到默认图标
|
||||
}
|
||||
|
||||
// 回退到备用图标
|
||||
string explorerIconPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "Icons-Fluent", "ic_fluent_folder_24_regular.png");
|
||||
if (File.Exists(explorerIconPath))
|
||||
{
|
||||
Uri uri = new Uri(explorerIconPath);
|
||||
BitmapImage image = new BitmapImage(uri);
|
||||
_iconCache = image;
|
||||
return _iconCache;
|
||||
}
|
||||
}
|
||||
|
||||
// 返回一个简单的默认图标
|
||||
string iconPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "Icons-png", "icc.png");
|
||||
if (File.Exists(iconPath))
|
||||
{
|
||||
Uri uri = new Uri(iconPath);
|
||||
BitmapImage image = new BitmapImage(uri);
|
||||
_iconCache = image;
|
||||
return _iconCache;
|
||||
}
|
||||
|
||||
// 如果还是没有找到,尝试使用应用程序图标
|
||||
string appIconPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "Icons-Fluent", "ic_fluent_apps_24_regular.png");
|
||||
if (File.Exists(appIconPath))
|
||||
{
|
||||
Uri uri = new Uri(appIconPath);
|
||||
BitmapImage image = new BitmapImage(uri);
|
||||
_iconCache = image;
|
||||
return _iconCache;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"获取默认图标时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启动应用程序
|
||||
/// </summary>
|
||||
public void Launch()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(Path))
|
||||
{
|
||||
LogHelper.WriteLogToFile("无法启动应用程序:路径为空", LogHelper.LogType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查文件是否存在
|
||||
if (!System.IO.File.Exists(Path) && !Path.Contains(":\\"))
|
||||
{
|
||||
// 可能是系统命令,如explorer.exe
|
||||
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo
|
||||
{
|
||||
FileName = Path,
|
||||
UseShellExecute = true
|
||||
};
|
||||
System.Diagnostics.Process.Start(psi);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 使用Process.Start启动应用程序
|
||||
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo
|
||||
{
|
||||
FileName = Path,
|
||||
UseShellExecute = true
|
||||
};
|
||||
System.Diagnostics.Process.Start(psi);
|
||||
}
|
||||
|
||||
LogHelper.WriteLogToFile($"已启动应用程序: {Path}", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"启动应用程序时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show($"启动应用程序时出错: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 图标提取工具类
|
||||
/// </summary>
|
||||
public static class IconExtractor
|
||||
{
|
||||
/// <summary>
|
||||
/// 从文件中提取图标
|
||||
/// </summary>
|
||||
/// <param name="file">文件路径</param>
|
||||
/// <param name="index">图标索引</param>
|
||||
/// <param name="largeIcon">是否提取大图标</param>
|
||||
/// <returns>提取的图标</returns>
|
||||
public static Icon Extract(string file, int index, bool largeIcon)
|
||||
{
|
||||
try
|
||||
{
|
||||
IntPtr large;
|
||||
IntPtr small;
|
||||
ExtractIconEx(file, index, out large, out small, 1);
|
||||
|
||||
try
|
||||
{
|
||||
return Icon.FromHandle(largeIcon ? large : small);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (large != IntPtr.Zero)
|
||||
DestroyIcon(large);
|
||||
|
||||
if (small != IntPtr.Zero)
|
||||
DestroyIcon(small);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Runtime.InteropServices.DllImport("Shell32.dll", EntryPoint = "ExtractIconEx")]
|
||||
private static extern int ExtractIconEx(
|
||||
[System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPStr)] string lpszFile,
|
||||
int nIconIndex,
|
||||
out IntPtr phiconLarge,
|
||||
out IntPtr phiconSmall,
|
||||
int nIcons);
|
||||
|
||||
[System.Runtime.InteropServices.DllImport("User32.dll")]
|
||||
private static extern int DestroyIcon(IntPtr hIcon);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<UserControl x:Class="Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher.LauncherSettingsControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="500" d:DesignWidth="600">
|
||||
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextBlock Grid.Row="0" Text="超级启动台设置" FontSize="16" FontWeight="Bold" Margin="0,0,0,15"/>
|
||||
|
||||
<!-- 基本设置 -->
|
||||
<StackPanel Grid.Row="1" Margin="0,0,0,15">
|
||||
<TextBlock Text="基本设置" FontSize="14" FontWeight="SemiBold" Margin="0,0,0,10"/>
|
||||
|
||||
<Grid Margin="10,0,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 按钮位置 -->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="按钮位置:" VerticalAlignment="Center"/>
|
||||
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" Margin="0,5">
|
||||
<RadioButton x:Name="RbtnLeft" Content="浮动栏左侧" Margin="0,0,20,0" Checked="RbtnPosition_Checked"/>
|
||||
<RadioButton x:Name="RbtnRight" Content="浮动栏右侧" IsChecked="True" Checked="RbtnPosition_Checked"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 应用管理 -->
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Text="应用管理" FontSize="14" FontWeight="SemiBold" Margin="0,0,0,10"/>
|
||||
|
||||
<Border Grid.Row="1" BorderThickness="1" BorderBrush="#CCCCCC" CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 应用列表 -->
|
||||
<DataGrid Grid.Row="0" x:Name="DgApps" AutoGenerateColumns="False" Margin="5"
|
||||
CanUserAddRows="False" CanUserDeleteRows="False"
|
||||
HeadersVisibility="Column" SelectionMode="Single"
|
||||
SelectionChanged="DgApps_SelectionChanged">
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Header="显示" Binding="{Binding IsVisible}" Width="50"/>
|
||||
<DataGridTextColumn Header="名称" Binding="{Binding Name}" Width="150"/>
|
||||
<DataGridTextColumn Header="路径" Binding="{Binding Path}" Width="*"/>
|
||||
<DataGridTextColumn Header="位置" Binding="{Binding Position}" Width="50"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="5">
|
||||
<Button x:Name="BtnAdd" Content="添加应用" Padding="10,5" Margin="0,5,5,5" Click="BtnAdd_Click"/>
|
||||
<Button x:Name="BtnEdit" Content="编辑" Padding="10,5" Margin="5" Click="BtnEdit_Click"/>
|
||||
<Button x:Name="BtnDelete" Content="删除" Padding="10,5" Margin="5" Click="BtnDelete_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,15,0,0">
|
||||
<Button x:Name="BtnSave" Content="保存设置" Padding="15,5" Click="BtnSave_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,395 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Ink_Canvas.Windows;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// LauncherSettingsControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LauncherSettingsControl : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 父插件
|
||||
/// </summary>
|
||||
private readonly SuperLauncherPlugin _plugin;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="plugin">父插件</param>
|
||||
public LauncherSettingsControl(SuperLauncherPlugin plugin)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_plugin = plugin;
|
||||
|
||||
// 设置按钮位置
|
||||
RbtnLeft.IsChecked = _plugin.Config.ButtonPosition == LauncherButtonPosition.Left;
|
||||
RbtnRight.IsChecked = _plugin.Config.ButtonPosition == LauncherButtonPosition.Right;
|
||||
|
||||
// 绑定应用列表
|
||||
DgApps.ItemsSource = _plugin.LauncherItems;
|
||||
|
||||
// 初始化按钮状态
|
||||
UpdateButtonStates();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新按钮状态
|
||||
/// </summary>
|
||||
private void UpdateButtonStates()
|
||||
{
|
||||
bool hasSelection = DgApps.SelectedItem != null;
|
||||
BtnEdit.IsEnabled = hasSelection;
|
||||
BtnDelete.IsEnabled = hasSelection;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 位置单选按钮选择事件
|
||||
/// </summary>
|
||||
private void RbtnPosition_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!IsLoaded) return;
|
||||
|
||||
LauncherButtonPosition oldPosition = _plugin.Config.ButtonPosition;
|
||||
|
||||
if (sender == RbtnLeft)
|
||||
{
|
||||
_plugin.Config.ButtonPosition = LauncherButtonPosition.Left;
|
||||
}
|
||||
else if (sender == RbtnRight)
|
||||
{
|
||||
_plugin.Config.ButtonPosition = LauncherButtonPosition.Right;
|
||||
}
|
||||
|
||||
// 如果位置发生变化,更新按钮位置
|
||||
if (oldPosition != _plugin.Config.ButtonPosition)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 更新按钮位置
|
||||
_plugin.UpdateButtonPosition();
|
||||
|
||||
// 保存配置
|
||||
_plugin.SaveConfig();
|
||||
|
||||
LogHelper.WriteLogToFile($"启动台按钮位置已更改为: {_plugin.Config.ButtonPosition}", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"更新启动台按钮位置时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show($"更新启动台按钮位置时出错: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加应用按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnAdd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 弹出文件选择对话框
|
||||
OpenFileDialog dialog = new OpenFileDialog
|
||||
{
|
||||
Title = "选择应用程序",
|
||||
Filter = "应用程序 (*.exe)|*.exe|所有文件 (*.*)|*.*",
|
||||
Multiselect = false
|
||||
};
|
||||
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
// 创建新的启动项
|
||||
LauncherItem item = new LauncherItem
|
||||
{
|
||||
Name = System.IO.Path.GetFileNameWithoutExtension(dialog.FileName),
|
||||
Path = dialog.FileName,
|
||||
IsVisible = true,
|
||||
Position = -1 // 让插件管理器分配位置
|
||||
};
|
||||
|
||||
// 显示编辑对话框
|
||||
EditLauncherItem(item, true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"添加启动项时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show($"添加启动项时出错: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑应用按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnEdit_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DgApps.SelectedItem is LauncherItem item)
|
||||
{
|
||||
EditLauncherItem(item, false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除应用按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnDelete_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DgApps.SelectedItem is LauncherItem item)
|
||||
{
|
||||
// 确认删除
|
||||
MessageBoxResult result = MessageBox.Show(
|
||||
$"确定要删除 {item.Name} 吗?",
|
||||
"删除确认",
|
||||
MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Question);
|
||||
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
// 从集合中移除
|
||||
_plugin.LauncherItems.Remove(item);
|
||||
|
||||
// 保存配置
|
||||
_plugin.SaveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存设置按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnSave_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 保存配置
|
||||
_plugin.SaveConfig();
|
||||
|
||||
// 如果插件已启用,重新加载启动台按钮
|
||||
if (_plugin.IsEnabled)
|
||||
{
|
||||
_plugin.Disable();
|
||||
_plugin.Enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果插件未启用,则启用它
|
||||
_plugin.Enable();
|
||||
|
||||
// 通知PluginSettingsWindow刷新插件列表
|
||||
var window = Window.GetWindow(this);
|
||||
if (window is PluginSettingsWindow pluginSettingsWindow)
|
||||
{
|
||||
// 触发刷新
|
||||
pluginSettingsWindow.RefreshPluginList();
|
||||
}
|
||||
}
|
||||
|
||||
MessageBox.Show("设置已保存并应用!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"保存设置时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show($"保存设置时出错: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应用项选择变更事件
|
||||
/// </summary>
|
||||
private void DgApps_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
UpdateButtonStates();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑启动项
|
||||
/// </summary>
|
||||
/// <param name="item">启动项</param>
|
||||
/// <param name="isNew">是否为新建</param>
|
||||
private void EditLauncherItem(LauncherItem item, bool isNew)
|
||||
{
|
||||
// 创建简单的编辑窗口
|
||||
Window editWindow = new Window
|
||||
{
|
||||
Title = isNew ? "添加应用" : "编辑应用",
|
||||
Width = 400,
|
||||
Height = 200,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen,
|
||||
ResizeMode = ResizeMode.NoResize
|
||||
};
|
||||
|
||||
// 创建编辑表单
|
||||
Grid grid = new Grid
|
||||
{
|
||||
Margin = new Thickness(20)
|
||||
};
|
||||
|
||||
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
|
||||
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
|
||||
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
|
||||
|
||||
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(80) });
|
||||
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
|
||||
|
||||
// 名称输入框
|
||||
TextBlock nameLabel = new TextBlock
|
||||
{
|
||||
Text = "名称:",
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
TextBox nameTextBox = new TextBox
|
||||
{
|
||||
Text = item.Name,
|
||||
Margin = new Thickness(0, 5, 0, 5)
|
||||
};
|
||||
|
||||
Grid.SetRow(nameLabel, 0);
|
||||
Grid.SetColumn(nameLabel, 0);
|
||||
Grid.SetRow(nameTextBox, 0);
|
||||
Grid.SetColumn(nameTextBox, 1);
|
||||
|
||||
grid.Children.Add(nameLabel);
|
||||
grid.Children.Add(nameTextBox);
|
||||
|
||||
// 路径输入框
|
||||
TextBlock pathLabel = new TextBlock
|
||||
{
|
||||
Text = "路径:",
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
Grid pathGrid = new Grid();
|
||||
pathGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
|
||||
pathGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength() });
|
||||
|
||||
TextBox pathTextBox = new TextBox
|
||||
{
|
||||
Text = item.Path,
|
||||
Margin = new Thickness(0, 5, 5, 5)
|
||||
};
|
||||
Button browseButton = new Button
|
||||
{
|
||||
Content = "浏览",
|
||||
Padding = new Thickness(5, 0, 5, 0),
|
||||
Margin = new Thickness(0, 5, 0, 5)
|
||||
};
|
||||
|
||||
browseButton.Click += (s, e) =>
|
||||
{
|
||||
OpenFileDialog dialog = new OpenFileDialog
|
||||
{
|
||||
Title = "选择应用程序",
|
||||
Filter = "应用程序 (*.exe)|*.exe|所有文件 (*.*)|*.*",
|
||||
Multiselect = false,
|
||||
FileName = pathTextBox.Text
|
||||
};
|
||||
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
pathTextBox.Text = dialog.FileName;
|
||||
}
|
||||
};
|
||||
|
||||
Grid.SetColumn(pathTextBox, 0);
|
||||
Grid.SetColumn(browseButton, 1);
|
||||
pathGrid.Children.Add(pathTextBox);
|
||||
pathGrid.Children.Add(browseButton);
|
||||
|
||||
Grid.SetRow(pathLabel, 1);
|
||||
Grid.SetColumn(pathLabel, 0);
|
||||
Grid.SetRow(pathGrid, 1);
|
||||
Grid.SetColumn(pathGrid, 1);
|
||||
|
||||
grid.Children.Add(pathLabel);
|
||||
grid.Children.Add(pathGrid);
|
||||
|
||||
// 确认和取消按钮
|
||||
StackPanel buttonPanel = new StackPanel
|
||||
{
|
||||
Orientation = Orientation.Horizontal,
|
||||
HorizontalAlignment = HorizontalAlignment.Right,
|
||||
Margin = new Thickness(0, 10, 0, 0)
|
||||
};
|
||||
|
||||
Button okButton = new Button
|
||||
{
|
||||
Content = "确定",
|
||||
Padding = new Thickness(15, 5, 15, 5),
|
||||
Margin = new Thickness(0, 0, 10, 0),
|
||||
IsDefault = true
|
||||
};
|
||||
|
||||
Button cancelButton = new Button
|
||||
{
|
||||
Content = "取消",
|
||||
Padding = new Thickness(15, 5, 15, 5),
|
||||
IsCancel = true
|
||||
};
|
||||
|
||||
okButton.Click += (s, e) =>
|
||||
{
|
||||
// 验证输入
|
||||
if (string.IsNullOrWhiteSpace(nameTextBox.Text))
|
||||
{
|
||||
MessageBox.Show("请输入应用名称!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(pathTextBox.Text))
|
||||
{
|
||||
MessageBox.Show("请输入应用路径!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
// 更新项目
|
||||
item.Name = nameTextBox.Text;
|
||||
item.Path = pathTextBox.Text;
|
||||
|
||||
// 如果是新建,添加到集合
|
||||
if (isNew)
|
||||
{
|
||||
_plugin.AddLauncherItem(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 触发属性变更通知,刷新DataGrid
|
||||
if (DgApps.ItemsSource is ICollectionView view)
|
||||
{
|
||||
view.Refresh();
|
||||
}
|
||||
|
||||
// 保存配置
|
||||
_plugin.SaveConfig();
|
||||
}
|
||||
|
||||
editWindow.DialogResult = true;
|
||||
editWindow.Close();
|
||||
};
|
||||
|
||||
cancelButton.Click += (s, e) =>
|
||||
{
|
||||
editWindow.DialogResult = false;
|
||||
editWindow.Close();
|
||||
};
|
||||
|
||||
buttonPanel.Children.Add(okButton);
|
||||
buttonPanel.Children.Add(cancelButton);
|
||||
|
||||
Grid.SetRow(buttonPanel, 2);
|
||||
Grid.SetColumnSpan(buttonPanel, 2);
|
||||
|
||||
grid.Children.Add(buttonPanel);
|
||||
|
||||
// 设置窗口内容
|
||||
editWindow.Content = grid;
|
||||
|
||||
// 显示窗口
|
||||
editWindow.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
<Window x:Class="Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher.LauncherWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher"
|
||||
mc:Ignorable="d"
|
||||
Title="启动台"
|
||||
Width="400"
|
||||
Height="300"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="#80000000"
|
||||
ResizeMode="NoResize"
|
||||
Topmost="True"
|
||||
Deactivated="Window_Deactivated"
|
||||
ShowInTaskbar="False">
|
||||
|
||||
<Window.Resources>
|
||||
<!-- 应用项样式 -->
|
||||
<Style x:Key="LauncherItemStyle" TargetType="Button">
|
||||
<Setter Property="Width" Value="80"/>
|
||||
<Setter Property="Height" Value="80"/>
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
<Setter Property="Background" Value="#40FFFFFF"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<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="8">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Grid.Row="0" Source="{Binding Icon}" Width="32" Height="32" Margin="0,10,0,5"/>
|
||||
<TextBlock Grid.Row="1" Text="{Binding Name}" TextWrapping="Wrap" TextAlignment="Center"
|
||||
Margin="2,0,2,8" FontSize="11" Foreground="White"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#80FFFFFF"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" Value="#C0FFFFFF"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Border CornerRadius="15" Background="#80000000" BorderThickness="1" BorderBrush="#40FFFFFF">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题栏 -->
|
||||
<Grid Grid.Row="0" Height="40">
|
||||
<TextBlock Text="启动台" Foreground="White" FontSize="18" FontWeight="Bold"
|
||||
VerticalAlignment="Center" Margin="15,0,0,0"/>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
|
||||
<Button x:Name="BtnFixMode" Click="BtnFixMode_Click" Width="30" Height="30"
|
||||
Margin="5,0" Background="Transparent" BorderThickness="0"
|
||||
ToolTip="切换固定模式">
|
||||
<Path x:Name="FixModeIcon" Data="M7,2V13H10V22L17,10H13L17,2H7Z" Fill="White" Stretch="Uniform" Width="16" Height="16"/>
|
||||
</Button>
|
||||
<Button x:Name="BtnClose" Click="BtnClose_Click" Width="30" Height="30"
|
||||
Background="Transparent" BorderThickness="0"
|
||||
ToolTip="关闭">
|
||||
<Path Data="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
|
||||
Fill="White" Stretch="Uniform" Width="16" Height="16"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- 应用网格 -->
|
||||
<ScrollViewer Grid.Row="1" Margin="10" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<WrapPanel x:Name="AppPanel" Orientation="Horizontal" HorizontalAlignment="Center"/>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
||||
@@ -0,0 +1,460 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// LauncherWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LauncherWindow : Window
|
||||
{
|
||||
/// <summary>
|
||||
/// 父插件
|
||||
/// </summary>
|
||||
private readonly SuperLauncherPlugin _plugin;
|
||||
|
||||
/// <summary>
|
||||
/// 是否处于固定模式
|
||||
/// </summary>
|
||||
private bool _isFixMode = false;
|
||||
|
||||
/// <summary>
|
||||
/// 应用项按钮列表
|
||||
/// </summary>
|
||||
private readonly Dictionary<Button, LauncherItem> _appButtons = new Dictionary<Button, LauncherItem>();
|
||||
|
||||
/// <summary>
|
||||
/// 拖拽中的按钮
|
||||
/// </summary>
|
||||
private Button _draggingButton;
|
||||
|
||||
/// <summary>
|
||||
/// 拖拽开始位置
|
||||
/// </summary>
|
||||
private Point _dragStartPoint;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public LauncherWindow(SuperLauncherPlugin plugin)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_plugin = plugin;
|
||||
|
||||
// 加载应用项
|
||||
LoadLauncherItems();
|
||||
|
||||
// 添加鼠标按下事件(用于拖动窗口)
|
||||
this.MouseDown += (s, e) =>
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left && e.ButtonState == MouseButtonState.Pressed)
|
||||
{
|
||||
this.DragMove();
|
||||
}
|
||||
};
|
||||
|
||||
// 根据应用数量调整窗口大小
|
||||
AdjustWindowSize();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载启动台应用项
|
||||
/// </summary>
|
||||
private void LoadLauncherItems()
|
||||
{
|
||||
// 清空现有应用项
|
||||
AppPanel.Children.Clear();
|
||||
_appButtons.Clear();
|
||||
|
||||
// 获取显示的应用项
|
||||
var visibleItems = _plugin.LauncherItems
|
||||
.Where(item => item.IsVisible)
|
||||
.OrderBy(item => item.Position)
|
||||
.ToList();
|
||||
|
||||
foreach (var item in visibleItems)
|
||||
{
|
||||
// 创建应用按钮
|
||||
Button appButton = new Button
|
||||
{
|
||||
Style = (Style)FindResource("LauncherItemStyle"),
|
||||
DataContext = item,
|
||||
Tag = item.Position
|
||||
};
|
||||
|
||||
// 添加点击事件
|
||||
appButton.Click += AppButton_Click;
|
||||
|
||||
// 在固定模式下,添加拖拽事件
|
||||
appButton.PreviewMouseDown += AppButton_PreviewMouseDown;
|
||||
appButton.PreviewMouseMove += AppButton_PreviewMouseMove;
|
||||
appButton.PreviewMouseUp += AppButton_PreviewMouseUp;
|
||||
|
||||
// 记录按钮和项目的对应关系
|
||||
_appButtons.Add(appButton, item);
|
||||
|
||||
// 添加到面板
|
||||
AppPanel.Children.Add(appButton);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据应用数量调整窗口大小
|
||||
/// </summary>
|
||||
private void AdjustWindowSize()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 每行最多显示4个应用
|
||||
const int appsPerRow = 4;
|
||||
|
||||
// 计算行数
|
||||
int visibleCount = _appButtons.Count;
|
||||
int rowCount = (int)Math.Ceiling(visibleCount / (double)appsPerRow);
|
||||
|
||||
// 设置窗口宽度(每个应用90像素宽 = 80 + 5*2)
|
||||
Width = Math.Min(appsPerRow * 90 + 40, 400); // 最大宽度400
|
||||
|
||||
// 设置窗口高度(每个应用90像素高 = 80 + 5*2)
|
||||
Height = Math.Min(rowCount * 90 + 60, 600); // 最大高度600,标题栏40 + 边距20
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"调整启动台窗口大小时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应用按钮点击事件
|
||||
/// </summary>
|
||||
private void AppButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_isFixMode) return; // 在固定模式下,不响应点击事件
|
||||
|
||||
if (sender is Button button && _appButtons.TryGetValue(button, out LauncherItem item))
|
||||
{
|
||||
// 获取应用路径和名称,用于后续启动
|
||||
string appPath = item.Path;
|
||||
string appName = item.Name;
|
||||
|
||||
LogHelper.WriteLogToFile($"点击启动应用: {appName}, 路径: {appPath}", LogHelper.LogType.Info);
|
||||
|
||||
// 首先标记窗口正在关闭
|
||||
IsClosing = true;
|
||||
|
||||
// 创建一个应用启动任务
|
||||
var launchTask = new System.Threading.Tasks.Task(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
// 等待一段时间,确保窗口关闭流程已经开始
|
||||
System.Threading.Thread.Sleep(200);
|
||||
|
||||
// 使用UI线程启动应用
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
// 检查应用路径是否存在
|
||||
if (System.IO.File.Exists(appPath) || !appPath.Contains(":\\"))
|
||||
{
|
||||
// 创建进程启动信息
|
||||
var psi = new System.Diagnostics.ProcessStartInfo
|
||||
{
|
||||
FileName = appPath,
|
||||
UseShellExecute = true,
|
||||
};
|
||||
|
||||
// 启动应用程序
|
||||
var process = System.Diagnostics.Process.Start(psi);
|
||||
LogHelper.WriteLogToFile($"应用程序 {appName} 已启动", LogHelper.LogType.Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogToFile($"应用路径不存在: {appPath}", LogHelper.LogType.Error);
|
||||
MessageBox.Show($"找不到应用程序: {appPath}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"启动应用程序失败: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show($"启动应用程序失败: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"应用启动任务出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
});
|
||||
|
||||
// 关闭窗口
|
||||
try
|
||||
{
|
||||
Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
try { Close(); } catch { }
|
||||
|
||||
// 启动应用程序任务
|
||||
launchTask.Start();
|
||||
}), System.Windows.Threading.DispatcherPriority.Background);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"关闭窗口或启动任务时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
// 如果无法通过UI关闭窗口,直接启动任务
|
||||
launchTask.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"应用按钮点击事件出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
try { IsClosing = true; Close(); } catch { }
|
||||
}
|
||||
}
|
||||
|
||||
#region 固定模式拖拽事件
|
||||
|
||||
/// <summary>
|
||||
/// 应用按钮鼠标按下事件
|
||||
/// </summary>
|
||||
private void AppButton_PreviewMouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (!_isFixMode) return;
|
||||
|
||||
if (e.ChangedButton == MouseButton.Left && sender is Button button)
|
||||
{
|
||||
_draggingButton = button;
|
||||
_dragStartPoint = e.GetPosition(AppPanel);
|
||||
button.CaptureMouse();
|
||||
button.Opacity = 0.7;
|
||||
|
||||
// 阻止事件冒泡,以避免触发按钮点击
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应用按钮鼠标移动事件
|
||||
/// </summary>
|
||||
private void AppButton_PreviewMouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (!_isFixMode || _draggingButton == null) return;
|
||||
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
Point currentPosition = e.GetPosition(AppPanel);
|
||||
|
||||
// 移动按钮
|
||||
System.Windows.Controls.Canvas.SetLeft(_draggingButton, currentPosition.X - _draggingButton.ActualWidth / 2);
|
||||
System.Windows.Controls.Canvas.SetTop(_draggingButton, currentPosition.Y - _draggingButton.ActualHeight / 2);
|
||||
|
||||
// 将按钮移到最上层
|
||||
Panel.SetZIndex(_draggingButton, 100);
|
||||
|
||||
// 阻止事件冒泡
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应用按钮鼠标释放事件
|
||||
/// </summary>
|
||||
private void AppButton_PreviewMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (!_isFixMode || _draggingButton == null) return;
|
||||
|
||||
// 释放鼠标捕获
|
||||
_draggingButton.ReleaseMouseCapture();
|
||||
|
||||
// 计算新位置
|
||||
Point releasePoint = e.GetPosition(AppPanel);
|
||||
int newPosition = CalculateGridPosition(releasePoint);
|
||||
|
||||
// 获取当前项目
|
||||
LauncherItem currentItem = _appButtons[_draggingButton];
|
||||
|
||||
// 重新排序
|
||||
ReorderItems(currentItem, newPosition);
|
||||
|
||||
// 重新加载应用项
|
||||
LoadLauncherItems();
|
||||
|
||||
// 保存配置
|
||||
_plugin.SaveConfig();
|
||||
|
||||
// 清除拖拽状态
|
||||
_draggingButton.Opacity = 1;
|
||||
Panel.SetZIndex(_draggingButton, 0);
|
||||
_draggingButton = null;
|
||||
|
||||
// 阻止事件冒泡
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算网格位置
|
||||
/// </summary>
|
||||
private int CalculateGridPosition(Point point)
|
||||
{
|
||||
// 计算行和列
|
||||
int columnCount = 4; // 每行最多4个应用
|
||||
int columnWidth = 90; // 应用宽度(包括边距)
|
||||
int rowHeight = 90; // 应用高度(包括边距)
|
||||
|
||||
int column = (int)(point.X / columnWidth);
|
||||
int row = (int)(point.Y / rowHeight);
|
||||
|
||||
// 确保在有效范围内
|
||||
column = Math.Max(0, Math.Min(column, columnCount - 1));
|
||||
row = Math.Max(0, row);
|
||||
|
||||
// 计算位置索引
|
||||
return row * columnCount + column;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重新排序应用项
|
||||
/// </summary>
|
||||
private void ReorderItems(LauncherItem item, int newPosition)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 设置项目为固定位置
|
||||
item.IsPositionFixed = true;
|
||||
|
||||
// 如果位置相同,无需调整
|
||||
if (item.Position == newPosition)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取所有可见项目
|
||||
var visibleItems = _plugin.LauncherItems
|
||||
.Where(i => i.IsVisible)
|
||||
.OrderBy(i => i.Position)
|
||||
.ToList();
|
||||
|
||||
// 移除当前项目
|
||||
visibleItems.Remove(item);
|
||||
|
||||
// 查找插入位置
|
||||
int insertIndex = 0;
|
||||
for (int i = 0; i < visibleItems.Count; i++)
|
||||
{
|
||||
if (visibleItems[i].Position >= newPosition)
|
||||
{
|
||||
insertIndex = i;
|
||||
break;
|
||||
}
|
||||
insertIndex = i + 1;
|
||||
}
|
||||
|
||||
// 插入项目
|
||||
visibleItems.Insert(insertIndex, item);
|
||||
|
||||
// 重新分配位置
|
||||
for (int i = 0; i < visibleItems.Count; i++)
|
||||
{
|
||||
visibleItems[i].Position = i;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"重新排序应用项时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 窗口事件处理
|
||||
|
||||
/// <summary>
|
||||
/// 窗口失去焦点事件
|
||||
/// </summary>
|
||||
private void Window_Deactivated(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 只有在非固定模式、窗口已加载、未处于关闭状态且IsLoaded=true时关闭窗口
|
||||
if (!_isFixMode && IsLoaded && !IsClosing)
|
||||
{
|
||||
// 标记为正在关闭
|
||||
IsClosing = true;
|
||||
|
||||
// 使用Dispatcher.BeginInvoke而不是直接调用Close,避免冲突
|
||||
Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
// 再次检查窗口状态
|
||||
if (IsLoaded && !IsClosing)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"延迟关闭窗口时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}), System.Windows.Threading.DispatcherPriority.Background);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"窗口失去焦点关闭时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗口是否正在关闭
|
||||
/// </summary>
|
||||
private bool IsClosing { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 重写OnClosing方法,标记窗口正在关闭
|
||||
/// </summary>
|
||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
IsClosing = true;
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 固定模式按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnFixMode_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换固定模式
|
||||
_isFixMode = !_isFixMode;
|
||||
|
||||
// 更新固定模式按钮图标颜色
|
||||
FixModeIcon.Fill = _isFixMode ? Brushes.Yellow : Brushes.White;
|
||||
|
||||
// 显示提示
|
||||
if (_isFixMode)
|
||||
{
|
||||
MessageBox.Show("已进入固定模式,您可以拖动应用图标调整位置。", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,589 @@
|
||||
using Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins.BuiltIn
|
||||
{
|
||||
/// <summary>
|
||||
/// 超级启动台插件
|
||||
/// </summary>
|
||||
public class SuperLauncherPlugin : PluginBase
|
||||
{
|
||||
#region 插件基本信息
|
||||
|
||||
public override string Name => "超级启动台";
|
||||
|
||||
public override string Description => "在浮动栏添加一个启动台按钮,可快速启动常用应用程序。";
|
||||
|
||||
public override Version Version => new Version(1, 0, 0);
|
||||
|
||||
public override string Author => "ICC CE 团队";
|
||||
|
||||
public override bool IsBuiltIn => true;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 插件属性和字段
|
||||
|
||||
/// <summary>
|
||||
/// 启动台配置
|
||||
/// </summary>
|
||||
public LauncherConfig Config { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启动台应用程序列表
|
||||
/// </summary>
|
||||
public ObservableCollection<LauncherItem> LauncherItems { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启动台按钮
|
||||
/// </summary>
|
||||
private LauncherButton _launcherButton;
|
||||
|
||||
/// <summary>
|
||||
/// 启动台窗口
|
||||
/// </summary>
|
||||
private LauncherWindow _launcherWindow;
|
||||
|
||||
/// <summary>
|
||||
/// 配置文件路径
|
||||
/// </summary>
|
||||
private readonly string _configPath = Path.Combine(App.RootPath, "PluginConfigs", "SuperLauncher.json");
|
||||
|
||||
/// <summary>
|
||||
/// 标记是否已添加到浮动栏
|
||||
/// </summary>
|
||||
private bool _isAddedToFloatingBar = false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 插件生命周期
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
try
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
// 创建配置目录
|
||||
string configDir = Path.Combine(App.RootPath, "PluginConfigs");
|
||||
if (!Directory.Exists(configDir))
|
||||
{
|
||||
Directory.CreateDirectory(configDir);
|
||||
}
|
||||
|
||||
// 加载配置
|
||||
LoadConfig();
|
||||
|
||||
LogHelper.WriteLogToFile("超级启动台插件已初始化", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"初始化超级启动台插件时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.NewLog(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (IsEnabled) return; // 防止重复启用
|
||||
|
||||
// 创建启动台按钮
|
||||
if (_launcherButton == null)
|
||||
{
|
||||
_launcherButton = new LauncherButton(this);
|
||||
LogHelper.WriteLogToFile("超级启动台按钮已创建", LogHelper.LogType.Info);
|
||||
}
|
||||
|
||||
// 添加启动台按钮到浮动栏
|
||||
AddLauncherButtonToFloatingBar();
|
||||
|
||||
// 设置启用状态
|
||||
base.Enable();
|
||||
|
||||
// 保存插件配置
|
||||
SavePluginSettings();
|
||||
|
||||
LogHelper.WriteLogToFile("超级启动台插件已启用", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"启用超级启动台插件时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.NewLog(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Disable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!IsEnabled) return; // 防止重复禁用
|
||||
|
||||
// 从浮动栏移除启动台按钮
|
||||
RemoveLauncherButtonFromFloatingBar();
|
||||
|
||||
// 如果启动台窗口打开,则关闭
|
||||
if (_launcherWindow != null && _launcherWindow.IsVisible)
|
||||
{
|
||||
_launcherWindow.Close();
|
||||
_launcherWindow = null;
|
||||
}
|
||||
|
||||
// 设置禁用状态
|
||||
base.Disable();
|
||||
|
||||
// 保存插件配置
|
||||
SavePluginSettings();
|
||||
|
||||
LogHelper.WriteLogToFile("超级启动台插件已禁用", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"禁用超级启动台插件时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.NewLog(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public override UserControl GetSettingsView()
|
||||
{
|
||||
return new LauncherSettingsControl(this);
|
||||
}
|
||||
|
||||
public override void Cleanup()
|
||||
{
|
||||
// 保存配置
|
||||
SaveConfig();
|
||||
|
||||
// 从浮动栏移除启动台按钮
|
||||
RemoveLauncherButtonFromFloatingBar();
|
||||
|
||||
// 如果启动台窗口打开,则关闭
|
||||
if (_launcherWindow != null && _launcherWindow.IsVisible)
|
||||
{
|
||||
_launcherWindow.Close();
|
||||
_launcherWindow = null;
|
||||
}
|
||||
|
||||
base.Cleanup();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存插件设置
|
||||
/// </summary>
|
||||
public override void SavePluginSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 确保配置已加载
|
||||
if (Config == null)
|
||||
{
|
||||
LoadConfig();
|
||||
}
|
||||
|
||||
// 更新其他设置,但不更改插件启用状态
|
||||
|
||||
// 保存配置
|
||||
SaveConfig();
|
||||
|
||||
LogHelper.WriteLogToFile($"超级启动台插件设置已保存", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"保存超级启动台插件设置时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 配置管理
|
||||
|
||||
/// <summary>
|
||||
/// 加载配置
|
||||
/// </summary>
|
||||
private void LoadConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(_configPath))
|
||||
{
|
||||
string json = File.ReadAllText(_configPath);
|
||||
Config = JsonConvert.DeserializeObject<LauncherConfig>(json) ?? CreateDefaultConfig();
|
||||
LauncherItems = new ObservableCollection<LauncherItem>(Config.Items ?? new List<LauncherItem>());
|
||||
|
||||
// 注意:不再根据配置更改插件启用状态
|
||||
// 插件状态由PluginManager统一管理
|
||||
}
|
||||
else
|
||||
{
|
||||
Config = CreateDefaultConfig();
|
||||
LauncherItems = new ObservableCollection<LauncherItem>(Config.Items);
|
||||
SaveConfig();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"加载超级启动台配置时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
Config = CreateDefaultConfig();
|
||||
LauncherItems = new ObservableCollection<LauncherItem>(Config.Items);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存配置
|
||||
/// </summary>
|
||||
public void SaveConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 同步LauncherItems到Config
|
||||
Config.Items = new List<LauncherItem>(LauncherItems);
|
||||
|
||||
// 序列化并保存配置
|
||||
string json = JsonConvert.SerializeObject(Config, Formatting.Indented);
|
||||
File.WriteAllText(_configPath, json);
|
||||
|
||||
LogHelper.WriteLogToFile("超级启动台配置已保存", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"保存超级启动台配置时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建默认配置
|
||||
/// </summary>
|
||||
private LauncherConfig CreateDefaultConfig()
|
||||
{
|
||||
var config = new LauncherConfig
|
||||
{
|
||||
ButtonPosition = LauncherButtonPosition.Right,
|
||||
// 不再使用IsEnabled,插件状态由PluginManager管理
|
||||
Items = new List<LauncherItem>
|
||||
{
|
||||
new LauncherItem
|
||||
{
|
||||
Name = "资源管理器",
|
||||
Path = @"C:\Windows\explorer.exe",
|
||||
IsVisible = true,
|
||||
Position = 0
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 启动台按钮管理
|
||||
|
||||
/// <summary>
|
||||
/// 将启动台按钮添加到浮动栏
|
||||
/// </summary>
|
||||
private void AddLauncherButtonToFloatingBar()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 如果已经添加,先移除
|
||||
if (_isAddedToFloatingBar)
|
||||
{
|
||||
RemoveLauncherButtonFromFloatingBar();
|
||||
_isAddedToFloatingBar = false;
|
||||
}
|
||||
|
||||
// 获取主窗口实例
|
||||
var mainWindow = Application.Current.MainWindow;
|
||||
if (mainWindow == null)
|
||||
{
|
||||
LogHelper.WriteLogToFile("未找到主窗口实例,无法添加启动台按钮", LogHelper.LogType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建启动台按钮
|
||||
_launcherButton = new LauncherButton(this);
|
||||
var buttonElement = _launcherButton.Element;
|
||||
|
||||
// 查找浮动栏
|
||||
var floatingBar = mainWindow.FindName("StackPanelFloatingBar") as Panel;
|
||||
if (floatingBar == null)
|
||||
{
|
||||
// 如果直接查找失败,则尝试遍历可视树查找
|
||||
Panel floatingBarPanelFromTree = null;
|
||||
FindStackPanelFloatingBar(mainWindow, ref floatingBarPanelFromTree);
|
||||
floatingBar = floatingBarPanelFromTree;
|
||||
}
|
||||
|
||||
if (floatingBar == null)
|
||||
{
|
||||
LogHelper.WriteLogToFile("未找到浮动栏,无法添加启动台按钮", LogHelper.LogType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
// 添加启动台按钮到浮动栏
|
||||
if (Config.ButtonPosition == LauncherButtonPosition.Left)
|
||||
{
|
||||
floatingBar.Children.Insert(0, buttonElement);
|
||||
LogHelper.WriteLogToFile("启动台按钮已添加到浮动栏左侧", LogHelper.LogType.Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
floatingBar.Children.Add(buttonElement);
|
||||
LogHelper.WriteLogToFile("启动台按钮已添加到浮动栏右侧", LogHelper.LogType.Info);
|
||||
}
|
||||
|
||||
_isAddedToFloatingBar = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"添加启动台按钮到浮动栏时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.NewLog(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 递归查找StackPanelFloatingBar
|
||||
/// </summary>
|
||||
private void FindStackPanelFloatingBar(DependencyObject parent, ref Panel result)
|
||||
{
|
||||
if (parent == null || result != null) return;
|
||||
|
||||
try
|
||||
{
|
||||
// 检查当前对象是否为我们要找的面板
|
||||
if (parent is Panel panel && panel.Name == "StackPanelFloatingBar")
|
||||
{
|
||||
result = panel;
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取子元素数量
|
||||
int childCount = VisualTreeHelper.GetChildrenCount(parent);
|
||||
|
||||
// 遍历所有子元素
|
||||
for (int i = 0; i < childCount; i++)
|
||||
{
|
||||
DependencyObject child = VisualTreeHelper.GetChild(parent, i);
|
||||
FindStackPanelFloatingBar(child, ref result);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"查找StackPanelFloatingBar时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从浮动栏移除启动台按钮
|
||||
/// </summary>
|
||||
private void RemoveLauncherButtonFromFloatingBar()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!_isAddedToFloatingBar || _launcherButton == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取主窗口实例
|
||||
var mainWindow = Application.Current.MainWindow;
|
||||
if (mainWindow == null)
|
||||
{
|
||||
LogHelper.WriteLogToFile("未找到主窗口实例,无法移除启动台按钮", LogHelper.LogType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取按钮元素
|
||||
var buttonElement = _launcherButton.Element;
|
||||
|
||||
// 查找浮动栏
|
||||
var floatingBar = mainWindow.FindName("StackPanelFloatingBar") as Panel;
|
||||
if (floatingBar == null)
|
||||
{
|
||||
// 如果直接查找失败,则尝试遍历可视树查找
|
||||
Panel floatingBarPanelFromTree = null;
|
||||
FindStackPanelFloatingBar(mainWindow, ref floatingBarPanelFromTree);
|
||||
floatingBar = floatingBarPanelFromTree;
|
||||
}
|
||||
|
||||
if (floatingBar == null)
|
||||
{
|
||||
LogHelper.WriteLogToFile("未找到浮动栏,无法移除启动台按钮", LogHelper.LogType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
// 从浮动栏移除启动台按钮
|
||||
if (floatingBar.Children.Contains(buttonElement))
|
||||
{
|
||||
floatingBar.Children.Remove(buttonElement);
|
||||
LogHelper.WriteLogToFile("启动台按钮已从浮动栏移除", LogHelper.LogType.Info);
|
||||
}
|
||||
|
||||
_isAddedToFloatingBar = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"移除启动台按钮时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.NewLog(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新启动台按钮位置
|
||||
/// </summary>
|
||||
public void UpdateButtonPosition()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 如果按钮已添加到浮动栏,重新添加以更新位置
|
||||
if (_isAddedToFloatingBar)
|
||||
{
|
||||
RemoveLauncherButtonFromFloatingBar();
|
||||
AddLauncherButtonToFloatingBar();
|
||||
LogHelper.WriteLogToFile($"启动台按钮位置已更新为: {Config.ButtonPosition}", LogHelper.LogType.Info);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"更新启动台按钮位置时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.NewLog(ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 启动台功能
|
||||
|
||||
/// <summary>
|
||||
/// 显示启动台窗口
|
||||
/// </summary>
|
||||
/// <param name="buttonPosition">按钮在屏幕上的位置</param>
|
||||
public void ShowLauncherWindow(Point buttonPosition)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 如果窗口已存在,关闭它
|
||||
if (_launcherWindow != null && _launcherWindow.IsVisible)
|
||||
{
|
||||
_launcherWindow.Close();
|
||||
_launcherWindow = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建新的启动台窗口
|
||||
_launcherWindow = new LauncherWindow(this);
|
||||
|
||||
// 计算窗口位置,使其位于按钮上方
|
||||
PositionLauncherWindow(_launcherWindow, buttonPosition);
|
||||
|
||||
// 显示窗口
|
||||
_launcherWindow.Show();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"显示启动台窗口时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置启动台窗口位置
|
||||
/// </summary>
|
||||
/// <param name="window">启动台窗口</param>
|
||||
/// <param name="buttonPosition">按钮在屏幕上的位置</param>
|
||||
private void PositionLauncherWindow(LauncherWindow window, Point buttonPosition)
|
||||
{
|
||||
// 确保窗口已加载
|
||||
if (window.ActualWidth == 0 || window.ActualHeight == 0)
|
||||
{
|
||||
window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
|
||||
// 设置窗口加载完成后的位置
|
||||
window.Loaded += (s, e) =>
|
||||
{
|
||||
// 窗口位于按钮上方居中
|
||||
double left = buttonPosition.X - (window.ActualWidth / 2);
|
||||
double top = buttonPosition.Y - window.ActualHeight - 10; // 在按钮上方留出一些间距
|
||||
|
||||
// 确保窗口在屏幕内
|
||||
left = Math.Max(0, Math.Min(left, SystemParameters.WorkArea.Width - window.ActualWidth));
|
||||
top = Math.Max(0, Math.Min(top, SystemParameters.WorkArea.Height - window.ActualHeight));
|
||||
|
||||
window.Left = left;
|
||||
window.Top = top;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
// 窗口位于按钮上方居中
|
||||
double left = buttonPosition.X - (window.ActualWidth / 2);
|
||||
double top = buttonPosition.Y - window.ActualHeight - 10; // 在按钮上方留出一些间距
|
||||
|
||||
// 确保窗口在屏幕内
|
||||
left = Math.Max(0, Math.Min(left, SystemParameters.WorkArea.Width - window.ActualWidth));
|
||||
top = Math.Max(0, Math.Min(top, SystemParameters.WorkArea.Height - window.ActualHeight));
|
||||
|
||||
window.Left = left;
|
||||
window.Top = top;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加应用到启动台
|
||||
/// </summary>
|
||||
/// <param name="item">启动台项</param>
|
||||
public void AddLauncherItem(LauncherItem item)
|
||||
{
|
||||
// 如果项目数量已达上限,则不添加
|
||||
if (LauncherItems.Count >= 40)
|
||||
{
|
||||
MessageBox.Show("启动台项目数量已达上限(40个)!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
// 寻找合适的位置
|
||||
if (item.Position < 0)
|
||||
{
|
||||
item.Position = FindNextAvailablePosition();
|
||||
}
|
||||
|
||||
// 添加项目并保存配置
|
||||
LauncherItems.Add(item);
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找下一个可用位置
|
||||
/// </summary>
|
||||
private int FindNextAvailablePosition()
|
||||
{
|
||||
// 获取已使用的位置列表
|
||||
var usedPositions = new HashSet<int>();
|
||||
foreach (var item in LauncherItems)
|
||||
{
|
||||
usedPositions.Add(item.Position);
|
||||
}
|
||||
|
||||
// 查找第一个可用位置
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
if (!usedPositions.Contains(i))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果所有位置都已使用,则返回0
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins
|
||||
{
|
||||
/// <summary>
|
||||
/// 定义插件的基本接口
|
||||
/// </summary>
|
||||
public interface IPlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// 插件名称
|
||||
/// </summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 插件描述
|
||||
/// </summary>
|
||||
string Description { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 插件版本
|
||||
/// </summary>
|
||||
Version Version { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 插件作者
|
||||
/// </summary>
|
||||
string Author { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否为内置插件
|
||||
/// </summary>
|
||||
bool IsBuiltIn { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化插件
|
||||
/// 此方法在插件加载时被调用,用于执行一些初始化工作
|
||||
/// </summary>
|
||||
void Initialize();
|
||||
|
||||
/// <summary>
|
||||
/// 启用插件
|
||||
/// 此方法在插件被用户或系统启用时调用,激活插件功能
|
||||
/// </summary>
|
||||
void Enable();
|
||||
|
||||
/// <summary>
|
||||
/// 禁用插件
|
||||
/// 此方法在插件被用户或系统禁用时调用,停用插件功能
|
||||
/// </summary>
|
||||
void Disable();
|
||||
|
||||
/// <summary>
|
||||
/// 获取插件设置界面
|
||||
/// 此方法返回插件的设置界面控件,用于展示在设置窗口
|
||||
/// </summary>
|
||||
/// <returns>插件设置界面</returns>
|
||||
UserControl GetSettingsView();
|
||||
|
||||
/// <summary>
|
||||
/// 插件卸载时的清理工作
|
||||
/// 此方法在插件被卸载前调用,用于释放资源和执行清理
|
||||
/// </summary>
|
||||
void Cleanup();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
using System;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins
|
||||
{
|
||||
/// <summary>
|
||||
/// 插件基类,提供基本实现
|
||||
/// </summary>
|
||||
public abstract class PluginBase : IPlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// 插件状态(私有字段)
|
||||
/// </summary>
|
||||
private bool _isEnabled = false;
|
||||
|
||||
/// <summary>
|
||||
/// 插件状态(公共属性)
|
||||
/// </summary>
|
||||
public bool IsEnabled
|
||||
{
|
||||
get => _isEnabled;
|
||||
protected set
|
||||
{
|
||||
if (_isEnabled != value)
|
||||
{
|
||||
_isEnabled = value;
|
||||
OnEnabledStateChanged(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插件ID
|
||||
/// </summary>
|
||||
public string Id { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// 插件路径
|
||||
/// </summary>
|
||||
public string PluginPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 插件名称
|
||||
/// </summary>
|
||||
public abstract string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 插件描述
|
||||
/// </summary>
|
||||
public abstract string Description { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 插件版本
|
||||
/// </summary>
|
||||
public abstract Version Version { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 插件作者
|
||||
/// </summary>
|
||||
public abstract string Author { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否为内置插件
|
||||
/// </summary>
|
||||
public virtual bool IsBuiltIn => false;
|
||||
|
||||
/// <summary>
|
||||
/// 状态变更事件
|
||||
/// </summary>
|
||||
public event EventHandler<bool> EnabledStateChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 初始化插件
|
||||
/// </summary>
|
||||
public virtual void Initialize()
|
||||
{
|
||||
Id = GetType().FullName;
|
||||
|
||||
// 添加日志,记录插件名称
|
||||
try
|
||||
{
|
||||
string name = Name;
|
||||
LogHelper.WriteLogToFile($"初始化插件: ID={Id}, 名称={name ?? "未命名"}", LogHelper.LogType.Info);
|
||||
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
LogHelper.WriteLogToFile($"警告: 插件 {Id} 的名称为空", LogHelper.LogType.Warning);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"获取插件名称时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
|
||||
LogHelper.WriteLogToFile($"插件 {Name} 已初始化", LogHelper.LogType.Info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启用插件
|
||||
/// </summary>
|
||||
public virtual void Enable()
|
||||
{
|
||||
if (!IsEnabled)
|
||||
{
|
||||
IsEnabled = true;
|
||||
LogHelper.WriteLogToFile($"插件 {Name} 已启用", LogHelper.LogType.Info);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 禁用插件
|
||||
/// </summary>
|
||||
public virtual void Disable()
|
||||
{
|
||||
if (IsEnabled)
|
||||
{
|
||||
IsEnabled = false;
|
||||
LogHelper.WriteLogToFile($"插件 {Name} 已禁用", LogHelper.LogType.Info);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取插件设置界面
|
||||
/// </summary>
|
||||
/// <returns>插件设置界面</returns>
|
||||
public virtual UserControl GetSettingsView()
|
||||
{
|
||||
// 默认返回空设置页面
|
||||
return new UserControl();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插件卸载时的清理工作
|
||||
/// </summary>
|
||||
public virtual void Cleanup()
|
||||
{
|
||||
LogHelper.WriteLogToFile($"插件 {Name} 已卸载", LogHelper.LogType.Info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存插件自身的设置
|
||||
/// 注意:此方法仅用于保存插件的特定设置,不应影响插件启用/禁用状态
|
||||
/// 插件启用状态由PluginManager统一管理
|
||||
/// </summary>
|
||||
public virtual void SavePluginSettings()
|
||||
{
|
||||
// 默认实现不做任何事情
|
||||
// 子类可以重写此方法,将自身设置保存到配置文件中
|
||||
LogHelper.WriteLogToFile($"插件 {Name} 设置已保存", LogHelper.LogType.Event);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 触发状态变更事件
|
||||
/// </summary>
|
||||
/// <param name="isEnabled">是否启用</param>
|
||||
protected virtual void OnEnabledStateChanged(bool isEnabled)
|
||||
{
|
||||
EnabledStateChanged?.Invoke(this, isEnabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins
|
||||
{
|
||||
/// <summary>
|
||||
/// 插件模板,用于开发者参考
|
||||
/// 注意:实际开发时,请将此类移到单独的程序集中
|
||||
/// </summary>
|
||||
public class PluginTemplate : PluginBase
|
||||
{
|
||||
#region 插件基本信息
|
||||
|
||||
/// <summary>
|
||||
/// 插件名称
|
||||
/// </summary>
|
||||
public override string Name => "插件模板";
|
||||
|
||||
/// <summary>
|
||||
/// 插件描述
|
||||
/// </summary>
|
||||
public override string Description => "这是一个插件开发模板,用于开发者参考。";
|
||||
|
||||
/// <summary>
|
||||
/// 插件版本
|
||||
/// </summary>
|
||||
public override Version Version => new Version(1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// 插件作者
|
||||
/// </summary>
|
||||
public override string Author => "Your Name";
|
||||
|
||||
/// <summary>
|
||||
/// 是否为内置插件(外部插件请返回false)
|
||||
/// </summary>
|
||||
public override bool IsBuiltIn => false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 插件生命周期
|
||||
|
||||
/// <summary>
|
||||
/// 插件初始化
|
||||
/// 在这里进行插件的初始化工作,如加载配置、注册事件等
|
||||
/// </summary>
|
||||
public override void Initialize()
|
||||
{
|
||||
// 先调用基类方法,这样会设置插件ID和记录日志
|
||||
base.Initialize();
|
||||
|
||||
// TODO: 在这里进行插件初始化工作
|
||||
|
||||
// 示例:记录初始化信息
|
||||
LogHelper.WriteLogToFile($"插件 {Name} 开始初始化", LogHelper.LogType.Info);
|
||||
|
||||
// 示例:加载配置
|
||||
LoadConfig();
|
||||
|
||||
// 示例:注册自定义事件
|
||||
// MainWindow.Instance.SomeEvent += OnSomeEvent;
|
||||
|
||||
LogHelper.WriteLogToFile($"插件 {Name} 初始化完成", LogHelper.LogType.Info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启用插件
|
||||
/// 在这里激活插件功能
|
||||
/// </summary>
|
||||
public override void Enable()
|
||||
{
|
||||
// 先调用基类方法,这样会设置插件状态和记录日志
|
||||
base.Enable();
|
||||
|
||||
// TODO: 在这里启用插件功能
|
||||
|
||||
LogHelper.WriteLogToFile($"插件 {Name} 已启用", LogHelper.LogType.Info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 禁用插件
|
||||
/// 在这里停用插件功能
|
||||
/// </summary>
|
||||
public override void Disable()
|
||||
{
|
||||
// 先调用基类方法,这样会设置插件状态和记录日志
|
||||
base.Disable();
|
||||
|
||||
// TODO: 在这里禁用插件功能
|
||||
|
||||
LogHelper.WriteLogToFile($"插件 {Name} 已禁用", LogHelper.LogType.Info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清理资源
|
||||
/// 在插件卸载时调用,清理资源
|
||||
/// </summary>
|
||||
public override void Cleanup()
|
||||
{
|
||||
// TODO: 在这里清理插件资源
|
||||
|
||||
// 示例:取消注册事件
|
||||
// MainWindow.Instance.SomeEvent -= OnSomeEvent;
|
||||
|
||||
// 示例:保存配置
|
||||
SaveConfig();
|
||||
|
||||
// 最后调用基类方法
|
||||
base.Cleanup();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 插件配置
|
||||
|
||||
/// <summary>
|
||||
/// 加载插件配置
|
||||
/// </summary>
|
||||
private void LoadConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
// TODO: 从文件或其他位置加载配置
|
||||
// 示例:
|
||||
// string configPath = Path.Combine(App.RootPath, "PluginConfigs", "YourPluginName.json");
|
||||
// if (File.Exists(configPath))
|
||||
// {
|
||||
// string json = File.ReadAllText(configPath);
|
||||
// YourConfig = Newtonsoft.Json.JsonConvert.DeserializeObject<YourConfigClass>(json);
|
||||
// }
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"加载插件配置时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存插件配置
|
||||
/// </summary>
|
||||
private void SaveConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
// TODO: 保存配置到文件或其他位置
|
||||
// 示例:
|
||||
// string configDir = Path.Combine(App.RootPath, "PluginConfigs");
|
||||
// if (!Directory.Exists(configDir))
|
||||
// {
|
||||
// Directory.CreateDirectory(configDir);
|
||||
// }
|
||||
// string configPath = Path.Combine(configDir, "YourPluginName.json");
|
||||
// string json = Newtonsoft.Json.JsonConvert.SerializeObject(YourConfig, Newtonsoft.Json.Formatting.Indented);
|
||||
// File.WriteAllText(configPath, json);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"保存插件配置时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 插件设置界面
|
||||
|
||||
/// <summary>
|
||||
/// 获取插件设置界面
|
||||
/// </summary>
|
||||
/// <returns>插件设置界面</returns>
|
||||
public override UserControl GetSettingsView()
|
||||
{
|
||||
// 创建插件设置界面
|
||||
return new PluginTemplateSettingsControl();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 插件功能方法
|
||||
|
||||
// TODO: 在这里添加插件的具体功能方法
|
||||
|
||||
/// <summary>
|
||||
/// 示例方法:执行一些功能
|
||||
/// </summary>
|
||||
public void DoSomething()
|
||||
{
|
||||
if (!IsEnabled) return;
|
||||
|
||||
try
|
||||
{
|
||||
// TODO: 实现你的功能
|
||||
MessageBox.Show("插件功能执行示例", "插件模板", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"执行插件功能时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插件设置控件
|
||||
/// </summary>
|
||||
public class PluginTemplateSettingsControl : UserControl
|
||||
{
|
||||
public PluginTemplateSettingsControl()
|
||||
{
|
||||
// 创建设置界面布局
|
||||
var panel = new StackPanel
|
||||
{
|
||||
Margin = new Thickness(10)
|
||||
};
|
||||
|
||||
// 添加标题
|
||||
panel.Children.Add(new TextBlock
|
||||
{
|
||||
Text = "插件模板设置",
|
||||
FontSize = 16,
|
||||
FontWeight = FontWeights.Bold,
|
||||
Margin = new Thickness(0, 0, 0, 10)
|
||||
});
|
||||
|
||||
// 添加说明文字
|
||||
panel.Children.Add(new TextBlock
|
||||
{
|
||||
Text = "这是一个示例设置界面,你可以在这里添加自己的设置控件。",
|
||||
TextWrapping = TextWrapping.Wrap,
|
||||
Margin = new Thickness(0, 0, 0, 15)
|
||||
});
|
||||
|
||||
// 添加示例设置选项
|
||||
var checkBox = new CheckBox
|
||||
{
|
||||
Content = "启用某项功能",
|
||||
Margin = new Thickness(0, 0, 0, 10)
|
||||
};
|
||||
panel.Children.Add(checkBox);
|
||||
|
||||
// 添加文本输入框
|
||||
panel.Children.Add(new TextBlock
|
||||
{
|
||||
Text = "设置项:",
|
||||
Margin = new Thickness(0, 5, 0, 5)
|
||||
});
|
||||
|
||||
panel.Children.Add(new TextBox
|
||||
{
|
||||
Margin = new Thickness(0, 0, 0, 10),
|
||||
Width = 200,
|
||||
HorizontalAlignment = HorizontalAlignment.Left
|
||||
});
|
||||
|
||||
// 添加按钮
|
||||
var button = new Button
|
||||
{
|
||||
Content = "保存设置",
|
||||
Padding = new Thickness(10, 5, 10, 5),
|
||||
Margin = new Thickness(0, 10, 0, 0),
|
||||
HorizontalAlignment = HorizontalAlignment.Left
|
||||
};
|
||||
|
||||
button.Click += (sender, e) =>
|
||||
{
|
||||
MessageBox.Show("设置已保存!", "插件模板", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
};
|
||||
|
||||
panel.Children.Add(button);
|
||||
|
||||
// 设置控件内容
|
||||
this.Content = panel;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,447 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<AssemblyName>InkCanvasForClass</AssemblyName>
|
||||
<IntermediateOutputPath>obj\Debug\</IntermediateOutputPath>
|
||||
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
|
||||
<MSBuildProjectExtensionsPath>C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\</MSBuildProjectExtensionsPath>
|
||||
<_TargetAssemblyProjectName>InkCanvasForClass</_TargetAssemblyProjectName>
|
||||
<RootNamespace>Ink_Canvas</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
<PropertyGroup>
|
||||
<RuntimeIdentifiers>win;win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>Ink_Canvas</RootNamespace>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>2</ApplicationRevision>
|
||||
<ApplicationVersion>2.0.2.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>false</BootstrapperEnabled>
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
<UseWPF>true</UseWPF>
|
||||
<Configurations>Debug;Release;x86 Debug</Configurations>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugType>embedded</DebugType>
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
<Prefer32Bit>True</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x86 Debug|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
<Prefer32Bit>True</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>embedded</DebugType>
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
<Prefer32Bit>True</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\icc.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DebugType>full</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x86 Debug|x86'">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DebugType>full</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<Title>InkCanvasForClass</Title>
|
||||
<Version>5.0.4</Version>
|
||||
<Authors>Dubi906w</Authors>
|
||||
<Product>InkCanvasForClass</Product>
|
||||
<Copyright>© Copyright HARKOTEK Studio 2024-now</Copyright>
|
||||
<PackageProjectUrl>https://icc.bliemhax.com</PackageProjectUrl>
|
||||
<FileVersion>bundled</FileVersion>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DebugType>full</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x86 Debug|ARM64'">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DebugType>full</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DebugType>full</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x86 Debug|x64'">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DebugType>full</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.manifest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" />
|
||||
<PackageReference Include="iNKORE.UI.WPF.Modern" Version="0.9.27" />
|
||||
<PackageReference Include="MdXaml" Version="1.27.0" />
|
||||
<PackageReference Include="Microsoft.Office.Interop.PowerPoint" Version="15.0.4420.1018" />
|
||||
<PackageReference Include="MicrosoftOfficeCore" Version="15.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NHotkey.Wpf" Version="3.0.0" />
|
||||
<PackageReference Include="OSVersionExt" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="IWshRuntimeLibrary">
|
||||
<Guid>{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
<COMReference Include="stdole">
|
||||
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
<COMReference Include="VBIDE">
|
||||
<Guid>{0002E157-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>5</VersionMajor>
|
||||
<VersionMinor>3</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\TimerDownNotice.wav" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="MainWindow.xaml~RF6c3144.TMP" />
|
||||
<None Remove="Resources\Cursors\Cursor.cur" />
|
||||
<None Remove="Resources\Cursors\Pen.cur" />
|
||||
<None Remove="Resources\DeveloperAvatars\aaaaaaccd.jpg" />
|
||||
<None Remove="Resources\DeveloperAvatars\Alan-CRL.png" />
|
||||
<None Remove="Resources\DeveloperAvatars\NetheriteBowl.png" />
|
||||
<None Remove="Resources\DeveloperAvatars\NotYoojun.png" />
|
||||
<None Remove="Resources\DeveloperAvatars\RaspberryKan.jpg" />
|
||||
<None Remove="Resources\DeveloperAvatars\wwei.png" />
|
||||
<None Remove="Resources\DeveloperAvatars\yuwenhui2020.png" />
|
||||
<None Remove="Resources\icc.ico" />
|
||||
<None Remove="Resources\Icons-png\AdmoxBooth.png" />
|
||||
<None Remove="Resources\Icons-png\AdmoxWhiteboard.png" />
|
||||
<None Remove="Resources\Icons-png\Donview.png" />
|
||||
<None Remove="Resources\Icons-png\EasiNote3.png" />
|
||||
<None Remove="Resources\Icons-png\HiteAnnotation.png" />
|
||||
<None Remove="Resources\Icons-png\HiteLightBoard.png" />
|
||||
<None Remove="Resources\Icons-png\ica.png" />
|
||||
<None Remove="Resources\Icons-png\icc-transparent-dark-small.png" />
|
||||
<None Remove="Resources\Icons-png\icc-transparent-dark.png" />
|
||||
<None Remove="Resources\Icons-png\icc-transparent.png" />
|
||||
<None Remove="Resources\Icons-png\icc.png" />
|
||||
<None Remove="Resources\Icons-png\idt.png" />
|
||||
<None Remove="Resources\Icons-png\InkCanvas.png" />
|
||||
<None Remove="Resources\Icons-png\kuanciya.png" />
|
||||
<None Remove="Resources\Icons-png\kuandogeyuanliangwo.png" />
|
||||
<None Remove="Resources\Icons-png\kuandoujiyanhuaji.png" />
|
||||
<None Remove="Resources\Icons-png\kuanneikuhuaji.png" />
|
||||
<None Remove="Resources\Icons-png\kuanshounvhuaji.png" />
|
||||
<None Remove="Resources\Icons-png\MaxHubWhiteboard.png" />
|
||||
<None Remove="Resources\Icons-png\Seewo2Annotation.png" />
|
||||
<None Remove="Resources\Icons-png\tiebahuaji.png" />
|
||||
<None Remove="Resources\Icons-png\transparent-grid.png" />
|
||||
<None Remove="Resources\Icons-png\VComYouJiao.png" />
|
||||
<None Remove="Resources\Icons-png\WenXiang.png" />
|
||||
<None Remove="Resources\Icons-png\YiYunVisualPresenter.png" />
|
||||
<None Remove="Resources\Icons-png\YiYunWhiteboard.png" />
|
||||
<None Remove="Resources\new-icons\chevron-left.png" />
|
||||
<None Remove="Resources\new-icons\end-slides-show.png" />
|
||||
<None Remove="Resources\new-icons\eye.png" />
|
||||
<None Remove="Resources\new-icons\hand-move.png" />
|
||||
<None Remove="Resources\new-icons\highlighter-white.png" />
|
||||
<None Remove="Resources\new-icons\multi-touch.png" />
|
||||
<None Remove="Resources\new-icons\osu-lazer-triangles.png" />
|
||||
<None Remove="Resources\new-icons\pen-white.png" />
|
||||
<None Remove="Resources\new-icons\rotate.png" />
|
||||
<None Remove="Resources\new-icons\unfold-chevron.png" />
|
||||
<None Remove="Resources\new-icons\zoom.png" />
|
||||
<None Remove="Resources\PresentationExample\bottombar-dark.png" />
|
||||
<None Remove="Resources\PresentationExample\bottombar-white.png" />
|
||||
<None Remove="Resources\PresentationExample\page.jpg" />
|
||||
<None Remove="Resources\PresentationExample\sidebar-dark.png" />
|
||||
<None Remove="Resources\PresentationExample\sidebar-white.png" />
|
||||
<None Remove="Resources\PresentationExample\toolbar.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\hardcodet.notifyicon.wpf\1.1.0\lib\net472\Hardcodet.NotifyIcon.Wpf.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\IACore.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\IALoader.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\IAWinFX.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\avalonedit\6.3.0.90\lib\net462\ICSharpCode.AvalonEdit.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\inkore.ui.wpf.modern\0.9.27\lib\net452\iNKORE.UI.WPF.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\inkore.ui.wpf.modern\0.9.27\lib\net452\iNKORE.UI.WPF.Modern.Controls.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\inkore.ui.wpf.modern\0.9.27\lib\net452\iNKORE.UI.WPF.Modern.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mdxaml\1.27.0\lib\net462\MdXaml.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mdxaml.plugins\1.27.0\lib\net462\MdXaml.Plugins.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Microsoft.CSharp.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\microsoft.office.interop.powerpoint\15.0.4420.1018\lib\net20\Microsoft.Office.Interop.PowerPoint.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Microsoft.VisualBasic.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\mscorlib.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades\netstandard.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\newtonsoft.json\13.0.3\lib\net45\Newtonsoft.Json.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\nhotkey\3.0.0\lib\net462\NHotkey.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\nhotkey.wpf\3.0.0\lib\net462\NHotkey.Wpf.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\microsoftofficecore\15.0.0\lib\net35\Office.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\osversionext\3.0.0\lib\net462\OSVersionExt.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\PresentationCore.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\PresentationFramework.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Core.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Data.DataSetExtensions.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Data.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Drawing.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.IO.Compression.FileSystem.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Net.Http.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Numerics.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Runtime.Serialization.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\system.valuetuple\4.5.0\ref\net47\System.ValueTuple.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Windows.Controls.Ribbon.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Windows.Forms.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Xaml.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Xml.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Xml.Linq.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\UIAutomationClient.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\UIAutomationClientsideProviders.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\UIAutomationProvider.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\UIAutomationTypes.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\WindowsBase.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\WindowsFormsIntegration.dll" />
|
||||
<ReferencePath Include="C:\Windows\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll">
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</ReferencePath>
|
||||
<ReferencePath Include="C:\Windows\assembly\GAC_MSIL\Microsoft.Vbe.Interop\15.0.0.0__71e9bce111e9429c\Microsoft.Vbe.Interop.dll">
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</ReferencePath>
|
||||
<ReferencePath Include="obj\Debug\net472\Interop.IWshRuntimeLibrary.dll">
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</ReferencePath>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\Debug\net472\MainWindow.g.cs" />
|
||||
<Compile Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\Debug\net472\Windows\CountdownTimerWindow.g.cs" />
|
||||
<Compile Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\Debug\net472\Windows\CycleProcessBar.g.cs" />
|
||||
<Compile Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\Debug\net472\Windows\HasNewUpdateWindow.g.cs" />
|
||||
<Compile Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\Debug\net472\Windows\NamesInputWindow.g.cs" />
|
||||
<Compile Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\Debug\net472\Windows\OperatingGuideWindow.g.cs" />
|
||||
<Compile Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\Debug\net472\Windows\RandWindow.g.cs" />
|
||||
<Compile Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\Debug\net472\Windows\YesOrNoNotificationWindow.g.cs" />
|
||||
<Compile Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\Debug\net472\App.g.cs" />
|
||||
<Compile Include="C:\Users\Administrator\Desktop\ICC CE\ICC CE main\community\Ink Canvas\obj\Debug\net472\GeneratedInternalTypeHelper.g.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
</Project>
|
||||
@@ -53,9 +53,75 @@
|
||||
<RoutedUICommand x:Key="HotKey_ChangeToPen3" Text=" " />
|
||||
<RoutedUICommand x:Key="HotKey_ChangeToPen4" Text=" " />
|
||||
<RoutedUICommand x:Key="HotKey_ChangeToPen5" Text=" " />
|
||||
<RoutedUICommand x:Key="HotKey_DrawLine" Text=" " />
|
||||
<RoutedUICommand x:Key="NothingWillHappened" Text=" " />
|
||||
</Window.Resources>
|
||||
<RoutedUICommand x:Key="HotKey_DrawLine" Text=" " />
|
||||
<RoutedUICommand x:Key="NothingWillHappened" Text=" " />
|
||||
|
||||
<!-- 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>
|
||||
<DataTrigger Binding="{Binding Tag}" Value="plugins">
|
||||
<Setter Property="Background" Value="#3b82f6"/>
|
||||
</DataTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<!--输入命令绑定-->
|
||||
<Window.InputBindings>
|
||||
<KeyBinding Gesture="Escape" Command="{StaticResource KeyExit}" />
|
||||
@@ -107,15 +173,308 @@
|
||||
<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">
|
||||
<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">
|
||||
<Grid>
|
||||
<ui:ScrollViewerEx Margin="0,80,0,50" VerticalScrollBarVisibility="Auto"
|
||||
PanningMode="VerticalOnly" ui:ThemeManager.RequestedTheme="Dark"
|
||||
ManipulationBoundaryFeedback="SCManipulationBoundaryFeedback"
|
||||
Name="SettingsPanelScrollViewer">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</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>
|
||||
<!-- Plugins -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavPlugins_Click" Tag="plugins" ToolTip="插件">
|
||||
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="18"/>
|
||||
</Button>
|
||||
<!-- 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">
|
||||
|
||||
<Border Margin="0,0,0,10" Height="100" CornerRadius="5" BorderBrush="#a1a1aa"
|
||||
@@ -221,22 +580,57 @@
|
||||
</ui:SimpleStackPanel>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<GroupBox Name="GroupBoxPlugins">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="插件管理" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="26" />
|
||||
</GroupBox.Header>
|
||||
<ui:SimpleStackPanel Spacing="6" Margin="0,10,0,0">
|
||||
<TextBlock TextWrapping="Wrap" Margin="0,0,0,10" Foreground="#fafafa">
|
||||
通过插件扩展InkCanvas的功能。您可以启用或禁用插件,或加载自定义插件。
|
||||
</TextBlock>
|
||||
<Button x:Name="BtnOpenPluginManager" Content="打开插件管理器"
|
||||
HorizontalAlignment="Left" Click="BtnOpenPluginManager_Click"
|
||||
Padding="15,5" Margin="0,10,0,0"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox>
|
||||
<GroupBox.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="启动" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="26" />
|
||||
</GroupBox.Header>
|
||||
<ui:SimpleStackPanel Spacing="6">
|
||||
<ui:ToggleSwitch OnContent="" OffContent="" Visibility="Collapsed"
|
||||
<ui:ToggleSwitch OnContent="" OffContent=""
|
||||
Name="ToggleSwitchIsAutoUpdate" Header="自动检查更新"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
Toggled="ToggleSwitchIsAutoUpdate_Toggled" />
|
||||
<ui:ToggleSwitch OnContent="" OffContent="" Visibility="Collapsed"
|
||||
<ui:ToggleSwitch OnContent="" OffContent=""
|
||||
Name="ToggleSwitchIsAutoUpdateWithSilence" Header="静默更新"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
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"
|
||||
Visibility="{Binding ElementName=ToggleSwitchIsAutoUpdateWithSilence, Path=Visibility}">
|
||||
Visibility="{Binding ElementName=ToggleSwitchIsAutoUpdateWithSilence, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ui:SimpleStackPanel Spacing="12">
|
||||
<TextBlock
|
||||
Text="# 关闭静默更新后,已完成安装包的下载后将会弹窗询问是否进行更新,开启静默更新后将会在安装包下载完成后每隔十分钟进行如下检测:①处于静默更新时间段内 ②未处于书写模式 ③未处于画板内。若以上检测通过即会关闭软件进行自动更新。"
|
||||
@@ -303,6 +697,23 @@
|
||||
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchShowCursor_Toggled" />
|
||||
</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">
|
||||
<TextBlock Foreground="#fafafa" Text="橡皮大小" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
@@ -361,6 +772,25 @@
|
||||
</ui:SimpleStackPanel>
|
||||
</ui:SimpleStackPanel>
|
||||
</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.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="手势" FontWeight="Bold" Foreground="#fafafa"
|
||||
@@ -460,7 +890,64 @@
|
||||
</CheckBox>
|
||||
</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>
|
||||
<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" />
|
||||
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchHighPrecisionLineStraighten"
|
||||
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchHighPrecisionLineStraighten_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<TextBlock Text="# 开启后,当绘制的直线超过设定长度阈值时,将自动调整为完美直线。灵敏度范围0.05-2.0,越小要求越严格,弯曲的线条越不容易被拉直;值越大越容易识别为直线。高精度模式下,每隔10像素取一个计数点,获取更准确的平均值用于判断。" 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>
|
||||
</GroupBox>
|
||||
<GroupBox Name="GroupBoxAppearanceNewUI">
|
||||
@@ -485,6 +972,15 @@
|
||||
<ComboBoxItem Content="贴吧滑稽" FontFamily="Microsoft YaHei UI" />
|
||||
</ComboBox>
|
||||
</ui:SimpleStackPanel>
|
||||
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,6,0,0">
|
||||
<TextBlock Foreground="#fafafa" Text="自定义浮动栏图标" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Button Name="ButtonAddCustomIcon" Content="上传" FontFamily="Microsoft YaHei UI"
|
||||
Click="ButtonAddCustomIcon_Click" Padding="10,3"/>
|
||||
<Button Name="ButtonManageCustomIcons" Content="管理" FontFamily="Microsoft YaHei UI"
|
||||
Click="ButtonManageCustomIcons_Click" Padding="10,3" Margin="5,0,0,0"/>
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="浮动工具栏缩放" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
@@ -1163,7 +1659,14 @@
|
||||
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchIsLogEnabled_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<TextBlock Text="# 日志文件超过 512 KB 时会自动删除。" 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="ToggleSwitchIsSaveLogByDate"
|
||||
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchIsSaveLogByDate_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<TextBlock Text="# 日志文件超过 512 KB 时会自动删除。开启日期保存后,日志将保存在Logs文件夹中,当文件夹大小超过5MB时自动清空。" TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="关闭软件时二次弹窗确认" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
@@ -1781,6 +2284,17 @@
|
||||
FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchAutoSaveStrokesAtScreenshot_Toggled" />
|
||||
</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="ToggleSwitchSaveFullPageStrokes" IsOn="False"
|
||||
FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchSaveFullPageStrokes_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<TextBlock Text="# 开启后自动保存和手动保存墨迹时将以全屏模式保存而非单独保存每条墨迹" 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">
|
||||
@@ -1854,6 +2368,23 @@
|
||||
<TextBlock Foreground="#fafafa" Text="天" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="8,0,0,0" />
|
||||
</ui:SimpleStackPanel>
|
||||
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46"
|
||||
StrokeThickness="1" Margin="0,8,0,8" />
|
||||
|
||||
<TextBlock Margin="0,0,0,8" Text="收纳模式" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="20" />
|
||||
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="退出收纳模式时自动切换至批注模式"
|
||||
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
|
||||
<ui:ToggleSwitch OnContent="" OffContent=""
|
||||
Name="ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode"
|
||||
IsOn="False" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
|
||||
<TextBlock Text="# 开启后,退出收纳模式时将自动切换至批注模式,便于快速批注" TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
</ui:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Name="GroupBoxRandWindow">
|
||||
@@ -1861,7 +2392,7 @@
|
||||
<TextBlock Margin="0,12,0,0" Text="随机点名" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="26" />
|
||||
</GroupBox.Header>
|
||||
<ui:SimpleStackPanel Spacing="6">
|
||||
<ui:SimpleStackPanel Spacing="12">
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="显示修改随机点名名单的按钮"
|
||||
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
|
||||
@@ -1871,6 +2402,47 @@
|
||||
FontWeight="Bold"
|
||||
Toggled="ToggleSwitchDisplayRandWindowNamesInputBtn_OnToggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
|
||||
<TextBlock Foreground="#fafafa" Text="点名窗口背景设置"
|
||||
FontSize="16" FontWeight="Bold" Margin="0,10,0,5" />
|
||||
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,5,0,0">
|
||||
<TextBlock Foreground="#fafafa" Text="背景选择:" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxPickNameBackground" FontFamily="Microsoft YaHei UI"
|
||||
SelectedIndex="0" Width="180"
|
||||
SelectionChanged="ComboBoxPickNameBackground_SelectionChanged">
|
||||
<ComboBoxItem Content="默认背景" FontFamily="Microsoft YaHei UI" />
|
||||
<!-- 自定义背景会在代码中动态添加 -->
|
||||
</ComboBox>
|
||||
</ui:SimpleStackPanel>
|
||||
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,5,0,0">
|
||||
<TextBlock Foreground="#fafafa" Text="自定义背景:" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Button Name="ButtonAddCustomBackground" Content="上传" FontFamily="Microsoft YaHei UI"
|
||||
Click="ButtonAddCustomBackground_Click" Padding="10,3"/>
|
||||
<Button Name="ButtonManageBackgrounds" Content="管理" FontFamily="Microsoft YaHei UI"
|
||||
Click="ButtonManageBackgrounds_Click" Padding="10,3" Margin="5,0,0,0"/>
|
||||
</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>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="直接调用Ci点名"
|
||||
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
|
||||
<ui:ToggleSwitch OnContent="" OffContent=""
|
||||
Name="ToggleSwitchDirectCallCiRand"
|
||||
IsOn="False" FontFamily="Microsoft YaHei UI"
|
||||
FontWeight="Bold"
|
||||
Toggled="ToggleSwitchDirectCallCiRand_Toggled" />
|
||||
</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">
|
||||
@@ -1912,7 +2484,7 @@
|
||||
<ui:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock FontSize="18" FontWeight="Bold" Text="Version:" />
|
||||
<TextBlock x:Name="AppVersionTextBlock" FontSize="18" FontWeight="Bold"
|
||||
Text="5.X.X.X" />
|
||||
Text="1.X.X.X" />
|
||||
</ui:SimpleStackPanel>
|
||||
<TextBlock
|
||||
Text="# 使用和分发本软件前,请您应当且务必知晓相关开源协议,且您应当知晓本软件基于 https://github.com/WXRIW/Ink-Canvas 修改而成。"
|
||||
@@ -2212,10 +2784,10 @@
|
||||
</Grid>
|
||||
<ui:SimpleStackPanel Spacing="3" Orientation="Vertical">
|
||||
<TextBlock
|
||||
Text="© 2024 Dubi906w(Kriastans) 版权所有" FontWeight="Bold"
|
||||
Text="© 2025 CJK_mkp 版权所有" FontWeight="Bold"
|
||||
TextWrapping="Wrap" Foreground="White" />
|
||||
<TextBlock
|
||||
Text="© 2022-2024 HarkoTek Studio 提供技术支持"
|
||||
Text="© 2022-2025 HarkoTek Studio 提供技术支持"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
<TextBlock
|
||||
Text="We love Open-Source forever!" FontWeight="Bold"
|
||||
@@ -2226,55 +2798,41 @@
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</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">
|
||||
<TextBlock Foreground="White" Margin="25,-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>
|
||||
<Grid VerticalAlignment="Bottom" Height="50">
|
||||
<Button FontFamily="Microsoft YaHei UI"
|
||||
|
||||
<!-- 底部按钮区域 -->
|
||||
<Grid Grid.Row="2" VerticalAlignment="Bottom" Height="50">
|
||||
<Button FontFamily="Microsoft YaHei UI"
|
||||
Width="120" Margin="10"
|
||||
HorizontalAlignment="Right"
|
||||
Content="关闭"
|
||||
Click="BtnSettings_Click" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
Click="BtnCloseSettings_Click">
|
||||
<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="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>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
<!--// 黑/白 板幕布 //-->
|
||||
<Grid Name="GridBackgroundCoverHolder">
|
||||
<Grid Name="GridBackgroundCover" Visibility="Collapsed" Background="#1F1F1F">
|
||||
@@ -2287,7 +2845,7 @@
|
||||
<Grid Name="GridTransparencyFakeBackground" Opacity="0" />
|
||||
<Label Name="Label" Visibility="Collapsed" Foreground="Gray" Content="0" />
|
||||
<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"
|
||||
TouchMove="inkCanvas_TouchMove"
|
||||
ManipulationDelta="Main_Grid_ManipulationDelta"
|
||||
@@ -3115,7 +3673,7 @@
|
||||
TickFrequency="1" TickPlacement="None"
|
||||
ValueChanged="HighlighterWidthSlider_ValueChanged" />
|
||||
<TextBlock
|
||||
Text="{Binding Value, ElementName=HighlighterWidthSlider, Mode=OneWay}"
|
||||
Text="{Binding Value, ElementName=BoardHighlighterWidthSlider, Mode=OneWay}"
|
||||
FontFamily="Consolas"
|
||||
VerticalAlignment="Bottom"
|
||||
Margin="10,0,0,4.5" FontSize="15" />
|
||||
@@ -4292,7 +4850,7 @@
|
||||
<Label Content="计时器" FontSize="8"
|
||||
HorizontalAlignment="Center" />
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel MouseDown="Border_MouseDown"
|
||||
<ui:SimpleStackPanel x:Name="RandomDrawPanel" Visibility="Collapsed" MouseDown="Border_MouseDown"
|
||||
MouseUp="SymbolIconRand_MouseUp"
|
||||
Margin="0,0,0,0" Height="38" Width="32"
|
||||
Orientation="Vertical">
|
||||
@@ -4312,7 +4870,7 @@
|
||||
<Label Content="随机抽" FontSize="8"
|
||||
HorizontalAlignment="Center" />
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel MouseDown="Border_MouseDown"
|
||||
<ui:SimpleStackPanel x:Name="SingleDrawPanel" Visibility="Collapsed" MouseDown="Border_MouseDown"
|
||||
MouseUp="SymbolIconRandOne_MouseUp"
|
||||
Margin="0,0,0,0" Height="38" Width="32"
|
||||
Orientation="Vertical">
|
||||
@@ -6437,6 +6995,9 @@
|
||||
</ui:SimpleStackPanel>
|
||||
</ui:SimpleStackPanel>
|
||||
<Grid Width="0">
|
||||
<Grid x:Name="BackgroundPaletteGrid" Margin="-203,-128,83,37">
|
||||
<!-- 背景面板将在代码中动态添加 -->
|
||||
</Grid>
|
||||
<Border Visibility="Visible" ClipToBounds="True" Name="EraserSizePanel"
|
||||
Margin="-203,-128,83,37" CornerRadius="5" Background="#fafafa" Opacity="1"
|
||||
BorderBrush="#2563eb" BorderThickness="1">
|
||||
@@ -7285,4 +7846,4 @@
|
||||
</Border>
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
</Window>
|
||||
</Window>
|
||||
|
||||
@@ -17,6 +17,13 @@ using System.Drawing;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Win32;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Reflection;
|
||||
using Brushes = System.Windows.Media.Brushes;
|
||||
using Point = System.Windows.Point;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
@@ -98,6 +105,12 @@ namespace Ink_Canvas {
|
||||
|
||||
CheckColorTheme(true);
|
||||
CheckPenTypeUIState();
|
||||
|
||||
// 注册输入事件
|
||||
inkCanvas.PreviewMouseDown += inkCanvas_PreviewMouseDown;
|
||||
inkCanvas.StylusDown += inkCanvas_StylusDown;
|
||||
inkCanvas.TouchDown += inkCanvas_TouchDown;
|
||||
inkCanvas.TouchUp += inkCanvas_TouchUp;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -147,14 +160,9 @@ namespace Ink_Canvas {
|
||||
private void inkCanvas_EditingModeChanged(object sender, RoutedEventArgs e) {
|
||||
var inkCanvas1 = sender as InkCanvas;
|
||||
if (inkCanvas1 == null) return;
|
||||
if (Settings.Canvas.IsShowCursor) {
|
||||
if (inkCanvas1.EditingMode == InkCanvasEditingMode.Ink || drawingShapeMode != 0)
|
||||
inkCanvas1.ForceCursor = true;
|
||||
else
|
||||
inkCanvas1.ForceCursor = false;
|
||||
} else {
|
||||
inkCanvas1.ForceCursor = false;
|
||||
}
|
||||
|
||||
// 使用辅助方法设置光标
|
||||
SetCursorBasedOnEditingMode(inkCanvas1);
|
||||
|
||||
if (inkCanvas1.EditingMode == InkCanvasEditingMode.Ink) forcePointEraser = !forcePointEraser;
|
||||
}
|
||||
@@ -171,6 +179,16 @@ namespace Ink_Canvas {
|
||||
loadPenCanvas();
|
||||
//加载设置
|
||||
LoadSettings(true);
|
||||
|
||||
// 加载自定义背景颜色
|
||||
LoadCustomBackgroundColor();
|
||||
|
||||
// 注册设置面板滚动事件
|
||||
if (SettingsPanelScrollViewer != null)
|
||||
{
|
||||
SettingsPanelScrollViewer.ScrollChanged += SettingsPanelScrollViewer_ScrollChanged;
|
||||
}
|
||||
|
||||
// HasNewUpdateWindow hasNewUpdateWindow = new HasNewUpdateWindow();
|
||||
if (Environment.Is64BitProcess) GroupBoxInkRecognition.Visibility = Visibility.Collapsed;
|
||||
|
||||
@@ -192,6 +210,9 @@ namespace Ink_Canvas {
|
||||
new SolidColorBrush(System.Windows.Media.Color.FromArgb(127, 24, 24, 27));
|
||||
BtnRightWhiteBoardSwitchPreviousLabel.Opacity = 0.5;
|
||||
|
||||
// 应用颜色主题,这将考虑自定义背景色
|
||||
CheckColorTheme(true);
|
||||
|
||||
BtnWhiteBoardSwitchPrevious.IsEnabled = CurrentWhiteboardIndex != 1;
|
||||
BorderInkReplayToolBox.Visibility = Visibility.Collapsed;
|
||||
|
||||
@@ -205,13 +226,49 @@ namespace Ink_Canvas {
|
||||
// 自动收纳到侧边栏
|
||||
if (Settings.Startup.IsFoldAtStartup)
|
||||
{
|
||||
FoldFloatingBar_MouseUp(null, null);
|
||||
FoldFloatingBar_MouseUp(new object(), null);
|
||||
}
|
||||
|
||||
// 恢复崩溃后操作设置
|
||||
if (App.CrashAction == App.CrashActionType.SilentRestart)
|
||||
RadioCrashSilentRestart.IsChecked = true;
|
||||
else
|
||||
RadioCrashNoAction.IsChecked = true;
|
||||
|
||||
// 注册系统关机事件处理
|
||||
RegisterShutdownHandler();
|
||||
|
||||
// 设置默认为黑板模式
|
||||
Settings.Canvas.UsingWhiteboard = false;
|
||||
Settings.Canvas.CustomBackgroundColor = "#162924"; // 黑板默认颜色 RGB(22, 41, 36)
|
||||
SaveSettingsToFile();
|
||||
|
||||
// 如果当前不是黑板模式,则切换到黑板模式
|
||||
if (currentMode == 0)
|
||||
{
|
||||
// 延迟执行,确保UI已完全加载
|
||||
Dispatcher.BeginInvoke(new Action(() => {
|
||||
// 重新加载自定义背景颜色
|
||||
LoadCustomBackgroundColor();
|
||||
|
||||
// 模拟点击切换按钮进入黑板模式
|
||||
if (GridTransparencyFakeBackground.Background != Brushes.Transparent)
|
||||
{
|
||||
BtnSwitch_Click(BtnSwitch, null);
|
||||
}
|
||||
|
||||
// 确保背景颜色正确设置为黑板颜色
|
||||
CheckColorTheme(true);
|
||||
}), System.Windows.Threading.DispatcherPriority.Loaded);
|
||||
}
|
||||
|
||||
// 初始化插件系统
|
||||
InitializePluginSystem();
|
||||
}
|
||||
|
||||
private void SystemEventsOnDisplaySettingsChanged(object sender, EventArgs e) {
|
||||
if (!Settings.Advanced.IsEnableResolutionChangeDetection) return;
|
||||
ShowNotification($"检测到显示器信息变化,变为{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width}x{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height}");
|
||||
ShowNotification($"检测到显示器信息变化,变为{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width}x{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height})");
|
||||
new Thread(() => {
|
||||
var isFloatingBarOutsideScreen = false;
|
||||
var isInPPTPresentationMode = false;
|
||||
@@ -273,8 +330,8 @@ namespace Ink_Canvas {
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
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 (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})");
|
||||
@@ -290,30 +347,764 @@ namespace Ink_Canvas {
|
||||
SystemEvents.DisplaySettingsChanged -= SystemEventsOnDisplaySettingsChanged;
|
||||
|
||||
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() {
|
||||
AvailableLatestVersion = await AutoUpdateHelper.CheckForUpdates();
|
||||
// 使用当前选择的更新通道检查更新
|
||||
AvailableLatestVersion = await AutoUpdateHelper.CheckForUpdates(null, Settings.Startup.UpdateChannel);
|
||||
|
||||
// 声明下载状态变量,用于整个方法
|
||||
bool isDownloadSuccessful = false;
|
||||
|
||||
if (AvailableLatestVersion != null) {
|
||||
var IsDownloadSuccessful = false;
|
||||
IsDownloadSuccessful = await AutoUpdateHelper.DownloadSetupFileAndSaveStatus(AvailableLatestVersion);
|
||||
|
||||
if (IsDownloadSuccessful) {
|
||||
if (!Settings.Startup.IsAutoUpdateWithSilence) {
|
||||
if (MessageBox.Show("InkCanvasForClass 新版本安装包已下载完成,是否立即更新?",
|
||||
"InkCanvasForClass New Version Available", MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Question) ==
|
||||
MessageBoxResult.Yes) AutoUpdateHelper.InstallNewVersionApp(AvailableLatestVersion, false);
|
||||
} else {
|
||||
// 检测到新版本
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | New version available: {AvailableLatestVersion}");
|
||||
|
||||
// 检查是否是用户选择跳过的版本
|
||||
if (!string.IsNullOrEmpty(Settings.Startup.SkippedVersion) &&
|
||||
Settings.Startup.SkippedVersion == AvailableLatestVersion) {
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Version {AvailableLatestVersion} was marked to be skipped by the user");
|
||||
return; // 跳过此版本,不执行更新操作
|
||||
}
|
||||
|
||||
// 如果检测到的版本与跳过的版本不同,则清除跳过版本记录
|
||||
// 这确保用户只能跳过当前最新版本,而不是永久跳过所有更新
|
||||
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();
|
||||
} 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 {
|
||||
AutoUpdateHelper.DeleteUpdatesFolder();
|
||||
}
|
||||
}
|
||||
|
||||
// 新增:崩溃后操作设置按钮事件
|
||||
private void RadioCrashAction_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (RadioCrashSilentRestart != null && RadioCrashSilentRestart.IsChecked == true)
|
||||
{
|
||||
App.CrashAction = App.CrashActionType.SilentRestart;
|
||||
Settings.Startup.CrashAction = 0;
|
||||
}
|
||||
else if (RadioCrashNoAction != null && RadioCrashNoAction.IsChecked == true)
|
||||
{
|
||||
App.CrashAction = App.CrashActionType.NoAction;
|
||||
Settings.Startup.CrashAction = 1;
|
||||
}
|
||||
SaveSettingsToFile();
|
||||
// 强制同步全局变量,防止后台逻辑未及时感知
|
||||
App.SyncCrashActionFromSettings();
|
||||
}
|
||||
|
||||
// 添加一个辅助方法,根据当前编辑模式设置光标
|
||||
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
|
||||
|
||||
#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 async 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.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
// 确保UI完全更新
|
||||
await Dispatcher.InvokeAsync(() => {}, System.Windows.Threading.DispatcherPriority.Render);
|
||||
|
||||
// 根据传入的sectionTag滚动到相应的设置部分
|
||||
GroupBox targetGroupBox = null;
|
||||
|
||||
switch (sectionTag.ToLower())
|
||||
{
|
||||
case "startup":
|
||||
targetGroupBox = FindGroupBoxByHeader(stackPanel, "启动");
|
||||
break;
|
||||
case "canvas":
|
||||
targetGroupBox = FindGroupBoxByHeader(stackPanel, "画板和墨迹");
|
||||
break;
|
||||
case "gesture":
|
||||
targetGroupBox = FindGroupBoxByHeader(stackPanel, "手势");
|
||||
break;
|
||||
case "inkrecognition":
|
||||
targetGroupBox = GroupBoxInkRecognition;
|
||||
break;
|
||||
case "crashaction":
|
||||
targetGroupBox = FindGroupBoxByHeader(stackPanel, "崩溃后操作");
|
||||
break;
|
||||
case "ppt":
|
||||
targetGroupBox = FindGroupBoxByHeader(stackPanel, "PPT联动");
|
||||
break;
|
||||
case "advanced":
|
||||
targetGroupBox = FindGroupBoxByHeader(stackPanel, "高级设置");
|
||||
break;
|
||||
case "automation":
|
||||
targetGroupBox = FindGroupBoxByHeader(stackPanel, "自动化");
|
||||
break;
|
||||
case "randomwindow":
|
||||
targetGroupBox = GroupBoxRandWindow;
|
||||
break;
|
||||
case "theme":
|
||||
targetGroupBox = GroupBoxAppearanceNewUI;
|
||||
break;
|
||||
case "shortcuts":
|
||||
// 快捷键设置部分可能尚未实现
|
||||
targetGroupBox = FindGroupBoxByHeader(stackPanel, "快捷键");
|
||||
break;
|
||||
case "about":
|
||||
targetGroupBox = FindGroupBoxByHeader(stackPanel, "关于");
|
||||
break;
|
||||
case "plugins":
|
||||
targetGroupBox = GroupBoxPlugins;
|
||||
break;
|
||||
default:
|
||||
// 默认滚动到顶部
|
||||
SettingsPanelScrollViewer.ScrollToTop();
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果找到目标GroupBox,则滚动到它的位置
|
||||
if (targetGroupBox != null)
|
||||
{
|
||||
// 使用动画平滑滚动到目标位置
|
||||
ScrollToElement(targetGroupBox);
|
||||
|
||||
// 高亮显示当前选中的导航项
|
||||
UpdateNavigationButtonState(sectionTag);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果没有找到目标GroupBox,则滚动到顶部
|
||||
SettingsPanelScrollViewer.ScrollToTop();
|
||||
}
|
||||
}
|
||||
|
||||
// 根据Header文本查找GroupBox
|
||||
private GroupBox FindGroupBoxByHeader(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))
|
||||
{
|
||||
return groupBox;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 平滑滚动到指定元素
|
||||
private async void ScrollToElement(FrameworkElement element)
|
||||
{
|
||||
if (element == null || SettingsPanelScrollViewer == null) return;
|
||||
|
||||
try
|
||||
{
|
||||
// 暂时禁用滚动事件处理
|
||||
SettingsPanelScrollViewer.ScrollChanged -= SettingsPanelScrollViewer_ScrollChanged;
|
||||
|
||||
// 记录当前滚动位置
|
||||
double originalOffset = SettingsPanelScrollViewer.VerticalOffset;
|
||||
|
||||
// 将ScrollViewer内部的位置信息重置到顶部(不会触发视觉更新)
|
||||
SettingsPanelScrollViewer.ScrollToHome();
|
||||
|
||||
// 使用Dispatcher进行延迟处理,确保布局更新
|
||||
await Dispatcher.InvokeAsync(() => {
|
||||
try
|
||||
{
|
||||
// 强制更新布局
|
||||
SettingsPanelScrollViewer.UpdateLayout();
|
||||
|
||||
// 获取元素相对于顶部的准确位置
|
||||
Point elementPosition = element.TransformToAncestor(SettingsPanelScrollViewer).Transform(new Point(0, 0));
|
||||
|
||||
// 计算目标位置,减去一些偏移,使元素不会贴在顶部
|
||||
double targetPosition = elementPosition.Y - 20;
|
||||
|
||||
// 确保目标位置不小于0
|
||||
targetPosition = Math.Max(0, targetPosition);
|
||||
|
||||
// 直接设置滚动位置,不使用动画
|
||||
SettingsPanelScrollViewer.ScrollToVerticalOffset(targetPosition);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 如果出现异常,恢复到原来的滚动位置
|
||||
SettingsPanelScrollViewer.ScrollToVerticalOffset(originalOffset);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// 重新启用滚动事件处理
|
||||
SettingsPanelScrollViewer.ScrollChanged += SettingsPanelScrollViewer_ScrollChanged;
|
||||
}
|
||||
}, System.Windows.Threading.DispatcherPriority.Render);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 确保在异常情况下也重新启用滚动事件处理
|
||||
SettingsPanelScrollViewer.ScrollChanged += SettingsPanelScrollViewer_ScrollChanged;
|
||||
}
|
||||
}
|
||||
|
||||
// 滚动条变化事件处理
|
||||
private void SettingsPanelScrollViewer_ScrollChanged(object sender, System.Windows.Controls.ScrollChangedEventArgs e)
|
||||
{
|
||||
// 可以在这里添加滚动事件的处理逻辑,如果需要的话
|
||||
}
|
||||
|
||||
// 更新导航按钮状态
|
||||
private void UpdateNavigationButtonState(string activeTag)
|
||||
{
|
||||
// 清除所有导航按钮的Tag属性
|
||||
ClearAllNavButtonTags();
|
||||
|
||||
// 设置当前活动按钮的Tag属性
|
||||
switch (activeTag.ToLower())
|
||||
{
|
||||
case "startup":
|
||||
SetNavButtonTag("startup");
|
||||
break;
|
||||
case "canvas":
|
||||
SetNavButtonTag("canvas");
|
||||
break;
|
||||
case "gesture":
|
||||
SetNavButtonTag("gesture");
|
||||
break;
|
||||
case "inkrecognition":
|
||||
SetNavButtonTag("inkrecognition");
|
||||
break;
|
||||
case "crashaction":
|
||||
SetNavButtonTag("crashaction");
|
||||
break;
|
||||
case "ppt":
|
||||
SetNavButtonTag("ppt");
|
||||
break;
|
||||
case "advanced":
|
||||
SetNavButtonTag("advanced");
|
||||
break;
|
||||
case "automation":
|
||||
SetNavButtonTag("automation");
|
||||
break;
|
||||
case "randomwindow":
|
||||
SetNavButtonTag("randomwindow");
|
||||
break;
|
||||
case "theme":
|
||||
SetNavButtonTag("theme");
|
||||
break;
|
||||
case "shortcuts":
|
||||
SetNavButtonTag("shortcuts");
|
||||
break;
|
||||
case "about":
|
||||
SetNavButtonTag("about");
|
||||
break;
|
||||
case "plugins":
|
||||
SetNavButtonTag("plugins");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 清除所有导航按钮的Tag属性
|
||||
private void ClearAllNavButtonTags()
|
||||
{
|
||||
var grid = BorderSettings.Child as Grid;
|
||||
if (grid == null) return;
|
||||
|
||||
var navSidebar = grid.Children[0] as Border;
|
||||
if (navSidebar == null) return;
|
||||
|
||||
var navGrid = navSidebar.Child as Grid;
|
||||
if (navGrid == null) return;
|
||||
|
||||
var scrollViewer = navGrid.Children[1] as ScrollViewer;
|
||||
if (scrollViewer == null) return;
|
||||
|
||||
var stackPanel = scrollViewer.Content as StackPanel;
|
||||
if (stackPanel == null) return;
|
||||
|
||||
foreach (var child in stackPanel.Children)
|
||||
{
|
||||
if (child is Button button)
|
||||
{
|
||||
button.Tag = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 设置导航按钮的Tag属性
|
||||
private void SetNavButtonTag(string tag)
|
||||
{
|
||||
var grid = BorderSettings.Child as Grid;
|
||||
if (grid == null) return;
|
||||
|
||||
var navSidebar = grid.Children[0] as Border;
|
||||
if (navSidebar == null) return;
|
||||
|
||||
var navGrid = navSidebar.Child as Grid;
|
||||
if (navGrid == null) return;
|
||||
|
||||
var scrollViewer = navGrid.Children[1] as ScrollViewer;
|
||||
if (scrollViewer == null) return;
|
||||
|
||||
var stackPanel = scrollViewer.Content as StackPanel;
|
||||
if (stackPanel == null) return;
|
||||
|
||||
foreach (var child in stackPanel.Children)
|
||||
{
|
||||
if (child is Button button)
|
||||
{
|
||||
// 检查按钮的ToolTip属性,根据tag设置对应的按钮
|
||||
string buttonTag = button.Tag as string;
|
||||
|
||||
// 如果按钮的Tag与要设置的tag匹配,则设置Tag
|
||||
if (buttonTag != null && buttonTag.ToLower() == tag.ToLower())
|
||||
{
|
||||
button.Tag = tag;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 根据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
|
||||
|
||||
// 添加插件系统初始化方法
|
||||
private void InitializePluginSystem()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 初始化插件管理器
|
||||
Helpers.Plugins.PluginManager.Instance.Initialize();
|
||||
LogHelper.WriteLogToFile("插件系统已初始化", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"初始化插件系统时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
// 添加插件管理导航点击事件处理
|
||||
private void NavPlugins_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowSettingsSection("plugins");
|
||||
}
|
||||
|
||||
// 添加打开插件管理器按钮点击事件
|
||||
private void BtnOpenPluginManager_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 暂时隐藏设置面板
|
||||
BorderSettings.Visibility = Visibility.Hidden;
|
||||
BorderSettingsMask.Visibility = Visibility.Hidden;
|
||||
|
||||
// 创建并显示插件设置窗口
|
||||
Windows.PluginSettingsWindow pluginSettingsWindow = new Windows.PluginSettingsWindow();
|
||||
|
||||
// 设置窗口关闭事件,用于在插件管理窗口关闭后恢复设置面板
|
||||
pluginSettingsWindow.Closed += (s, args) =>
|
||||
{
|
||||
// 恢复设置面板显示
|
||||
BorderSettings.Visibility = Visibility.Visible;
|
||||
BorderSettingsMask.Visibility = Visibility.Visible;
|
||||
};
|
||||
|
||||
// 显示插件设置窗口
|
||||
pluginSettingsWindow.ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 确保在发生错误时也恢复设置面板显示
|
||||
BorderSettings.Visibility = Visibility.Visible;
|
||||
BorderSettingsMask.Visibility = Visibility.Visible;
|
||||
|
||||
LogHelper.WriteLogToFile($"打开插件管理器时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show($"打开插件管理器时出错: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ namespace Ink_Canvas {
|
||||
|
||||
// FloatingBarIcons_MouseUp_New(sender);
|
||||
if (sender == null)
|
||||
foldFloatingBarByUser = true;
|
||||
foldFloatingBarByUser = false;
|
||||
else
|
||||
foldFloatingBarByUser = true;
|
||||
unfoldFloatingBarByUser = false;
|
||||
@@ -91,6 +91,7 @@ namespace Ink_Canvas {
|
||||
RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
|
||||
LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
|
||||
RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
|
||||
GridForFloatingBarDraging.Visibility = Visibility.Collapsed;
|
||||
ViewboxFloatingBarMarginAnimation(-60);
|
||||
HideSubPanels("cursor");
|
||||
SidePannelMarginAnimation(-10);
|
||||
@@ -217,6 +218,13 @@ namespace Ink_Canvas {
|
||||
await Task.Delay(0);
|
||||
|
||||
await Dispatcher.InvokeAsync(() => {
|
||||
// 根据设置决定是否自动切换至批注模式
|
||||
if (Settings.Automation.IsAutoEnterAnnotationModeWhenExitFoldMode && currentMode == 0)
|
||||
{
|
||||
// 切换至批注模式
|
||||
PenIcon_Click(null, null);
|
||||
}
|
||||
|
||||
if (StackPanelPPTControls.Visibility == Visibility.Visible)
|
||||
{
|
||||
var dops = Settings.PowerPointSettings.PPTButtonsDisplayOption.ToString();
|
||||
|
||||
@@ -107,6 +107,7 @@ namespace Ink_Canvas {
|
||||
if (Settings.Automation.IsAutoSaveStrokesAtClear &&
|
||||
inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber) SaveScreenShot(true);
|
||||
if (CurrentWhiteboardIndex >= WhiteboardTotalCount) {
|
||||
// 在最后一页时,点击“新页面”按钮直接新增一页
|
||||
BtnWhiteBoardAdd_Click(sender, e);
|
||||
return;
|
||||
}
|
||||
@@ -166,64 +167,35 @@ namespace Ink_Canvas {
|
||||
TextBlockWhiteBoardIndexInfo.Text =
|
||||
$"{CurrentWhiteboardIndex}/{WhiteboardTotalCount}";
|
||||
|
||||
if (CurrentWhiteboardIndex == WhiteboardTotalCount) {
|
||||
var newImageSource = new BitmapImage();
|
||||
newImageSource.BeginInit();
|
||||
newImageSource.UriSource = new Uri("/Resources/Icons-Fluent/ic_fluent_add_circle_24_regular.png",
|
||||
UriKind.RelativeOrAbsolute);
|
||||
newImageSource.EndInit();
|
||||
//BoardLeftPannelNextPage.Source = newImageSource;
|
||||
//BoardRightPannelNextPage.Source = newImageSource;
|
||||
//BoardRightPannelNextPageTextBlock.Text = "加页";
|
||||
//BoardLeftPannelNextPageTextBlock.Text = "加页";
|
||||
} else {
|
||||
var newImageSource = new BitmapImage();
|
||||
newImageSource.BeginInit();
|
||||
newImageSource.UriSource =
|
||||
new Uri("/Resources/Icons-Fluent/ic_fluent_arrow_circle_right_24_regular.png",
|
||||
UriKind.RelativeOrAbsolute);
|
||||
newImageSource.EndInit();
|
||||
//BoardLeftPannelNextPage.Source = newImageSource;
|
||||
//BoardRightPannelNextPage.Source = newImageSource;
|
||||
//BoardRightPannelNextPageTextBlock.Text = "下一页";
|
||||
//BoardLeftPannelNextPageTextBlock.Text = "下一页";
|
||||
}
|
||||
bool isLastPage = CurrentWhiteboardIndex == WhiteboardTotalCount;
|
||||
bool isMaxPage = WhiteboardTotalCount >= 99;
|
||||
|
||||
// 设置按钮文本
|
||||
BtnLeftWhiteBoardSwitchNextLabel.Text = isLastPage ? "新页面" : "下一页";
|
||||
BtnRightWhiteBoardSwitchNextLabel.Text = isLastPage ? "新页面" : "下一页";
|
||||
|
||||
// 始终允许点击“下一页/新页面”按钮(除非已达最大页数)
|
||||
BtnWhiteBoardSwitchNext.IsEnabled = !isMaxPage;
|
||||
|
||||
// 保持按钮常亮(高亮)
|
||||
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;
|
||||
|
||||
BtnWhiteBoardSwitchPrevious.IsEnabled = true;
|
||||
BtnWhiteBoardSwitchNext.IsEnabled = true;
|
||||
|
||||
if (CurrentWhiteboardIndex == 1) {
|
||||
BtnWhiteBoardSwitchPrevious.IsEnabled = false;
|
||||
BtnLeftWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
|
||||
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));
|
||||
BtnRightWhiteBoardSwitchPreviousLabel.Opacity = 0.5;
|
||||
BtnRightWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
||||
BtnRightWhiteBoardSwitchNextLabel.Opacity = 1;
|
||||
} else {
|
||||
BtnLeftWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
||||
BtnLeftWhiteBoardSwitchPreviousLabel.Opacity = 1;
|
||||
|
||||
BtnRightWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
||||
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;
|
||||
|
||||
@@ -1,30 +1,693 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Controls.Primitives;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
private void BoardChangeBackgroundColorBtn_MouseUp(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
|
||||
// 创建背景选项面板(如果不存在)
|
||||
if (BackgroundPalette == null)
|
||||
{
|
||||
CreateBackgroundPalette();
|
||||
}
|
||||
|
||||
// 显示或隐藏背景选项面板
|
||||
if (BackgroundPalette != null)
|
||||
{
|
||||
if (BackgroundPalette.Visibility == Visibility.Visible)
|
||||
{
|
||||
// 如果面板已经显示,则隐藏它
|
||||
AnimationsHelper.HideWithSlideAndFade(BackgroundPalette);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 隐藏其他可能显示的面板
|
||||
AnimationsHelper.HideWithSlideAndFade(EraserSizePanel);
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
|
||||
AnimationsHelper.HideWithSlideAndFade(PenPalette);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardPenPalette);
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderDrawShape);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardBorderDrawShape);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardEraserSizePanel);
|
||||
AnimationsHelper.HideWithSlideAndFade(TwoFingerGestureBorder);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardTwoFingerGestureBorder);
|
||||
|
||||
// 显示背景选项面板
|
||||
AnimationsHelper.ShowWithSlideFromBottomAndFade(BackgroundPalette);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 原有的背景切换代码
|
||||
Settings.Canvas.UsingWhiteboard = !Settings.Canvas.UsingWhiteboard;
|
||||
SaveSettingsToFile();
|
||||
if (Settings.Canvas.UsingWhiteboard) {
|
||||
if (inkColor == 5) lastBoardInkColor = 0;
|
||||
ICCWaterMarkDark.Visibility = Visibility.Visible;
|
||||
ICCWaterMarkWhite.Visibility = Visibility.Collapsed;
|
||||
|
||||
// 设置为白板默认背景色
|
||||
Color defaultWhiteboardColor = Color.FromRgb(234, 235, 237);
|
||||
|
||||
if (currentMode == 1) // 白板模式
|
||||
{
|
||||
// 设置背景为默认白板背景色
|
||||
GridBackgroundCover.Background = new SolidColorBrush(defaultWhiteboardColor);
|
||||
|
||||
// 更新RGB滑块的值为默认白板背景色
|
||||
if (BackgroundPalette != null && BackgroundPalette.Visibility == Visibility.Visible)
|
||||
{
|
||||
UpdateRGBSliders(defaultWhiteboardColor);
|
||||
}
|
||||
|
||||
// 更新自定义背景色为默认白板背景色
|
||||
CustomBackgroundColor = defaultWhiteboardColor;
|
||||
|
||||
// 保存到设置
|
||||
string colorHex = $"#{defaultWhiteboardColor.R:X2}{defaultWhiteboardColor.G:X2}{defaultWhiteboardColor.B:X2}";
|
||||
Settings.Canvas.CustomBackgroundColor = colorHex;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
// 设置墨迹颜色为黑色
|
||||
CheckLastColor(0);
|
||||
forceEraser = false;
|
||||
}
|
||||
else {
|
||||
if (inkColor == 0) lastBoardInkColor = 5;
|
||||
ICCWaterMarkWhite.Visibility = Visibility.Visible;
|
||||
ICCWaterMarkDark.Visibility = Visibility.Collapsed;
|
||||
|
||||
// 设置为黑板默认背景色
|
||||
Color defaultBlackboardColor = Color.FromRgb(22, 41, 36);
|
||||
|
||||
if (currentMode == 1) // 黑板模式
|
||||
{
|
||||
// 设置背景为默认黑板背景色
|
||||
GridBackgroundCover.Background = new SolidColorBrush(defaultBlackboardColor);
|
||||
|
||||
// 更新RGB滑块的值为默认黑板背景色
|
||||
if (BackgroundPalette != null && BackgroundPalette.Visibility == Visibility.Visible)
|
||||
{
|
||||
UpdateRGBSliders(defaultBlackboardColor);
|
||||
}
|
||||
|
||||
// 更新自定义背景色为默认黑板背景色
|
||||
CustomBackgroundColor = defaultBlackboardColor;
|
||||
|
||||
// 保存到设置
|
||||
string colorHex = $"#{defaultBlackboardColor.R:X2}{defaultBlackboardColor.G:X2}{defaultBlackboardColor.B:X2}";
|
||||
Settings.Canvas.CustomBackgroundColor = colorHex;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
// 设置墨迹颜色为白色
|
||||
CheckLastColor(5);
|
||||
forceEraser = false;
|
||||
}
|
||||
|
||||
CheckColorTheme(true);
|
||||
}
|
||||
|
||||
// 创建背景选项面板
|
||||
private void CreateBackgroundPalette()
|
||||
{
|
||||
// 确保加载自定义背景色
|
||||
LoadCustomBackgroundColor();
|
||||
|
||||
// 创建一个类似于PenPalette的面板
|
||||
BackgroundPalette = new Border
|
||||
{
|
||||
Name = "BackgroundPalette",
|
||||
Visibility = Visibility.Collapsed,
|
||||
Background = new SolidColorBrush(Colors.White),
|
||||
Opacity = 1,
|
||||
BorderBrush = new SolidColorBrush(Color.FromRgb(0x25, 0x63, 0xeb)),
|
||||
BorderThickness = new Thickness(1),
|
||||
CornerRadius = new CornerRadius(8),
|
||||
Width = 300,
|
||||
MaxHeight = 400
|
||||
};
|
||||
|
||||
// 确保面板显示在顶层
|
||||
System.Windows.Controls.Panel.SetZIndex(BackgroundPalette, 1000);
|
||||
|
||||
// 创建面板内容
|
||||
var stackPanel = new StackPanel();
|
||||
|
||||
// 创建标题栏
|
||||
var titleBorder = new Border
|
||||
{
|
||||
BorderBrush = new SolidColorBrush(Color.FromRgb(0x1e, 0x3a, 0x8a)),
|
||||
Height = 32,
|
||||
BorderThickness = new Thickness(0, 0, 0, 1),
|
||||
CornerRadius = new CornerRadius(8, 8, 0, 0),
|
||||
Background = new SolidColorBrush(Color.FromRgb(0x25, 0x63, 0xeb)),
|
||||
Margin = new Thickness(-1, -1, -1, 0),
|
||||
Padding = new Thickness(1, 1, 1, 0)
|
||||
};
|
||||
|
||||
var titleCanvas = new System.Windows.Controls.Canvas { Height = 24, ClipToBounds = true };
|
||||
var titleText = new TextBlock
|
||||
{
|
||||
Text = "背景设置",
|
||||
Foreground = new SolidColorBrush(Colors.White),
|
||||
Padding = new Thickness(0, 5, 0, 0),
|
||||
FontSize = 11,
|
||||
FontWeight = FontWeights.Bold,
|
||||
TextAlignment = TextAlignment.Center
|
||||
};
|
||||
System.Windows.Controls.Canvas.SetLeft(titleText, 8);
|
||||
titleCanvas.Children.Add(titleText);
|
||||
|
||||
// 关闭按钮
|
||||
var closeImage = new System.Windows.Controls.Image
|
||||
{
|
||||
Source = new System.Windows.Media.Imaging.BitmapImage(new Uri("/Resources/new-icons/close-white.png", UriKind.Relative)),
|
||||
Height = 16,
|
||||
Width = 16
|
||||
};
|
||||
RenderOptions.SetBitmapScalingMode(closeImage, BitmapScalingMode.HighQuality);
|
||||
closeImage.MouseUp += CloseBordertools_MouseUp;
|
||||
System.Windows.Controls.Canvas.SetRight(closeImage, 8);
|
||||
System.Windows.Controls.Canvas.SetTop(closeImage, 4);
|
||||
titleCanvas.Children.Add(closeImage);
|
||||
|
||||
titleBorder.Child = titleCanvas;
|
||||
stackPanel.Children.Add(titleBorder);
|
||||
|
||||
// 创建背景选项内容区域
|
||||
var contentPanel = new StackPanel { Margin = new Thickness(8) };
|
||||
|
||||
// 黑板/白板选择
|
||||
var modeTitle = new TextBlock
|
||||
{
|
||||
Text = "白板模式",
|
||||
Foreground = new SolidColorBrush(Color.FromRgb(0x17, 0x25, 0x54)),
|
||||
FontSize = 10,
|
||||
FontWeight = FontWeights.Bold,
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
Margin = new Thickness(0, 4, 0, 8)
|
||||
};
|
||||
contentPanel.Children.Add(modeTitle);
|
||||
|
||||
var modePanel = new StackPanel { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Center };
|
||||
|
||||
// 白板按钮
|
||||
var whiteboardButton = new Border
|
||||
{
|
||||
Width = 60,
|
||||
Height = 30,
|
||||
Background = Settings.Canvas.UsingWhiteboard ? new SolidColorBrush(Color.FromRgb(0x25, 0x63, 0xeb)) : new SolidColorBrush(Colors.LightGray),
|
||||
CornerRadius = new CornerRadius(4),
|
||||
Margin = new Thickness(0, 0, 8, 0)
|
||||
};
|
||||
var whiteboardText = new TextBlock
|
||||
{
|
||||
Text = "白板",
|
||||
Foreground = Settings.Canvas.UsingWhiteboard ? new SolidColorBrush(Colors.White) : new SolidColorBrush(Colors.Black),
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
whiteboardButton.Child = whiteboardText;
|
||||
whiteboardButton.MouseUp += (s, args) => {
|
||||
Settings.Canvas.UsingWhiteboard = true;
|
||||
SaveSettingsToFile();
|
||||
ICCWaterMarkDark.Visibility = Visibility.Visible;
|
||||
ICCWaterMarkWhite.Visibility = Visibility.Collapsed;
|
||||
|
||||
// 设置为白板默认背景色
|
||||
Color defaultWhiteboardColor = Color.FromRgb(234, 235, 237);
|
||||
|
||||
if (currentMode == 1) // 白板模式
|
||||
{
|
||||
// 设置背景为默认白板背景色
|
||||
GridBackgroundCover.Background = new SolidColorBrush(defaultWhiteboardColor);
|
||||
|
||||
// 更新RGB滑块的值为默认白板背景色
|
||||
UpdateRGBSliders(defaultWhiteboardColor);
|
||||
|
||||
// 更新自定义背景色为默认白板背景色
|
||||
CustomBackgroundColor = defaultWhiteboardColor;
|
||||
|
||||
// 保存到设置
|
||||
string colorHex = $"#{defaultWhiteboardColor.R:X2}{defaultWhiteboardColor.G:X2}{defaultWhiteboardColor.B:X2}";
|
||||
Settings.Canvas.CustomBackgroundColor = colorHex;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
// 设置墨迹颜色为黑色
|
||||
CheckLastColor(0);
|
||||
forceEraser = false;
|
||||
|
||||
CheckColorTheme(true);
|
||||
UpdateBackgroundButtonsState();
|
||||
};
|
||||
modePanel.Children.Add(whiteboardButton);
|
||||
|
||||
// 黑板按钮
|
||||
var blackboardButton = new Border
|
||||
{
|
||||
Width = 60,
|
||||
Height = 30,
|
||||
Background = !Settings.Canvas.UsingWhiteboard ? new SolidColorBrush(Color.FromRgb(0x25, 0x63, 0xeb)) : new SolidColorBrush(Colors.LightGray),
|
||||
CornerRadius = new CornerRadius(4)
|
||||
};
|
||||
var blackboardText = new TextBlock
|
||||
{
|
||||
Text = "黑板",
|
||||
Foreground = !Settings.Canvas.UsingWhiteboard ? new SolidColorBrush(Colors.White) : new SolidColorBrush(Colors.Black),
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
blackboardButton.Child = blackboardText;
|
||||
blackboardButton.MouseUp += (s, args) => {
|
||||
Settings.Canvas.UsingWhiteboard = false;
|
||||
SaveSettingsToFile();
|
||||
ICCWaterMarkWhite.Visibility = Visibility.Visible;
|
||||
ICCWaterMarkDark.Visibility = Visibility.Collapsed;
|
||||
|
||||
// 设置为黑板默认背景色
|
||||
Color defaultBlackboardColor = Color.FromRgb(22, 41, 36);
|
||||
|
||||
if (currentMode == 1) // 黑板模式
|
||||
{
|
||||
// 设置背景为默认黑板背景色
|
||||
GridBackgroundCover.Background = new SolidColorBrush(defaultBlackboardColor);
|
||||
|
||||
// 更新RGB滑块的值为默认黑板背景色
|
||||
UpdateRGBSliders(defaultBlackboardColor);
|
||||
|
||||
// 更新自定义背景色为默认黑板背景色
|
||||
CustomBackgroundColor = defaultBlackboardColor;
|
||||
|
||||
// 保存到设置
|
||||
string colorHex = $"#{defaultBlackboardColor.R:X2}{defaultBlackboardColor.G:X2}{defaultBlackboardColor.B:X2}";
|
||||
Settings.Canvas.CustomBackgroundColor = colorHex;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
// 设置墨迹颜色为白色
|
||||
CheckLastColor(5);
|
||||
forceEraser = false;
|
||||
|
||||
CheckColorTheme(true);
|
||||
UpdateBackgroundButtonsState();
|
||||
};
|
||||
modePanel.Children.Add(blackboardButton);
|
||||
|
||||
contentPanel.Children.Add(modePanel);
|
||||
|
||||
// 添加一条分隔线
|
||||
var separator = new Border
|
||||
{
|
||||
Height = 1,
|
||||
Background = new SolidColorBrush(Color.FromRgb(0xd4, 0xd4, 0xd8)),
|
||||
Margin = new Thickness(0, 12, 0, 12)
|
||||
};
|
||||
contentPanel.Children.Add(separator);
|
||||
|
||||
// 添加RGB颜色选择器部分
|
||||
var colorTitle = new TextBlock
|
||||
{
|
||||
Text = "背景颜色",
|
||||
Foreground = new SolidColorBrush(Color.FromRgb(0x17, 0x25, 0x54)),
|
||||
FontSize = 10,
|
||||
FontWeight = FontWeights.Bold,
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
Margin = new Thickness(0, 4, 0, 8)
|
||||
};
|
||||
contentPanel.Children.Add(colorTitle);
|
||||
|
||||
// 创建颜色预览
|
||||
Border colorPreview = new Border
|
||||
{
|
||||
Width = 100,
|
||||
Height = 40,
|
||||
BorderThickness = new Thickness(1),
|
||||
BorderBrush = new SolidColorBrush(Color.FromRgb(0xd4, 0xd4, 0xd8)),
|
||||
Background = new SolidColorBrush(Colors.White),
|
||||
CornerRadius = new CornerRadius(4),
|
||||
Margin = new Thickness(0, 0, 0, 10),
|
||||
HorizontalAlignment = HorizontalAlignment.Center
|
||||
};
|
||||
contentPanel.Children.Add(colorPreview);
|
||||
|
||||
// 获取当前背景颜色
|
||||
Color currentBackgroundColor;
|
||||
if (currentMode == 1) // 白板或黑板模式
|
||||
{
|
||||
if (GridBackgroundCover.Background is SolidColorBrush brush)
|
||||
{
|
||||
currentBackgroundColor = brush.Color;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 默认颜色
|
||||
currentBackgroundColor = Settings.Canvas.UsingWhiteboard ?
|
||||
Color.FromRgb(234, 235, 237) : // 白板默认颜色
|
||||
Color.FromRgb(22, 41, 36); // 黑板默认颜色
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 默认白色
|
||||
currentBackgroundColor = Colors.White;
|
||||
}
|
||||
|
||||
// 更新颜色预览
|
||||
colorPreview.Background = new SolidColorBrush(currentBackgroundColor);
|
||||
|
||||
// 先创建所有滑块控件
|
||||
// R滑块和文本框
|
||||
var rPanel = new StackPanel { Orientation = Orientation.Horizontal, Margin = new Thickness(10, 0, 10, 5) };
|
||||
var rLabel = new TextBlock { Text = "R:", Width = 20, VerticalAlignment = VerticalAlignment.Center };
|
||||
var rSlider = new System.Windows.Controls.Slider
|
||||
{
|
||||
Minimum = 0,
|
||||
Maximum = 255,
|
||||
Value = currentBackgroundColor.R,
|
||||
Width = 150,
|
||||
Margin = new Thickness(5, 0, 5, 0),
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
var rValueText = new TextBlock
|
||||
{
|
||||
Text = currentBackgroundColor.R.ToString(),
|
||||
Width = 30,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
TextAlignment = TextAlignment.Right
|
||||
};
|
||||
|
||||
// G滑块和文本框
|
||||
var gPanel = new StackPanel { Orientation = Orientation.Horizontal, Margin = new Thickness(10, 0, 10, 5) };
|
||||
var gLabel = new TextBlock { Text = "G:", Width = 20, VerticalAlignment = VerticalAlignment.Center };
|
||||
var gSlider = new System.Windows.Controls.Slider
|
||||
{
|
||||
Minimum = 0,
|
||||
Maximum = 255,
|
||||
Value = currentBackgroundColor.G,
|
||||
Width = 150,
|
||||
Margin = new Thickness(5, 0, 5, 0),
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
var gValueText = new TextBlock
|
||||
{
|
||||
Text = currentBackgroundColor.G.ToString(),
|
||||
Width = 30,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
TextAlignment = TextAlignment.Right
|
||||
};
|
||||
|
||||
// B滑块和文本框
|
||||
var bPanel = new StackPanel { Orientation = Orientation.Horizontal, Margin = new Thickness(10, 0, 10, 5) };
|
||||
var bLabel = new TextBlock { Text = "B:", Width = 20, VerticalAlignment = VerticalAlignment.Center };
|
||||
var bSlider = new System.Windows.Controls.Slider
|
||||
{
|
||||
Minimum = 0,
|
||||
Maximum = 255,
|
||||
Value = currentBackgroundColor.B,
|
||||
Width = 150,
|
||||
Margin = new Thickness(5, 0, 5, 0),
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
var bValueText = new TextBlock
|
||||
{
|
||||
Text = currentBackgroundColor.B.ToString(),
|
||||
Width = 30,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
TextAlignment = TextAlignment.Right
|
||||
};
|
||||
|
||||
// 现在添加事件处理程序
|
||||
rSlider.ValueChanged += (s, e) => {
|
||||
int value = (int)e.NewValue;
|
||||
rValueText.Text = value.ToString();
|
||||
UpdateColorPreview(colorPreview, rSlider, gSlider, bSlider);
|
||||
};
|
||||
|
||||
gSlider.ValueChanged += (s, e) => {
|
||||
int value = (int)e.NewValue;
|
||||
gValueText.Text = value.ToString();
|
||||
UpdateColorPreview(colorPreview, rSlider, gSlider, bSlider);
|
||||
};
|
||||
|
||||
bSlider.ValueChanged += (s, e) => {
|
||||
int value = (int)e.NewValue;
|
||||
bValueText.Text = value.ToString();
|
||||
UpdateColorPreview(colorPreview, rSlider, gSlider, bSlider);
|
||||
};
|
||||
|
||||
// 添加控件到面板
|
||||
rPanel.Children.Add(rLabel);
|
||||
rPanel.Children.Add(rSlider);
|
||||
rPanel.Children.Add(rValueText);
|
||||
contentPanel.Children.Add(rPanel);
|
||||
|
||||
gPanel.Children.Add(gLabel);
|
||||
gPanel.Children.Add(gSlider);
|
||||
gPanel.Children.Add(gValueText);
|
||||
contentPanel.Children.Add(gPanel);
|
||||
|
||||
bPanel.Children.Add(bLabel);
|
||||
bPanel.Children.Add(bSlider);
|
||||
bPanel.Children.Add(bValueText);
|
||||
contentPanel.Children.Add(bPanel);
|
||||
|
||||
// 应用按钮
|
||||
var applyButton = new Button
|
||||
{
|
||||
Content = "应用颜色",
|
||||
Margin = new Thickness(0, 10, 0, 0),
|
||||
Padding = new Thickness(10, 5, 10, 5),
|
||||
Background = new SolidColorBrush(Color.FromRgb(0x25, 0x63, 0xeb)),
|
||||
Foreground = new SolidColorBrush(Colors.White),
|
||||
BorderThickness = new Thickness(0),
|
||||
HorizontalAlignment = HorizontalAlignment.Center
|
||||
};
|
||||
|
||||
applyButton.Click += (s, e) => {
|
||||
Color selectedColor = Color.FromRgb(
|
||||
(byte)rSlider.Value,
|
||||
(byte)gSlider.Value,
|
||||
(byte)bSlider.Value
|
||||
);
|
||||
ApplyCustomBackgroundColor(selectedColor);
|
||||
};
|
||||
|
||||
contentPanel.Children.Add(applyButton);
|
||||
|
||||
stackPanel.Children.Add(contentPanel);
|
||||
|
||||
// 将面板添加到父容器
|
||||
BackgroundPalette.Child = stackPanel;
|
||||
|
||||
// 获取主窗口中的根网格,确保面板添加到顶层
|
||||
Grid mainGrid = FindName("Main_Grid") as Grid;
|
||||
if (mainGrid != null)
|
||||
{
|
||||
// 删除可能已存在的BackgroundPalette
|
||||
foreach (UIElement element in mainGrid.Children)
|
||||
{
|
||||
if (element is Border border && border.Name == "BackgroundPalette")
|
||||
{
|
||||
mainGrid.Children.Remove(border);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 重新定位面板
|
||||
BackgroundPalette.HorizontalAlignment = HorizontalAlignment.Center;
|
||||
BackgroundPalette.VerticalAlignment = VerticalAlignment.Center;
|
||||
BackgroundPalette.Margin = new Thickness(0, 0, 0, 0);
|
||||
|
||||
// 添加到主网格
|
||||
mainGrid.Children.Add(BackgroundPalette);
|
||||
|
||||
// 设置面板位置
|
||||
var clickElement = FindName("BoardChangeBackgroundColorBtn") as FrameworkElement;
|
||||
if (clickElement != null)
|
||||
{
|
||||
Point position = clickElement.TranslatePoint(new Point(0, 0), mainGrid);
|
||||
BackgroundPalette.Margin = new Thickness(
|
||||
position.X - 150,
|
||||
position.Y + clickElement.ActualHeight + 5,
|
||||
0, 0);
|
||||
BackgroundPalette.HorizontalAlignment = HorizontalAlignment.Left;
|
||||
BackgroundPalette.VerticalAlignment = VerticalAlignment.Top;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新背景按钮状态
|
||||
private void UpdateBackgroundButtonsState()
|
||||
{
|
||||
if (BackgroundPalette != null && BackgroundPalette.Child is StackPanel stackPanel)
|
||||
{
|
||||
if (stackPanel.Children.Count > 1 && stackPanel.Children[1] is StackPanel contentPanel)
|
||||
{
|
||||
if (contentPanel.Children.Count > 1 && contentPanel.Children[1] is StackPanel modePanel)
|
||||
{
|
||||
if (modePanel.Children.Count > 1)
|
||||
{
|
||||
var whiteboardButton = modePanel.Children[0] as Border;
|
||||
var blackboardButton = modePanel.Children[1] as Border;
|
||||
|
||||
if (whiteboardButton != null && whiteboardButton.Child is TextBlock whiteboardText)
|
||||
{
|
||||
whiteboardButton.Background = Settings.Canvas.UsingWhiteboard ?
|
||||
new SolidColorBrush(Color.FromRgb(0x25, 0x63, 0xeb)) :
|
||||
new SolidColorBrush(Colors.LightGray);
|
||||
whiteboardText.Foreground = Settings.Canvas.UsingWhiteboard ?
|
||||
new SolidColorBrush(Colors.White) :
|
||||
new SolidColorBrush(Colors.Black);
|
||||
}
|
||||
|
||||
if (blackboardButton != null && blackboardButton.Child is TextBlock blackboardText)
|
||||
{
|
||||
blackboardButton.Background = !Settings.Canvas.UsingWhiteboard ?
|
||||
new SolidColorBrush(Color.FromRgb(0x25, 0x63, 0xeb)) :
|
||||
new SolidColorBrush(Colors.LightGray);
|
||||
blackboardText.Foreground = !Settings.Canvas.UsingWhiteboard ?
|
||||
new SolidColorBrush(Colors.White) :
|
||||
new SolidColorBrush(Colors.Black);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 添加成员变量保存背景面板引用
|
||||
private Border BackgroundPalette { get; set; }
|
||||
|
||||
// 添加成员变量保存当前自定义背景色
|
||||
private Color? CustomBackgroundColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新颜色预览框的颜色
|
||||
/// </summary>
|
||||
private void UpdateColorPreview(Border colorPreview, System.Windows.Controls.Slider rSlider, System.Windows.Controls.Slider gSlider, System.Windows.Controls.Slider bSlider)
|
||||
{
|
||||
Color previewColor = Color.FromRgb(
|
||||
(byte)rSlider.Value,
|
||||
(byte)gSlider.Value,
|
||||
(byte)bSlider.Value
|
||||
);
|
||||
colorPreview.Background = new SolidColorBrush(previewColor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应用自定义背景颜色
|
||||
/// </summary>
|
||||
private void ApplyCustomBackgroundColor(Color color)
|
||||
{
|
||||
// 保存当前选择的颜色
|
||||
CustomBackgroundColor = color;
|
||||
|
||||
// 将颜色转换为十六进制字符串并保存到设置中
|
||||
string colorHex = $"#{color.R:X2}{color.G:X2}{color.B:X2}";
|
||||
Settings.Canvas.CustomBackgroundColor = colorHex;
|
||||
|
||||
// 只在白板或黑板模式下应用自定义背景色
|
||||
if (currentMode == 1) // 白板或黑板模式
|
||||
{
|
||||
// 设置白板/黑板模式下的背景
|
||||
GridBackgroundCover.Background = new SolidColorBrush(color);
|
||||
}
|
||||
|
||||
// 保存设置
|
||||
SaveSettingsToFile();
|
||||
|
||||
// 立即更新界面
|
||||
if (BackgroundPalette != null)
|
||||
{
|
||||
UpdateBackgroundButtonsState();
|
||||
UpdateRGBSliders(color); // 更新RGB滑块的值
|
||||
}
|
||||
|
||||
// 显示提示信息
|
||||
ShowNotification($"已应用自定义背景色: {colorHex}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从设置中加载自定义背景色
|
||||
/// </summary>
|
||||
private void LoadCustomBackgroundColor()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Settings.Canvas.CustomBackgroundColor))
|
||||
{
|
||||
try
|
||||
{
|
||||
// 解析颜色字符串
|
||||
string colorHex = Settings.Canvas.CustomBackgroundColor;
|
||||
if (colorHex.StartsWith("#") && colorHex.Length == 7) // #RRGGBB 格式
|
||||
{
|
||||
byte r = Convert.ToByte(colorHex.Substring(1, 2), 16);
|
||||
byte g = Convert.ToByte(colorHex.Substring(3, 2), 16);
|
||||
byte b = Convert.ToByte(colorHex.Substring(5, 2), 16);
|
||||
|
||||
// 保存到内存中
|
||||
CustomBackgroundColor = Color.FromRgb(r, g, b);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 解析失败,根据当前模式设置默认颜色
|
||||
if (!Settings.Canvas.UsingWhiteboard)
|
||||
{
|
||||
// 黑板模式默认颜色
|
||||
CustomBackgroundColor = Color.FromRgb(22, 41, 36);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 白板模式默认颜色
|
||||
CustomBackgroundColor = Color.FromRgb(234, 235, 237);
|
||||
}
|
||||
|
||||
// 可以在这里记录日志
|
||||
Console.WriteLine($"解析自定义背景色失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果没有设置自定义背景色,根据当前模式设置默认颜色
|
||||
if (!Settings.Canvas.UsingWhiteboard)
|
||||
{
|
||||
// 黑板模式默认颜色
|
||||
CustomBackgroundColor = Color.FromRgb(22, 41, 36);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 白板模式默认颜色
|
||||
CustomBackgroundColor = Color.FromRgb(234, 235, 237);
|
||||
}
|
||||
}
|
||||
|
||||
// 只在白板或黑板模式下应用自定义背景色
|
||||
if (currentMode == 1 && CustomBackgroundColor.HasValue) // 白板或黑板模式
|
||||
{
|
||||
// 设置白板/黑板模式下的背景
|
||||
GridBackgroundCover.Background = new SolidColorBrush(CustomBackgroundColor.Value);
|
||||
|
||||
// 更新RGB滑块的值(如果调色板已经创建)
|
||||
if (BackgroundPalette != null && BackgroundPalette.Visibility == Visibility.Visible)
|
||||
{
|
||||
UpdateRGBSliders(CustomBackgroundColor.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BoardEraserIcon_Click(object sender, RoutedEventArgs e) {
|
||||
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint ||
|
||||
inkCanvas.EditingMode == InkCanvasEditingMode.EraseByStroke) {
|
||||
@@ -36,42 +699,10 @@ namespace Ink_Canvas {
|
||||
} else {
|
||||
forceEraser = true;
|
||||
forcePointEraser = true;
|
||||
double k = 1;
|
||||
if (Settings.Canvas.EraserShapeType == 0) {
|
||||
switch (BoardComboBoxEraserSize.SelectedIndex)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
// 使用统一的方法应用橡皮擦形状,确保一致性
|
||||
ApplyCurrentEraserShape();
|
||||
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
|
||||
drawingShapeMode = 0;
|
||||
|
||||
@@ -122,5 +753,59 @@ namespace Ink_Canvas {
|
||||
ImageBlackboard_MouseUp(null, null);
|
||||
Process.Start("https://www.desmos.com/calculator?lang=zh-CN");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据当前背景颜色更新RGB滑块的值
|
||||
/// </summary>
|
||||
private void UpdateRGBSliders(Color color)
|
||||
{
|
||||
if (BackgroundPalette != null && BackgroundPalette.Child is StackPanel stackPanel)
|
||||
{
|
||||
if (stackPanel.Children.Count > 1 && stackPanel.Children[1] is StackPanel contentPanel)
|
||||
{
|
||||
// 查找RGB滑块
|
||||
System.Windows.Controls.Slider rSlider = null;
|
||||
System.Windows.Controls.Slider gSlider = null;
|
||||
System.Windows.Controls.Slider bSlider = null;
|
||||
|
||||
// 遍历面板查找RGB滑块
|
||||
foreach (var child in contentPanel.Children)
|
||||
{
|
||||
if (child is StackPanel panel && panel.Orientation == Orientation.Horizontal)
|
||||
{
|
||||
foreach (var panelChild in panel.Children)
|
||||
{
|
||||
if (panelChild is System.Windows.Controls.Slider slider)
|
||||
{
|
||||
if (panel.Children.Count > 0 && panel.Children[0] is TextBlock label)
|
||||
{
|
||||
if (label.Text == "R:")
|
||||
{
|
||||
rSlider = slider;
|
||||
}
|
||||
else if (label.Text == "G:")
|
||||
{
|
||||
gSlider = slider;
|
||||
}
|
||||
else if (label.Text == "B:")
|
||||
{
|
||||
bSlider = slider;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新滑块值
|
||||
if (rSlider != null && gSlider != null && bSlider != null)
|
||||
{
|
||||
rSlider.Value = color.R;
|
||||
gSlider.Value = color.G;
|
||||
bSlider.Value = color.B;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,14 +70,24 @@ namespace Ink_Canvas {
|
||||
if (changeColorTheme)
|
||||
if (currentMode != 0) {
|
||||
if (Settings.Canvas.UsingWhiteboard) {
|
||||
GridBackgroundCover.Background = new SolidColorBrush(Color.FromRgb(234, 235, 237));
|
||||
// 检查是否有自定义背景色,如果有则使用自定义背景色
|
||||
if (CustomBackgroundColor.HasValue) {
|
||||
GridBackgroundCover.Background = new SolidColorBrush(CustomBackgroundColor.Value);
|
||||
} else {
|
||||
GridBackgroundCover.Background = new SolidColorBrush(Color.FromRgb(234, 235, 237));
|
||||
}
|
||||
WaterMarkTime.Foreground = new SolidColorBrush(Color.FromRgb(22, 41, 36));
|
||||
WaterMarkDate.Foreground = new SolidColorBrush(Color.FromRgb(22, 41, 36));
|
||||
BlackBoardWaterMark.Foreground = new SolidColorBrush(Color.FromRgb(22, 41, 36));
|
||||
isUselightThemeColor = false;
|
||||
}
|
||||
else {
|
||||
GridBackgroundCover.Background = new SolidColorBrush(Color.FromRgb(22, 41, 36));
|
||||
// 黑板模式下,检查是否有自定义背景色
|
||||
if (CustomBackgroundColor.HasValue) {
|
||||
GridBackgroundCover.Background = new SolidColorBrush(CustomBackgroundColor.Value);
|
||||
} else {
|
||||
GridBackgroundCover.Background = new SolidColorBrush(Color.FromRgb(22, 41, 36));
|
||||
}
|
||||
WaterMarkTime.Foreground = new SolidColorBrush(Color.FromRgb(234, 235, 237));
|
||||
WaterMarkDate.Foreground = new SolidColorBrush(Color.FromRgb(234, 235, 237));
|
||||
BlackBoardWaterMark.Foreground = new SolidColorBrush(Color.FromRgb(234, 235, 237));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Helpers;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
@@ -23,6 +23,7 @@ using System.Text;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Xml.Linq;
|
||||
using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
@@ -280,8 +281,16 @@ namespace Ink_Canvas {
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderDrawShape);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardBorderLeftPageListView);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardBorderRightPageListView);
|
||||
|
||||
// 隐藏背景设置面板
|
||||
var bgPalette = LogicalTreeHelper.FindLogicalNode(this, "BackgroundPalette") as Border;
|
||||
if (bgPalette != null)
|
||||
{
|
||||
AnimationsHelper.HideWithSlideAndFade(bgPalette);
|
||||
}
|
||||
|
||||
if (BorderSettings.Visibility == Visibility.Visible) {
|
||||
// 设置蒙版为不可点击,并移除背景
|
||||
BorderSettingsMask.IsHitTestVisible = false;
|
||||
BorderSettingsMask.Background = null;
|
||||
var sb = new Storyboard();
|
||||
@@ -403,6 +412,11 @@ namespace Ink_Canvas {
|
||||
System.Windows.Controls.Canvas.SetLeft(FloatingbarSelectionBG, 28 * 5);
|
||||
break;
|
||||
}
|
||||
case "shape": {
|
||||
// 对图形模式进行特殊处理,不修改按钮UI状态
|
||||
// 只隐藏相关面板,但保持图形绘制模式
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -485,7 +499,7 @@ namespace Ink_Canvas {
|
||||
RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
|
||||
LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
|
||||
RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
|
||||
//进入黑板
|
||||
//進入黑板
|
||||
|
||||
/*
|
||||
if (Not_Enter_Blackboard_fir_Mouse_Click) {// BUG-Fixed_tmp:程序启动后直接进入白板会导致后续撤销功能、退出白板无法恢复墨迹
|
||||
@@ -501,7 +515,6 @@ namespace Ink_Canvas {
|
||||
Application.Current.Dispatcher.Invoke(() => { ViewboxFloatingBarMarginAnimation(60); });
|
||||
})).Start();
|
||||
|
||||
HideSubPanels();
|
||||
if (GridTransparencyFakeBackground.Background == Brushes.Transparent)
|
||||
{
|
||||
if (currentMode == 1)
|
||||
@@ -514,6 +527,11 @@ namespace Ink_Canvas {
|
||||
}
|
||||
|
||||
BtnHideInkCanvas_Click(BtnHideInkCanvas, null);
|
||||
HideSubPanels();
|
||||
}
|
||||
else
|
||||
{
|
||||
HideSubPanels();
|
||||
}
|
||||
|
||||
if (Settings.Gesture.AutoSwitchTwoFingerGesture) // 自动关闭多指书写、开启双指移动
|
||||
@@ -574,6 +592,15 @@ namespace Ink_Canvas {
|
||||
if (dopsc[2] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(LeftSidePanelForPPTNavigation);
|
||||
if (dopsc[3] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(RightSidePanelForPPTNavigation);
|
||||
}
|
||||
// 修复PPT放映时点击白板按钮后翻页按钮不显示的问题
|
||||
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible)
|
||||
{
|
||||
// 强制显示PPT翻页按钮
|
||||
LeftBottomPanelForPPTNavigation.Visibility = Visibility.Visible;
|
||||
RightBottomPanelForPPTNavigation.Visibility = Visibility.Visible;
|
||||
LeftSidePanelForPPTNavigation.Visibility = Visibility.Visible;
|
||||
RightSidePanelForPPTNavigation.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
if (Settings.Automation.IsAutoSaveStrokesAtClear &&
|
||||
inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber) SaveScreenShot(true);
|
||||
@@ -727,9 +754,11 @@ namespace Ink_Canvas {
|
||||
}
|
||||
|
||||
private void SymbolIconRand_MouseUp(object sender, MouseButtonEventArgs e) {
|
||||
// 如果控件被隐藏,不处理事件
|
||||
if (RandomDrawPanel.Visibility != Visibility.Visible) return;
|
||||
|
||||
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
|
||||
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
|
||||
@@ -795,18 +824,37 @@ namespace Ink_Canvas {
|
||||
}
|
||||
|
||||
private void SymbolIconRandOne_MouseUp(object sender, MouseButtonEventArgs e) {
|
||||
// 如果控件被隐藏,不处理事件
|
||||
if (SingleDrawPanel.Visibility != Visibility.Visible) return;
|
||||
|
||||
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
|
||||
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
|
||||
|
||||
new RandWindow(Settings,true).ShowDialog();
|
||||
// 检查是否启用了直接调用ClassIsland点名功能
|
||||
if (Settings.RandSettings.DirectCallCiRand) {
|
||||
try {
|
||||
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo {
|
||||
FileName = "classisland://plugins/IslandCaller/Run",
|
||||
UseShellExecute = true
|
||||
});
|
||||
}
|
||||
catch (Exception ex) {
|
||||
MessageBox.Show("无法调用ClassIsland点名:" + ex.Message);
|
||||
|
||||
// 调用失败时回退到默认的随机点名窗口
|
||||
new RandWindow(Settings, true).ShowDialog();
|
||||
}
|
||||
} else {
|
||||
// 使用默认的随机点名窗口
|
||||
new RandWindow(Settings, true).ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void GridInkReplayButton_MouseUp(object sender, MouseButtonEventArgs e) {
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
//if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
|
||||
@@ -1061,15 +1109,38 @@ namespace Ink_Canvas {
|
||||
var windowHandle = new WindowInteropHelper(this).Handle;
|
||||
var screen = System.Windows.Forms.Screen.FromHandle(windowHandle);
|
||||
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
|
||||
var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight -
|
||||
SystemParameters.WindowCaptionHeight;
|
||||
// 仅计算Windows任务栏高度,不考虑其他程序对工作区的影响
|
||||
var toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY);
|
||||
pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2;
|
||||
|
||||
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)
|
||||
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 (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) {
|
||||
@@ -1124,12 +1195,22 @@ namespace Ink_Canvas {
|
||||
var windowHandle = new WindowInteropHelper(this).Handle;
|
||||
var screen = System.Windows.Forms.Screen.FromHandle(windowHandle);
|
||||
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
|
||||
var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight -
|
||||
SystemParameters.WindowCaptionHeight;
|
||||
// 仅计算Windows任务栏高度,不考虑其他程序对工作区的影响
|
||||
var toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY);
|
||||
pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2;
|
||||
|
||||
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 (pointDesktop.X != -1 || pointDesktop.Y != -1) pointDesktop = pos;
|
||||
|
||||
@@ -1167,8 +1248,8 @@ namespace Ink_Canvas {
|
||||
var windowHandle = new WindowInteropHelper(this).Handle;
|
||||
var screen = System.Windows.Forms.Screen.FromHandle(windowHandle);
|
||||
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
|
||||
var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight -
|
||||
SystemParameters.WindowCaptionHeight;
|
||||
// 仅计算Windows任务栏高度,不考虑其他程序对工作区的影响
|
||||
var toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY);
|
||||
pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2;
|
||||
|
||||
pos.Y = screenHeight - 55 * ViewboxFloatingBarScaleTransform.ScaleY;
|
||||
@@ -1372,44 +1453,9 @@ namespace Ink_Canvas {
|
||||
|
||||
forceEraser = true;
|
||||
forcePointEraser = true;
|
||||
if (Settings.Canvas.EraserShapeType == 0) {
|
||||
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(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);
|
||||
}
|
||||
|
||||
// 即使手掌触发过面积擦,也强制应用当前的EraserShapeType设置
|
||||
ApplyCurrentEraserShape();
|
||||
|
||||
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint) {
|
||||
if (EraserSizePanel.Visibility == Visibility.Collapsed) {
|
||||
@@ -1448,6 +1494,33 @@ namespace Ink_Canvas {
|
||||
inkCanvas_EditingModeChanged(inkCanvas, null);
|
||||
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.5 : 1.3;
|
||||
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) {
|
||||
|
||||
@@ -1499,7 +1572,8 @@ namespace Ink_Canvas {
|
||||
|
||||
private void DrawShapePromptToPen() {
|
||||
if (isLongPressSelected == true) {
|
||||
HideSubPanels("pen");
|
||||
// 如果是长按选中的状态,只隐藏面板,不切换到笔模式
|
||||
HideSubPanels("shape");
|
||||
}
|
||||
else {
|
||||
if (StackPanelCanvasControls.Visibility == Visibility.Visible)
|
||||
@@ -1564,20 +1638,38 @@ namespace Ink_Canvas {
|
||||
public static bool CloseIsFromButton = false;
|
||||
|
||||
public void BtnExit_Click(object sender, RoutedEventArgs e) {
|
||||
CloseIsFromButton = true;
|
||||
Close();
|
||||
App.IsAppExitByUser = true;
|
||||
Application.Current.Shutdown();
|
||||
// CloseIsFromButton = true;
|
||||
// Close();
|
||||
}
|
||||
|
||||
public void BtnRestart_Click(object sender, RoutedEventArgs e) {
|
||||
Process.Start(System.Windows.Forms.Application.ExecutablePath, "-m");
|
||||
|
||||
App.IsAppExitByUser = true;
|
||||
CloseIsFromButton = true;
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
|
||||
private void SettingsOverlayClick(object sender, MouseButtonEventArgs e) {
|
||||
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;
|
||||
@@ -1587,6 +1679,7 @@ namespace Ink_Canvas {
|
||||
HideSubPanels();
|
||||
}
|
||||
else {
|
||||
// 设置蒙版为可点击,并添加半透明背景
|
||||
BorderSettingsMask.IsHitTestVisible = true;
|
||||
BorderSettingsMask.Background = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
|
||||
SettingsPanelScrollViewer.ScrollToTop();
|
||||
@@ -1764,11 +1857,22 @@ namespace Ink_Canvas {
|
||||
|
||||
if (Settings.Canvas.UsingWhiteboard)
|
||||
{
|
||||
BtnColorBlack_Click(null, null);
|
||||
// 如果有自定义背景色并且是白板模式,应用自定义背景色
|
||||
if (CustomBackgroundColor.HasValue)
|
||||
{
|
||||
GridBackgroundCover.Background = new SolidColorBrush(CustomBackgroundColor.Value);
|
||||
}
|
||||
// 白板模式下设置墨迹颜色为黑色
|
||||
CheckLastColor(0);
|
||||
forceEraser = false;
|
||||
ColorSwitchCheck();
|
||||
}
|
||||
else
|
||||
{
|
||||
BtnColorWhite_Click(null, null);
|
||||
// 黑板模式下设置墨迹颜色为白色
|
||||
CheckLastColor(5);
|
||||
forceEraser = false;
|
||||
ColorSwitchCheck();
|
||||
}
|
||||
|
||||
StackPanelPPTButtons.Visibility = Visibility.Collapsed;
|
||||
@@ -1895,4 +1999,4 @@ namespace Ink_Canvas {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Helpers;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.IO;
|
||||
@@ -6,6 +6,10 @@ using System.Windows;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using File = System.IO.File;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Forms;
|
||||
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
@@ -33,9 +37,77 @@ namespace Ink_Canvas {
|
||||
else
|
||||
//savePathWithName = savePath + @"\" + DateTime.Now.ToString("u").Replace(':', '-') + ".icstk";
|
||||
savePathWithName = savePath + @"\" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss-fff") + ".icstk";
|
||||
|
||||
var fs = new FileStream(savePathWithName, FileMode.Create);
|
||||
inkCanvas.Strokes.Save(fs);
|
||||
if (newNotice) ShowNotification("墨迹成功保存至 " + savePathWithName);
|
||||
|
||||
if (Settings.Automation.IsSaveFullPageStrokes)
|
||||
{
|
||||
// 全页面保存模式 - 保存整个墨迹页面的图像
|
||||
var bitmap = new System.Drawing.Bitmap(
|
||||
(int)System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width,
|
||||
(int)System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
|
||||
|
||||
using (var g = System.Drawing.Graphics.FromImage(bitmap))
|
||||
{
|
||||
// 创建黑色或透明背景
|
||||
System.Drawing.Color bgColor = Settings.Canvas.UsingWhiteboard
|
||||
? System.Drawing.Color.White
|
||||
: System.Drawing.Color.FromArgb(22, 41, 36); // 黑板背景色
|
||||
g.Clear(bgColor);
|
||||
|
||||
// 将InkCanvas墨迹渲染到Visual
|
||||
var visual = new DrawingVisual();
|
||||
using (var dc = visual.RenderOpen())
|
||||
{
|
||||
// 创建一个VisualBrush,使用inkCanvas作为源
|
||||
var visualBrush = new VisualBrush(inkCanvas);
|
||||
// 绘制矩形并填充为inkCanvas的内容
|
||||
dc.DrawRectangle(visualBrush, null, new Rect(0, 0, inkCanvas.ActualWidth, inkCanvas.ActualHeight));
|
||||
}
|
||||
|
||||
// 创建适合墨迹画布尺寸的渲染位图
|
||||
var rtb = new RenderTargetBitmap(
|
||||
(int)inkCanvas.ActualWidth, (int)inkCanvas.ActualHeight,
|
||||
96, 96,
|
||||
PixelFormats.Pbgra32);
|
||||
rtb.Render(visual);
|
||||
|
||||
// 转换为GDI+ Bitmap并保存
|
||||
var encoder = new PngBitmapEncoder();
|
||||
encoder.Frames.Add(BitmapFrame.Create(rtb));
|
||||
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
encoder.Save(ms);
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
var imgBitmap = new System.Drawing.Bitmap(ms);
|
||||
|
||||
// 将生成的墨迹图像绘制到屏幕截图上
|
||||
// 居中绘制,确保墨迹位于屏幕中央
|
||||
int x = (bitmap.Width - imgBitmap.Width) / 2;
|
||||
int y = (bitmap.Height - imgBitmap.Height) / 2;
|
||||
g.DrawImage(imgBitmap, x, y);
|
||||
|
||||
// 保存为PNG
|
||||
string imagePathWithName = Path.ChangeExtension(savePathWithName, "png");
|
||||
bitmap.Save(imagePathWithName, System.Drawing.Imaging.ImageFormat.Png);
|
||||
|
||||
// 仍然保存墨迹文件以兼容旧版本
|
||||
inkCanvas.Strokes.Save(fs);
|
||||
}
|
||||
}
|
||||
|
||||
// 显示提示
|
||||
if (newNotice) ShowNotification("墨迹成功全页面保存至 " + Path.ChangeExtension(savePathWithName, "png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 常规保存模式 - 仅保存墨迹对象
|
||||
inkCanvas.Strokes.Save(fs);
|
||||
if (newNotice) ShowNotification("墨迹成功保存至 " + savePathWithName);
|
||||
}
|
||||
|
||||
fs.Close();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
ShowNotification("墨迹保存失败");
|
||||
@@ -85,4 +157,4 @@ namespace Ink_Canvas {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
@@ -79,4 +79,4 @@ namespace Ink_Canvas {
|
||||
$"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.png");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
@@ -17,6 +17,13 @@ namespace Ink_Canvas {
|
||||
private object lastBorderMouseDownObject;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -316,6 +323,11 @@ namespace Ink_Canvas {
|
||||
}
|
||||
|
||||
private void GridInkCanvasSelectionCover_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) {
|
||||
// 手掌擦时禁止移动/缩放
|
||||
if (isLastTouchEraser || inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint)
|
||||
return;
|
||||
// 三指及以上禁止缩放
|
||||
bool disableScale = dec.Count >= 3;
|
||||
try {
|
||||
if (dec.Count >= 1) {
|
||||
var md = e.DeltaManipulation;
|
||||
@@ -334,7 +346,8 @@ namespace Ink_Canvas {
|
||||
|
||||
// Update matrix to reflect translation/rotation
|
||||
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();
|
||||
if (StrokesSelectionClone.Count != 0)
|
||||
@@ -380,6 +393,11 @@ namespace Ink_Canvas {
|
||||
isProgramChangeStrokeSelection = false;
|
||||
inkCanvas.Strokes.Add(StrokesSelectionClone);
|
||||
}
|
||||
else {
|
||||
// 新增:启动套索选择模式
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Select;
|
||||
inkCanvas.Select(new StrokeCollection());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Helpers;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
@@ -21,16 +21,33 @@ namespace Ink_Canvas {
|
||||
private void ToggleSwitchIsAutoUpdate_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
Settings.Startup.IsAutoUpdate = ToggleSwitchIsAutoUpdate.IsOn;
|
||||
ToggleSwitchIsAutoUpdateWithSilence.Visibility =
|
||||
|
||||
// 自动更新关闭时隐藏静默更新选项
|
||||
ToggleSwitchIsAutoUpdateWithSilence.Visibility =
|
||||
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();
|
||||
}
|
||||
|
||||
private void ToggleSwitchIsAutoUpdateWithSilence_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
Settings.Startup.IsAutoUpdateWithSilence = ToggleSwitchIsAutoUpdateWithSilence.IsOn;
|
||||
|
||||
// 静默更新的时间设置区域只在静默更新开启时显示
|
||||
AutoUpdateTimePeriodBlock.Visibility =
|
||||
Settings.Startup.IsAutoUpdateWithSilence ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
@@ -226,41 +243,97 @@ namespace Ink_Canvas {
|
||||
public void ComboBoxFloatingBarImg_SelectionChanged(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.FloatingBarImg = ComboBoxFloatingBarImg.SelectedIndex;
|
||||
if (ComboBoxFloatingBarImg.SelectedIndex == 0) {
|
||||
UpdateFloatingBarIcon();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
public void UpdateFloatingBarIcon()
|
||||
{
|
||||
int index = Settings.Appearance.FloatingBarImg;
|
||||
|
||||
if (index == 0) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/icc.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(0.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 1) {
|
||||
} else if (index == 1) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(
|
||||
new Uri("pack://application:,,,/Resources/Icons-png/icc-transparent-dark-small.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(1.2);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 2) {
|
||||
} else if (index == 2) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/kuandoujiyanhuaji.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 3) {
|
||||
} else if (index == 3) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/kuanshounvhuaji.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 4) {
|
||||
} else if (index == 4) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/kuanciya.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 5) {
|
||||
} else if (index == 5) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/kuanneikuhuaji.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 6) {
|
||||
} else if (index == 6) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/kuandogeyuanliangwo.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 7) {
|
||||
} else if (index == 7) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/tiebahuaji.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1);
|
||||
} else if (index >= 8 && index - 8 < Settings.Appearance.CustomFloatingBarImgs.Count) {
|
||||
// 使用自定义图标
|
||||
var customIcon = Settings.Appearance.CustomFloatingBarImgs[index - 8];
|
||||
try {
|
||||
FloatingbarHeadIconImg.Source = new BitmapImage(new Uri(customIcon.FilePath));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2);
|
||||
} catch {
|
||||
// 如果加载失败,使用默认图标
|
||||
FloatingbarHeadIconImg.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/icc.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(0.5);
|
||||
}
|
||||
}
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
public void UpdateCustomIconsInComboBox()
|
||||
{
|
||||
// 保留前8个内置图标选项
|
||||
while (ComboBoxFloatingBarImg.Items.Count > 8)
|
||||
{
|
||||
ComboBoxFloatingBarImg.Items.RemoveAt(ComboBoxFloatingBarImg.Items.Count - 1);
|
||||
}
|
||||
|
||||
// 添加自定义图标选项
|
||||
foreach (var customIcon in Settings.Appearance.CustomFloatingBarImgs)
|
||||
{
|
||||
ComboBoxItem item = new ComboBoxItem();
|
||||
item.Content = customIcon.Name;
|
||||
item.FontFamily = new System.Windows.Media.FontFamily("Microsoft YaHei UI");
|
||||
ComboBoxFloatingBarImg.Items.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonAddCustomIcon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AddCustomIconWindow dialog = new AddCustomIconWindow(this);
|
||||
dialog.Owner = this;
|
||||
dialog.ShowDialog();
|
||||
|
||||
if (dialog.IsSuccess)
|
||||
{
|
||||
// 自动选中新添加的图标
|
||||
ComboBoxFloatingBarImg.SelectedIndex = ComboBoxFloatingBarImg.Items.Count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonManageCustomIcons_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CustomIconWindow dialog = new CustomIconWindow(this);
|
||||
dialog.Owner = this;
|
||||
dialog.ShowDialog();
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableTimeDisplayInWhiteboardMode_Toggled(object sender, RoutedEventArgs e) {
|
||||
@@ -694,6 +767,86 @@ namespace Ink_Canvas {
|
||||
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();
|
||||
}
|
||||
|
||||
private void ToggleSwitchHighPrecisionLineStraighten_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
|
||||
Settings.Canvas.HighPrecisionLineStraighten = ToggleSwitchHighPrecisionLineStraighten.IsOn;
|
||||
System.Diagnostics.Debug.WriteLine($"HighPrecisionLineStraighten changed: {Settings.Canvas.HighPrecisionLineStraighten}");
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Canvas
|
||||
@@ -729,46 +882,17 @@ namespace Ink_Canvas {
|
||||
ComboBoxEraserSizeFloatingBar.SelectedIndex = s.SelectedIndex;
|
||||
ComboBoxEraserSize.SelectedIndex = s.SelectedIndex;
|
||||
}
|
||||
if (Settings.Canvas.EraserShapeType == 0) {
|
||||
double k = 1;
|
||||
switch (s.SelectedIndex) {
|
||||
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 (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);
|
||||
|
||||
// 使用统一的方法应用橡皮擦形状
|
||||
ApplyCurrentEraserShape();
|
||||
|
||||
// 确保当前处于橡皮擦模式时能立即看到效果
|
||||
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint) {
|
||||
// 先切换一下模式,再切回来,确保橡皮擦形状得到刷新
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
|
||||
}
|
||||
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
@@ -777,23 +901,11 @@ namespace Ink_Canvas {
|
||||
Settings.Canvas.EraserShapeType = 0;
|
||||
SaveSettingsToFile();
|
||||
CheckEraserTypeTab();
|
||||
double k = 1;
|
||||
switch (ComboBoxEraserSizeFloatingBar.SelectedIndex) {
|
||||
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);
|
||||
|
||||
// 使用统一的方法应用橡皮擦形状
|
||||
ApplyCurrentEraserShape();
|
||||
|
||||
// 确保当前处于橡皮擦模式时能立即看到效果
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
|
||||
}
|
||||
@@ -803,23 +915,11 @@ namespace Ink_Canvas {
|
||||
Settings.Canvas.EraserShapeType = 1;
|
||||
SaveSettingsToFile();
|
||||
CheckEraserTypeTab();
|
||||
double k = 1;
|
||||
switch (ComboBoxEraserSizeFloatingBar.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);
|
||||
|
||||
// 使用统一的方法应用橡皮擦形状
|
||||
ApplyCurrentEraserShape();
|
||||
|
||||
// 确保当前处于橡皮擦模式时能立即看到效果
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
|
||||
}
|
||||
@@ -1135,6 +1235,13 @@ namespace Ink_Canvas {
|
||||
else
|
||||
timerKillProcess.Stop();
|
||||
}
|
||||
|
||||
private void ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Automation.IsAutoEnterAnnotationModeWhenExitFoldMode = ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchSaveScreenshotsInDateFolders_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
@@ -1215,15 +1322,18 @@ namespace Ink_Canvas {
|
||||
var folderBrowser = new System.Windows.Forms.FolderBrowserDialog();
|
||||
folderBrowser.ShowDialog();
|
||||
if (folderBrowser.SelectedPath.Length > 0) AutoSavedStrokesLocation.Text = folderBrowser.SelectedPath;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void SetAutoSavedStrokesLocationToDiskDButton_Click(object sender, RoutedEventArgs e) {
|
||||
AutoSavedStrokesLocation.Text = @"D:\Ink Canvas";
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void SetAutoSavedStrokesLocationToDocumentFolderButton_Click(object sender, RoutedEventArgs e) {
|
||||
AutoSavedStrokesLocation.Text =
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Ink Canvas";
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchAutoDelSavedFiles_Toggled(object sender, RoutedEventArgs e) {
|
||||
@@ -1246,6 +1356,12 @@ namespace Ink_Canvas {
|
||||
ToggleSwitchAutoSaveScreenShotInPowerPoint.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchSaveFullPageStrokes_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
Settings.Automation.IsSaveFullPageStrokes = ToggleSwitchSaveFullPageStrokes.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1281,29 +1397,52 @@ namespace Ink_Canvas {
|
||||
BoardToggleSwitchEnableMultiTouchMode.IsOn = ToggleSwitchEnableMultiTouchMode.IsOn;
|
||||
else
|
||||
ToggleSwitchEnableMultiTouchMode.IsOn = BoardToggleSwitchEnableMultiTouchMode.IsOn;
|
||||
|
||||
if (ToggleSwitchEnableMultiTouchMode.IsOn) {
|
||||
if (!isInMultiTouchMode) {
|
||||
// 保存当前编辑模式和绘图工具状态
|
||||
InkCanvasEditingMode currentEditingMode = inkCanvas.EditingMode;
|
||||
int currentDrawingShapeMode = drawingShapeMode;
|
||||
bool currentForceEraser = forceEraser;
|
||||
|
||||
inkCanvas.StylusDown += MainWindow_StylusDown;
|
||||
inkCanvas.StylusMove += MainWindow_StylusMove;
|
||||
inkCanvas.StylusUp += MainWindow_StylusUp;
|
||||
inkCanvas.TouchDown += MainWindow_TouchDown;
|
||||
inkCanvas.TouchDown -= Main_Grid_TouchDown;
|
||||
|
||||
// 先设为None再设回原来的模式,避免可能的事件冲突
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
inkCanvas.Children.Clear();
|
||||
isInMultiTouchMode = true;
|
||||
|
||||
// 恢复到之前的编辑状态
|
||||
inkCanvas.EditingMode = currentEditingMode;
|
||||
drawingShapeMode = currentDrawingShapeMode;
|
||||
forceEraser = currentForceEraser;
|
||||
}
|
||||
} else {
|
||||
if (isInMultiTouchMode) {
|
||||
// 保存当前编辑模式和绘图工具状态
|
||||
InkCanvasEditingMode currentEditingMode = inkCanvas.EditingMode;
|
||||
int currentDrawingShapeMode = drawingShapeMode;
|
||||
bool currentForceEraser = forceEraser;
|
||||
|
||||
inkCanvas.StylusDown -= MainWindow_StylusDown;
|
||||
inkCanvas.StylusMove -= MainWindow_StylusMove;
|
||||
inkCanvas.StylusUp -= MainWindow_StylusUp;
|
||||
inkCanvas.TouchDown -= MainWindow_TouchDown;
|
||||
inkCanvas.TouchDown += Main_Grid_TouchDown;
|
||||
|
||||
// 先设为None再设回原来的模式,避免可能的事件冲突
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
inkCanvas.Children.Clear();
|
||||
isInMultiTouchMode = false;
|
||||
|
||||
// 恢复到之前的编辑状态
|
||||
inkCanvas.EditingMode = currentEditingMode;
|
||||
drawingShapeMode = currentDrawingShapeMode;
|
||||
forceEraser = currentForceEraser;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1409,7 +1548,7 @@ namespace Ink_Canvas {
|
||||
Settings.Automation.IsAutoKillVComYouJiao = false;
|
||||
Settings.Automation.IsAutoKillInkCanvas = false;
|
||||
Settings.Automation.IsAutoKillICA = false;
|
||||
Settings.Automation.IsAutoKillIDT = true;
|
||||
Settings.Automation.IsAutoKillIDT = false;
|
||||
Settings.Automation.IsAutoKillSeewoLauncher2DesktopAnnotation = false;
|
||||
Settings.Automation.IsSaveScreenshotsInDateFolders = false;
|
||||
Settings.Automation.IsAutoSaveStrokesAtScreenshot = true;
|
||||
@@ -1444,6 +1583,12 @@ namespace Ink_Canvas {
|
||||
Settings.Canvas.HideStrokeWhenSelecting = false;
|
||||
Settings.Canvas.ClearCanvasAndClearTimeMachine = false;
|
||||
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.HyperbolaAsymptoteOption = 0;
|
||||
|
||||
@@ -1464,8 +1609,8 @@ namespace Ink_Canvas {
|
||||
Settings.Startup.IsEnableNibMode = false;
|
||||
Settings.Startup.IsAutoUpdate = true;
|
||||
Settings.Startup.IsAutoUpdateWithSilence = true;
|
||||
Settings.Startup.AutoUpdateWithSilenceStartTime = "18:20";
|
||||
Settings.Startup.AutoUpdateWithSilenceEndTime = "07:40";
|
||||
Settings.Startup.AutoUpdateWithSilenceStartTime = "06:00";
|
||||
Settings.Startup.AutoUpdateWithSilenceEndTime = "22:00";
|
||||
Settings.Startup.IsFoldAtStartup = false;
|
||||
}
|
||||
|
||||
@@ -1656,6 +1801,12 @@ namespace Ink_Canvas {
|
||||
Settings.Advanced.IsLogEnabled = ToggleSwitchIsLogEnabled.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchIsSaveLogByDate_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
Settings.Advanced.IsSaveLogByDate = ToggleSwitchIsSaveLogByDate.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchIsSecondConfimeWhenShutdownApp_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
@@ -1687,6 +1838,31 @@ namespace Ink_Canvas {
|
||||
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();
|
||||
}
|
||||
|
||||
private void ToggleSwitchDirectCallCiRand_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
|
||||
// 获取开关状态并保存到设置中
|
||||
Settings.RandSettings.DirectCallCiRand = ToggleSwitchDirectCallCiRand.IsOn;
|
||||
|
||||
// 保存设置到文件
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static void SaveSettingsToFile() {
|
||||
@@ -1707,13 +1883,129 @@ namespace Ink_Canvas {
|
||||
}
|
||||
|
||||
private void HyperlinkSourceToPresentRepository_Click(object sender, RoutedEventArgs e) {
|
||||
Process.Start("https://github.com/ChangSakura/Ink-Canvas");
|
||||
Process.Start("https://bgithub.xyz/ChangSakura/Ink-Canvas");
|
||||
HideSubPanels();
|
||||
}
|
||||
|
||||
private void HyperlinkSourceToOringinalRepository_Click(object sender, RoutedEventArgs e) {
|
||||
Process.Start("https://github.com/WXRIW/Ink-Canvas");
|
||||
Process.Start("https://bgithub.xyz/WXRIW/Ink-Canvas");
|
||||
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 = "版本修复";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 自定义点名背景相关方法
|
||||
public void UpdatePickNameBackgroundsInComboBox()
|
||||
{
|
||||
// 清除现有的自定义背景选项
|
||||
if (ComboBoxPickNameBackground != null)
|
||||
{
|
||||
// 保留第一个默认选项
|
||||
while (ComboBoxPickNameBackground.Items.Count > 1)
|
||||
{
|
||||
ComboBoxPickNameBackground.Items.RemoveAt(ComboBoxPickNameBackground.Items.Count - 1);
|
||||
}
|
||||
|
||||
// 添加自定义背景选项
|
||||
foreach (var background in Settings.RandSettings.CustomPickNameBackgrounds)
|
||||
{
|
||||
ComboBoxItem item = new ComboBoxItem();
|
||||
item.Content = background.Name;
|
||||
item.FontFamily = new System.Windows.Media.FontFamily("Microsoft YaHei UI");
|
||||
ComboBoxPickNameBackground.Items.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdatePickNameBackgroundDisplay()
|
||||
{
|
||||
// 此方法主要用于在外部窗口更改背景后更新UI
|
||||
if (ComboBoxPickNameBackground != null)
|
||||
{
|
||||
ComboBoxPickNameBackground.SelectedIndex = Settings.RandSettings.SelectedBackgroundIndex;
|
||||
}
|
||||
}
|
||||
|
||||
private void ComboBoxPickNameBackground_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
Settings.RandSettings.SelectedBackgroundIndex = ComboBoxPickNameBackground.SelectedIndex;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ButtonAddCustomBackground_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AddPickNameBackgroundWindow dialog = new AddPickNameBackgroundWindow(this);
|
||||
dialog.Owner = this;
|
||||
dialog.ShowDialog();
|
||||
|
||||
if (dialog.IsSuccess)
|
||||
{
|
||||
// 自动选中新添加的背景
|
||||
ComboBoxPickNameBackground.SelectedIndex = ComboBoxPickNameBackground.Items.Count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonManageBackgrounds_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ManagePickNameBackgroundsWindow dialog = new ManagePickNameBackgroundsWindow(this);
|
||||
dialog.Owner = this;
|
||||
dialog.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,16 +70,37 @@ namespace Ink_Canvas {
|
||||
BoundsWidth = Settings.Advanced.FingerModeBoundsWidth;
|
||||
}
|
||||
|
||||
// 设置自动更新相关选项
|
||||
ToggleSwitchIsAutoUpdate.IsOn = Settings.Startup.IsAutoUpdate;
|
||||
|
||||
// 只有在启用了自动更新功能时才检查更新
|
||||
if (Settings.Startup.IsAutoUpdate) {
|
||||
ToggleSwitchIsAutoUpdate.IsOn = true;
|
||||
if (isStartup) {
|
||||
LogHelper.WriteLogToFile("AutoUpdate | Running auto-update check at startup");
|
||||
AutoUpdate();
|
||||
}
|
||||
// 当设置被修改时也检查更新(非启动时)
|
||||
else {
|
||||
LogHelper.WriteLogToFile("AutoUpdate | Running auto-update check after settings change");
|
||||
AutoUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
// ToggleSwitchIsAutoUpdateWithSilence.Visibility = Settings.Startup.IsAutoUpdate ? Visibility.Visible : Visibility.Collapsed;
|
||||
if (Settings.Startup.IsAutoUpdateWithSilence) {
|
||||
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
|
||||
? Visibility.Visible
|
||||
: Visibility.Collapsed;
|
||||
@@ -94,6 +115,22 @@ namespace Ink_Canvas {
|
||||
Settings.Startup = new Startup();
|
||||
}
|
||||
|
||||
// 恢复崩溃后操作设置
|
||||
if (Settings.Startup != null)
|
||||
{
|
||||
// 恢复崩溃后操作选项
|
||||
if (Settings.Startup.CrashAction == 0)
|
||||
{
|
||||
App.CrashAction = App.CrashActionType.SilentRestart;
|
||||
if (RadioCrashSilentRestart != null) RadioCrashSilentRestart.IsChecked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
App.CrashAction = App.CrashActionType.NoAction;
|
||||
if (RadioCrashNoAction != null) RadioCrashNoAction.IsChecked = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Appearance
|
||||
if (Settings.Appearance != null) {
|
||||
if (!Settings.Appearance.IsEnableDisPlayNibModeToggler) {
|
||||
@@ -210,41 +247,20 @@ namespace Ink_Canvas {
|
||||
new SolidColorBrush(StringToColor("#FF555555"));
|
||||
}
|
||||
|
||||
ComboBoxFloatingBarImg.SelectedIndex = Settings.Appearance.FloatingBarImg;
|
||||
if (ComboBoxFloatingBarImg.SelectedIndex == 0) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/icc.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(0.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 1) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(
|
||||
new Uri("pack://application:,,,/Resources/Icons-png/icc-transparent-dark-small.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(1.2);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 2) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/kuandoujiyanhuaji.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 3) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/kuanshounvhuaji.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 4) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/kuanciya.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 5) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/kuanneikuhuaji.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 6) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/kuandogeyuanliangwo.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1.5);
|
||||
} else if (ComboBoxFloatingBarImg.SelectedIndex == 7) {
|
||||
FloatingbarHeadIconImg.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/tiebahuaji.png"));
|
||||
FloatingbarHeadIconImg.Margin = new Thickness(2, 2, 2, 1);
|
||||
// 更新自定义图标下拉列表
|
||||
UpdateCustomIconsInComboBox();
|
||||
|
||||
// 设置选中的图标索引
|
||||
// 如果索引超出范围(自定义图标可能已删除),使用默认图标
|
||||
if (Settings.Appearance.FloatingBarImg >= ComboBoxFloatingBarImg.Items.Count)
|
||||
{
|
||||
Settings.Appearance.FloatingBarImg = 0;
|
||||
}
|
||||
|
||||
ComboBoxFloatingBarImg.SelectedIndex = Settings.Appearance.FloatingBarImg;
|
||||
|
||||
// 更新浮动栏图标
|
||||
UpdateFloatingBarIcon();
|
||||
|
||||
ToggleSwitchEnableTimeDisplayInWhiteboardMode.IsOn =
|
||||
Settings.Appearance.EnableTimeDisplayInWhiteboardMode;
|
||||
@@ -434,6 +450,12 @@ namespace Ink_Canvas {
|
||||
inkCanvas.ForceCursor = false;
|
||||
}
|
||||
|
||||
// 初始化压感触屏模式开关状态
|
||||
ToggleSwitchEnablePressureTouchMode.IsOn = Settings.Canvas.EnablePressureTouchMode;
|
||||
|
||||
// 初始化屏蔽压感开关状态
|
||||
ToggleSwitchDisablePressure.IsOn = Settings.Canvas.DisablePressure;
|
||||
|
||||
ComboBoxPenStyle.SelectedIndex = Settings.Canvas.InkStyle;
|
||||
BoardComboBoxPenStyle.SelectedIndex = Settings.Canvas.InkStyle;
|
||||
|
||||
@@ -458,7 +480,7 @@ namespace Ink_Canvas {
|
||||
k = 1.25;
|
||||
break;
|
||||
case 4:
|
||||
k = 1.8;
|
||||
k = 1.5;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -479,7 +501,7 @@ namespace Ink_Canvas {
|
||||
k = 1.2;
|
||||
break;
|
||||
case 4:
|
||||
k = 1.6;
|
||||
k = 1.5;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -500,6 +522,18 @@ namespace Ink_Canvas {
|
||||
ToggleSwitchFitToCurve.IsOn = false;
|
||||
drawingAttributes.FitToCurve = false;
|
||||
}
|
||||
|
||||
// 初始化直线自动拉直相关设置
|
||||
ToggleSwitchAutoStraightenLine.IsOn = Settings.Canvas.AutoStraightenLine;
|
||||
AutoStraightenLineThresholdSlider.Value = Settings.Canvas.AutoStraightenLineThreshold;
|
||||
// 直线拉直灵敏度也在这里初始化,即使它存储在InkToShape中
|
||||
LineStraightenSensitivitySlider.Value = Settings.InkToShape.LineStraightenSensitivity;
|
||||
// 初始化高精度直线拉直设置
|
||||
ToggleSwitchHighPrecisionLineStraighten.IsOn = Settings.Canvas.HighPrecisionLineStraighten;
|
||||
|
||||
// 初始化直线端点吸附相关设置
|
||||
ToggleSwitchLineEndpointSnapping.IsOn = Settings.Canvas.LineEndpointSnapping;
|
||||
LineEndpointSnappingThresholdSlider.Value = Settings.Canvas.LineEndpointSnappingThreshold;
|
||||
} else {
|
||||
Settings.Canvas = new Canvas();
|
||||
}
|
||||
@@ -510,41 +544,30 @@ namespace Ink_Canvas {
|
||||
FingerModeBoundsWidthSlider.Value = Settings.Advanced.FingerModeBoundsWidth;
|
||||
NibModeBoundsWidthSlider.Value = Settings.Advanced.NibModeBoundsWidth;
|
||||
ToggleSwitchIsLogEnabled.IsOn = Settings.Advanced.IsLogEnabled;
|
||||
|
||||
ToggleSwitchIsSaveLogByDate.IsOn = Settings.Advanced.IsSaveLogByDate;
|
||||
ToggleSwitchIsSecondConfimeWhenShutdownApp.IsOn = Settings.Advanced.IsSecondConfirmWhenShutdownApp;
|
||||
|
||||
ToggleSwitchEraserBindTouchMultiplier.IsOn = Settings.Advanced.EraserBindTouchMultiplier;
|
||||
|
||||
ToggleSwitchIsSpecialScreen.IsOn = Settings.Advanced.IsSpecialScreen;
|
||||
|
||||
TouchMultiplierSlider.Visibility =
|
||||
ToggleSwitchIsSpecialScreen.IsOn ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
ToggleSwitchIsQuadIR.IsOn = Settings.Advanced.IsQuadIR;
|
||||
|
||||
ToggleSwitchEraserBindTouchMultiplier.IsOn = Settings.Advanced.EraserBindTouchMultiplier;
|
||||
ToggleSwitchIsEnableFullScreenHelper.IsOn = Settings.Advanced.IsEnableFullScreenHelper;
|
||||
ToggleSwitchIsEnableEdgeGestureUtil.IsOn = Settings.Advanced.IsEnableEdgeGestureUtil;
|
||||
ToggleSwitchIsEnableForceFullScreen.IsOn = Settings.Advanced.IsEnableForceFullScreen;
|
||||
ToggleSwitchIsEnableResolutionChangeDetection.IsOn = Settings.Advanced.IsEnableResolutionChangeDetection;
|
||||
ToggleSwitchIsEnableDPIChangeDetection.IsOn = Settings.Advanced.IsEnableDPIChangeDetection;
|
||||
ToggleSwitchIsEnableAvoidFullScreenHelper.IsOn = Settings.Advanced.IsEnableAvoidFullScreenHelper;
|
||||
if (Settings.Advanced.IsEnableFullScreenHelper) {
|
||||
FullScreenHelper.MarkFullscreenWindowTaskbarList(new WindowInteropHelper(this).Handle, true);
|
||||
}
|
||||
|
||||
ToggleSwitchIsEnableAvoidFullScreenHelper.IsOn = Settings.Advanced.IsEnableAvoidFullScreenHelper;
|
||||
if (Settings.Advanced.IsEnableAvoidFullScreenHelper)
|
||||
{
|
||||
AvoidFullScreenHelper.StartAvoidFullScreen(this);
|
||||
}
|
||||
|
||||
ToggleSwitchIsEnableEdgeGestureUtil.IsOn = Settings.Advanced.IsEnableEdgeGestureUtil;
|
||||
if (Settings.Advanced.IsEnableEdgeGestureUtil) {
|
||||
if (OSVersion.GetOperatingSystem() >= OperatingSystem.Windows10)
|
||||
EdgeGestureUtil.DisableEdgeGestures(new WindowInteropHelper(this).Handle, true);
|
||||
}
|
||||
|
||||
ToggleSwitchIsEnableForceFullScreen.IsOn = Settings.Advanced.IsEnableForceFullScreen;
|
||||
|
||||
ToggleSwitchIsEnableDPIChangeDetection.IsOn = Settings.Advanced.IsEnableDPIChangeDetection;
|
||||
|
||||
ToggleSwitchIsEnableResolutionChangeDetection.IsOn =
|
||||
Settings.Advanced.IsEnableResolutionChangeDetection;
|
||||
TouchMultiplierSlider.Visibility =
|
||||
ToggleSwitchIsSpecialScreen.IsOn ? Visibility.Visible : Visibility.Collapsed;
|
||||
} else {
|
||||
Settings.Advanced = new Advanced();
|
||||
}
|
||||
@@ -564,16 +587,37 @@ namespace Ink_Canvas {
|
||||
ToggleCheckboxEnableInkToShapeRectangle.IsChecked = Settings.InkToShape.IsInkToShapeRectangle;
|
||||
|
||||
ToggleCheckboxEnableInkToShapeRounded.IsChecked = Settings.InkToShape.IsInkToShapeRounded;
|
||||
|
||||
// 直线拉直灵敏度在Canvas部分已经初始化,这里不再重复
|
||||
} else {
|
||||
Settings.InkToShape = new InkToShape();
|
||||
}
|
||||
|
||||
// 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;
|
||||
ToggleSwitchDirectCallCiRand.IsOn = Settings.RandSettings.DirectCallCiRand;
|
||||
RandomDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
|
||||
SingleDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
// 加载自定义点名背景
|
||||
UpdatePickNameBackgroundsInComboBox();
|
||||
|
||||
// 设置选择的背景索引
|
||||
if (Settings.RandSettings.SelectedBackgroundIndex >= ComboBoxPickNameBackground.Items.Count)
|
||||
{
|
||||
Settings.RandSettings.SelectedBackgroundIndex = 0;
|
||||
}
|
||||
ComboBoxPickNameBackground.SelectedIndex = Settings.RandSettings.SelectedBackgroundIndex;
|
||||
} else {
|
||||
Settings.RandSettings = new RandSettings();
|
||||
ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn = Settings.RandSettings.DisplayRandWindowNamesInputBtn;
|
||||
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
|
||||
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
|
||||
ToggleSwitchDirectCallCiRand.IsOn = Settings.RandSettings.DirectCallCiRand;
|
||||
}
|
||||
|
||||
// Automation
|
||||
@@ -655,6 +699,8 @@ namespace Ink_Canvas {
|
||||
ToggleSwitchSaveScreenshotsInDateFolders.IsOn = Settings.Automation.IsSaveScreenshotsInDateFolders;
|
||||
|
||||
ToggleSwitchAutoSaveStrokesAtScreenshot.IsOn = Settings.Automation.IsAutoSaveStrokesAtScreenshot;
|
||||
|
||||
ToggleSwitchSaveFullPageStrokes.IsOn = Settings.Automation.IsSaveFullPageStrokes;
|
||||
|
||||
SideControlMinimumAutomationSlider.Value = Settings.Automation.MinimumAutomationStrokeNumber;
|
||||
|
||||
@@ -662,6 +708,9 @@ namespace Ink_Canvas {
|
||||
ToggleSwitchAutoDelSavedFiles.IsOn = Settings.Automation.AutoDelSavedFiles;
|
||||
ComboBoxAutoDelSavedFilesDaysThreshold.Text =
|
||||
Settings.Automation.AutoDelSavedFilesDaysThreshold.ToString();
|
||||
|
||||
// 加载退出收纳模式自动切换至批注模式设置
|
||||
ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode.IsOn = Settings.Automation.IsAutoEnterAnnotationModeWhenExitFoldMode;
|
||||
} else {
|
||||
Settings.Automation = new Automation();
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Ink_Canvas {
|
||||
#endregion Floating Bar Control
|
||||
|
||||
private int drawingShapeMode = 0;
|
||||
private bool isLongPressSelected = false; // 用于存是否是“选中”状态,便于后期抬笔后不做切换到笔的处理
|
||||
private bool isLongPressSelected = false; // 用于存是否是"选中"状态,便于后期抬笔后不做切换到笔的处理
|
||||
|
||||
#region Buttons
|
||||
|
||||
@@ -113,7 +113,16 @@ namespace Ink_Canvas {
|
||||
|
||||
private Task<bool> CheckIsDrawingShapesInMultiTouchMode() {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -129,6 +138,14 @@ namespace Ink_Canvas {
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
CancelSingleFingerDragMode();
|
||||
}
|
||||
else {
|
||||
// 即使不是长按,也设置必要的绘图状态
|
||||
forceEraser = true;
|
||||
drawingShapeMode = 1;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
isLongPressSelected = true; // 设置为选中状态,避免抬笔后切换回笔模式
|
||||
}
|
||||
|
||||
lastMouseDownSender = null;
|
||||
if (isLongPressSelected) {
|
||||
@@ -189,6 +206,14 @@ namespace Ink_Canvas {
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
CancelSingleFingerDragMode();
|
||||
}
|
||||
else {
|
||||
// 即使不是长按,也设置必要的绘图状态
|
||||
forceEraser = true;
|
||||
drawingShapeMode = 2;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
isLongPressSelected = true; // 设置为选中状态,避免抬笔后切换回笔模式
|
||||
}
|
||||
|
||||
lastMouseDownSender = null;
|
||||
if (isLongPressSelected) {
|
||||
@@ -276,6 +301,7 @@ namespace Ink_Canvas {
|
||||
drawingShapeMode = 3;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
isLongPressSelected = true; // 设置为选中状态,避免抬笔后切换回笔模式
|
||||
CancelSingleFingerDragMode();
|
||||
DrawShapePromptToPen();
|
||||
}
|
||||
@@ -428,12 +454,26 @@ namespace Ink_Canvas {
|
||||
#endregion
|
||||
|
||||
private void inkCanvas_TouchMove(object sender, TouchEventArgs e) {
|
||||
// 如果处于手掌擦状态,继续使用相同的橡皮形状
|
||||
if (isLastTouchEraser && currentPalmEraserShape != null) {
|
||||
inkCanvas.EraserShape = currentPalmEraserShape;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSingleFingerDragMode) return;
|
||||
|
||||
// 处理形状绘制模式
|
||||
if (drawingShapeMode != 0) {
|
||||
if (isLastTouchEraser) return;
|
||||
//EraserContainer.Background = null;
|
||||
//ImageEraser.Visibility = Visibility.Visible;
|
||||
if (isWaitUntilNextTouchDown) return;
|
||||
|
||||
// 修复触屏状态下几何绘制功能不可用的问题
|
||||
// 在几何绘制模式下,即使isWaitUntilNextTouchDown为true,也应该处理触摸移动事件
|
||||
// 只有当多点触控时才需要等待下一次触摸
|
||||
if (isWaitUntilNextTouchDown && dec.Count > 1) return;
|
||||
|
||||
if (dec.Count > 1) {
|
||||
isWaitUntilNextTouchDown = true;
|
||||
try {
|
||||
@@ -443,13 +483,19 @@ namespace Ink_Canvas {
|
||||
catch {
|
||||
Trace.WriteLine("lastTempStrokeCollection failed.");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 在几何绘制模式下,确保处理单点触控的移动事件
|
||||
Point touchPoint = e.GetTouchPoint(inkCanvas).Position;
|
||||
MouseTouchMove(touchPoint);
|
||||
return; // 处理完几何绘制后直接返回,不执行后面的代码
|
||||
}
|
||||
|
||||
// 触摸移动时保持自定义光标显示
|
||||
if (inkCanvas.EditingMode != InkCanvasEditingMode.None)
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
}
|
||||
|
||||
|
||||
MouseTouchMove(e.GetTouchPoint(inkCanvas).Position);
|
||||
}
|
||||
@@ -1277,8 +1323,34 @@ namespace Ink_Canvas {
|
||||
ViewboxFloatingBar.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);
|
||||
if (dec.Count == 0) isWaitUntilNextTouchDown = false;
|
||||
// 修改此处逻辑,在长按选择图形模式下保持isWaitUntilNextTouchDown
|
||||
if (dec.Count == 0 && !isLongPressSelected) isWaitUntilNextTouchDown = false;
|
||||
}
|
||||
|
||||
private Stroke lastTempStroke = null;
|
||||
@@ -1468,17 +1540,37 @@ namespace Ink_Canvas {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// 修改此处逻辑,确保在正确的情况下才切换回笔模式
|
||||
if (drawingShapeMode != 9 && drawingShapeMode != 0 && drawingShapeMode != 24 && drawingShapeMode != 25) {
|
||||
if (isLongPressSelected) { }
|
||||
if (isLongPressSelected) {
|
||||
// 如果是长按选中的情况,保持图形模式,不做任何切换
|
||||
isWaitUntilNextTouchDown = true; // 保持当前绘图模式直到下一次触摸
|
||||
}
|
||||
else {
|
||||
BtnPen_Click(null, null); //画完一次还原到笔模式
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1504,7 +1596,15 @@ namespace Ink_Canvas {
|
||||
else {
|
||||
BtnPen_Click(null, null); //画完还原到笔模式
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1550,7 +1650,15 @@ namespace Ink_Canvas {
|
||||
|
||||
BtnPen_Click(null, null); //画完还原到笔模式
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1607,9 +1715,24 @@ namespace Ink_Canvas {
|
||||
|
||||
private void MainWindow_OnMouseMove(object sender, MouseEventArgs e) {
|
||||
if (e.StylusDevice == null) {
|
||||
// 鼠标移动时保持光标可见
|
||||
System.Windows.Forms.Cursor.Show();
|
||||
|
||||
// 如果用户设置了显示光标,则确保光标显示正确
|
||||
if (Settings.Canvas.IsShowCursor && inkCanvas != null) {
|
||||
inkCanvas.ForceCursor = true;
|
||||
inkCanvas.UseCustomCursor = true;
|
||||
}
|
||||
} 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,165 @@ namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
private StrokeCollection newStrokes = new StrokeCollection();
|
||||
private List<Circle> circles = new List<Circle>();
|
||||
private const double LINE_STRAIGHTEN_THRESHOLD = 0.20; // 默认灵敏度阈值,与UI默认值对应
|
||||
|
||||
private void inkCanvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e) {
|
||||
if (Settings.Canvas.FitToCurve == true) drawingAttributes.FitToCurve = false;
|
||||
|
||||
try {
|
||||
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();
|
||||
|
||||
// 先完成所有直线判定,再考虑端点吸附
|
||||
// 读取实际的灵敏度设置值
|
||||
double sensitivity = Settings.InkToShape.LineStraightenSensitivity;
|
||||
System.Diagnostics.Debug.WriteLine($"当前灵敏度值: {sensitivity}");
|
||||
|
||||
// 判断是否应该拉直线条
|
||||
bool shouldStraighten = ShouldStraightenLine(e.Stroke);
|
||||
|
||||
// 输出一些调试信息,帮助理解灵敏度设置的效果
|
||||
System.Diagnostics.Debug.WriteLine($"LineStraightenSensitivity: {Settings.InkToShape.LineStraightenSensitivity}, ShouldStraighten: {shouldStraighten}");
|
||||
|
||||
// 只有当确定要拉直线条时,才检查端点吸附
|
||||
if (shouldStraighten && Settings.Canvas.LineEndpointSnapping) {
|
||||
// 只有在启用了形状识别(矩形或三角形)时才执行端点吸附
|
||||
if (Settings.InkToShape.IsInkToShapeRectangle || Settings.InkToShape.IsInkToShapeTriangle) {
|
||||
Point[] snappedPoints = GetSnappedEndpoints(startPoint, endPoint);
|
||||
if (snappedPoints != null) {
|
||||
startPoint = snappedPoints[0];
|
||||
endPoint = snappedPoints[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果确定要拉直,则创建直线
|
||||
if (shouldStraighten) {
|
||||
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) {
|
||||
void InkToShapeProcess() {
|
||||
try {
|
||||
@@ -422,6 +575,447 @@ namespace Ink_Canvas {
|
||||
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;
|
||||
|
||||
// 检查是否启用了高精度直线拉直
|
||||
bool useHighPrecision = Settings.Canvas.HighPrecisionLineStraighten;
|
||||
|
||||
if (useHighPrecision) {
|
||||
System.Diagnostics.Debug.WriteLine("使用高精度直线拉直模式");
|
||||
|
||||
// 高精度模式:每隔10像素取一个计数点
|
||||
double strokeLength = 0;
|
||||
double sampleInterval = 10.0; // 10像素间隔
|
||||
|
||||
// 计算笔画的总长度,用于后续采样
|
||||
for (int i = 1; i < stroke.StylusPoints.Count; i++) {
|
||||
Point p1 = stroke.StylusPoints[i-1].ToPoint();
|
||||
Point p2 = stroke.StylusPoints[i].ToPoint();
|
||||
strokeLength += GetDistance(p1, p2);
|
||||
}
|
||||
|
||||
// 如果笔画太短,直接使用所有点
|
||||
if (strokeLength < sampleInterval * 5) {
|
||||
foreach (StylusPoint sp in stroke.StylusPoints) {
|
||||
Point p = sp.ToPoint();
|
||||
double deviation = DistanceFromLineToPoint(start, end, p);
|
||||
maxDeviation = Math.Max(maxDeviation, deviation);
|
||||
totalDeviation += deviation;
|
||||
pointCount++;
|
||||
}
|
||||
} else {
|
||||
// 使用等距采样点
|
||||
double currentLength = 0;
|
||||
double nextSampleAt = 0;
|
||||
|
||||
// 总是包含起点
|
||||
Point lastPoint = start;
|
||||
double deviation = DistanceFromLineToPoint(start, end, lastPoint);
|
||||
maxDeviation = Math.Max(maxDeviation, deviation);
|
||||
totalDeviation += deviation;
|
||||
pointCount++;
|
||||
|
||||
// 采样中间点
|
||||
for (int i = 1; i < stroke.StylusPoints.Count; i++) {
|
||||
Point currentPoint = stroke.StylusPoints[i].ToPoint();
|
||||
double segmentLength = GetDistance(lastPoint, currentPoint);
|
||||
|
||||
// 如果这段线段跨越了下一个采样点
|
||||
while (currentLength + segmentLength >= nextSampleAt) {
|
||||
// 计算采样点在线段上的位置
|
||||
double t = (nextSampleAt - currentLength) / segmentLength;
|
||||
Point samplePoint = new Point(
|
||||
lastPoint.X + t * (currentPoint.X - lastPoint.X),
|
||||
lastPoint.Y + t * (currentPoint.Y - lastPoint.Y)
|
||||
);
|
||||
|
||||
// 计算采样点的偏差
|
||||
deviation = DistanceFromLineToPoint(start, end, samplePoint);
|
||||
maxDeviation = Math.Max(maxDeviation, deviation);
|
||||
totalDeviation += deviation;
|
||||
pointCount++;
|
||||
|
||||
// 设置下一个采样点位置
|
||||
nextSampleAt += sampleInterval;
|
||||
|
||||
// 防止无限循环
|
||||
if (nextSampleAt > strokeLength) break;
|
||||
}
|
||||
|
||||
currentLength += segmentLength;
|
||||
lastPoint = currentPoint;
|
||||
}
|
||||
|
||||
// 总是包含终点
|
||||
deviation = DistanceFromLineToPoint(start, end, end);
|
||||
maxDeviation = Math.Max(maxDeviation, deviation);
|
||||
totalDeviation += deviation;
|
||||
pointCount++;
|
||||
}
|
||||
} else {
|
||||
// 原始模式:使用所有点
|
||||
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}, Points: {pointCount}");
|
||||
|
||||
// 支持更广泛的灵敏度范围 (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;
|
||||
|
||||
// 使用相同的高精度/原始模式来计算方差
|
||||
if (useHighPrecision) {
|
||||
// 高精度模式:重新采样计算方差
|
||||
double strokeLength = 0;
|
||||
double sampleInterval = 10.0; // 10像素间隔
|
||||
|
||||
// 计算笔画的总长度,用于后续采样
|
||||
for (int i = 1; i < stroke.StylusPoints.Count; i++) {
|
||||
Point p1 = stroke.StylusPoints[i-1].ToPoint();
|
||||
Point p2 = stroke.StylusPoints[i].ToPoint();
|
||||
strokeLength += GetDistance(p1, p2);
|
||||
}
|
||||
|
||||
// 如果笔画太短,直接使用所有点
|
||||
if (strokeLength < sampleInterval * 5) {
|
||||
foreach (StylusPoint sp in stroke.StylusPoints) {
|
||||
Point p = sp.ToPoint();
|
||||
double deviation = DistanceFromLineToPoint(start, end, p);
|
||||
deviationVariance += Math.Pow(deviation - avgDeviation, 2);
|
||||
}
|
||||
} else {
|
||||
// 使用等距采样点
|
||||
double currentLength = 0;
|
||||
double nextSampleAt = 0;
|
||||
Point lastPoint = start;
|
||||
|
||||
// 起点方差
|
||||
double deviation = DistanceFromLineToPoint(start, end, lastPoint);
|
||||
deviationVariance += Math.Pow(deviation - avgDeviation, 2);
|
||||
|
||||
// 采样中间点
|
||||
for (int i = 1; i < stroke.StylusPoints.Count; i++) {
|
||||
Point currentPoint = stroke.StylusPoints[i].ToPoint();
|
||||
double segmentLength = GetDistance(lastPoint, currentPoint);
|
||||
|
||||
// 如果这段线段跨越了下一个采样点
|
||||
while (currentLength + segmentLength >= nextSampleAt) {
|
||||
// 计算采样点在线段上的位置
|
||||
double t = (nextSampleAt - currentLength) / segmentLength;
|
||||
Point samplePoint = new Point(
|
||||
lastPoint.X + t * (currentPoint.X - lastPoint.X),
|
||||
lastPoint.Y + t * (currentPoint.Y - lastPoint.Y)
|
||||
);
|
||||
|
||||
// 计算采样点的方差
|
||||
deviation = DistanceFromLineToPoint(start, end, samplePoint);
|
||||
deviationVariance += Math.Pow(deviation - avgDeviation, 2);
|
||||
|
||||
// 设置下一个采样点位置
|
||||
nextSampleAt += sampleInterval;
|
||||
|
||||
// 防止无限循环
|
||||
if (nextSampleAt > strokeLength) break;
|
||||
}
|
||||
|
||||
currentLength += segmentLength;
|
||||
lastPoint = currentPoint;
|
||||
}
|
||||
|
||||
// 终点方差
|
||||
deviation = DistanceFromLineToPoint(start, end, end);
|
||||
deviationVariance += Math.Pow(deviation - avgDeviation, 2);
|
||||
}
|
||||
} else {
|
||||
// 原始模式:使用所有点计算方差
|
||||
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() {
|
||||
lastTouchDownStrokeCollection = inkCanvas.Strokes.Clone();
|
||||
var whiteboardIndex = CurrentWhiteboardIndex;
|
||||
|
||||
@@ -6,6 +6,10 @@ using System.Runtime.CompilerServices;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public class TimeViewModel : INotifyPropertyChanged {
|
||||
@@ -302,24 +306,104 @@ namespace Ink_Canvas {
|
||||
}
|
||||
|
||||
private void timerCheckAutoUpdateWithSilence_Elapsed(object sender, ElapsedEventArgs e) {
|
||||
Dispatcher.Invoke(() => {
|
||||
try {
|
||||
if (!Topmost || inkCanvas.Strokes.Count > 0) return;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error);
|
||||
}
|
||||
});
|
||||
// 停止计时器,避免重复触发
|
||||
timerCheckAutoUpdateWithSilence.Stop();
|
||||
|
||||
try {
|
||||
if (AutoUpdateWithSilenceTimeComboBox.CheckIsInSilencePeriod(
|
||||
Settings.Startup.AutoUpdateWithSilenceStartTime,
|
||||
Settings.Startup.AutoUpdateWithSilenceEndTime)) {
|
||||
// 检查是否有可用的更新
|
||||
if (string.IsNullOrEmpty(AvailableLatestVersion)) {
|
||||
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);
|
||||
timerCheckAutoUpdateWithSilence.Stop();
|
||||
|
||||
// 关闭应用程序
|
||||
Dispatcher.Invoke(() => {
|
||||
Application.Current.Shutdown();
|
||||
});
|
||||
} else {
|
||||
LogHelper.WriteLogToFile("AutoUpdate | Cannot safely update now, will try again later");
|
||||
// 重新启动计时器,稍后再检查
|
||||
timerCheckAutoUpdateWithSilence.Start();
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Helpers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -26,8 +26,18 @@ namespace Ink_Canvas {
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
inkCanvas.Children.Clear();
|
||||
isInMultiTouchMode = false;
|
||||
|
||||
// 退出多指书写模式后,恢复手掌擦功能
|
||||
// 这里不需要特别操作,因为设置了isInMultiTouchMode = false后,
|
||||
// 下次触发Main_Grid_TouchDown时会自动判断并启用手掌擦功能
|
||||
}
|
||||
else {
|
||||
// 进入多指书写模式前,如果当前处于手掌擦状态,先关闭手掌擦
|
||||
if (isLastTouchEraser) {
|
||||
isLastTouchEraser = false;
|
||||
currentPalmEraserShape = null;
|
||||
}
|
||||
|
||||
inkCanvas.StylusDown += MainWindow_StylusDown;
|
||||
inkCanvas.StylusMove += MainWindow_StylusMove;
|
||||
inkCanvas.StylusUp += MainWindow_StylusUp;
|
||||
@@ -56,29 +66,16 @@ namespace Ink_Canvas {
|
||||
if ((Settings.Advanced.TouchMultiplier != 0 || !Settings.Advanced.IsSpecialScreen) //启用特殊屏幕且触摸倍数为 0 时禁用橡皮
|
||||
&& boundWidth > BoundsWidth * 2.5) {
|
||||
if (drawingShapeMode == 0 && forceEraser) return;
|
||||
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(boundWidth * k * eraserMultiplier * 0.25,
|
||||
boundWidth * k * eraserMultiplier * 0.25);
|
||||
currentPalmEraserShape = GetPalmRectangleEraserShape(eraserMultiplier);
|
||||
inkCanvas.EraserShape = currentPalmEraserShape;
|
||||
TouchDownPointsList[e.TouchDevice.Id] = InkCanvasEditingMode.EraseByPoint;
|
||||
isLastTouchEraser = true;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
|
||||
}
|
||||
else {
|
||||
TouchDownPointsList[e.TouchDevice.Id] = InkCanvasEditingMode.None;
|
||||
// 修复面积擦时不显示橡皮形状:无论 forcePointEraser 状态,均显示 50x50 橡皮
|
||||
inkCanvas.EraserShape = new EllipseStylusShape(50, 50);
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
}
|
||||
}
|
||||
@@ -89,6 +86,24 @@ namespace Ink_Canvas {
|
||||
ViewboxFloatingBar.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
|
||||
|| inkCanvas.EditingMode == InkCanvasEditingMode.EraseByStroke
|
||||
|| inkCanvas.EditingMode == InkCanvasEditingMode.Select) return;
|
||||
@@ -135,6 +150,13 @@ namespace Ink_Canvas {
|
||||
}
|
||||
catch { }
|
||||
|
||||
// 确保手写笔移动时光标保持可见
|
||||
if (Settings.Canvas.IsShowCursor) {
|
||||
inkCanvas.ForceCursor = true;
|
||||
inkCanvas.UseCustomCursor = true;
|
||||
System.Windows.Forms.Cursor.Show();
|
||||
}
|
||||
|
||||
var strokeVisual = GetStrokeVisual(e.StylusDevice.Id);
|
||||
var stylusPointCollection = e.GetStylusPoints(this);
|
||||
foreach (var stylusPoint in stylusPointCollection)
|
||||
@@ -179,8 +201,43 @@ namespace Ink_Canvas {
|
||||
private Point iniP = new Point(0, 0);
|
||||
private bool isLastTouchEraser = false;
|
||||
private bool forcePointEraser = true;
|
||||
// 用于记录手掌擦的尺寸和形状
|
||||
private StylusShape currentPalmEraserShape = null;
|
||||
|
||||
/// <summary>
|
||||
/// 根据用户在设置面板中选择的橡皮大小,生成"手掌橡皮"默认的矩形黑板擦形状。
|
||||
/// 该形状大小不随触控面积等实时变化,仅受设置的橡皮大小影响。
|
||||
/// </summary>
|
||||
/// <param name="multiplier">特殊屏幕触摸倍数修正系数</param>
|
||||
/// <returns>RectangleStylusShape</returns>
|
||||
private StylusShape GetPalmRectangleEraserShape(double multiplier = 1.0) {
|
||||
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.5;
|
||||
break;
|
||||
}
|
||||
|
||||
// 参照圆形橡皮 k*90 的基准,将矩形宽度压缩到 0.6,保持高度一致
|
||||
double baseLen = k * 90 * multiplier;
|
||||
return new RectangleStylusShape(baseLen * 0.6, baseLen);
|
||||
}
|
||||
|
||||
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);
|
||||
ViewboxFloatingBar.IsHitTestVisible = false;
|
||||
@@ -194,51 +251,65 @@ namespace Ink_Canvas {
|
||||
if (NeedUpdateIniP()) iniP = e.GetTouchPoint(inkCanvas).Position;
|
||||
if (drawingShapeMode == 9 && isFirstTouchCuboid == false) MouseTouchMove(iniP);
|
||||
inkCanvas.Opacity = 1;
|
||||
|
||||
// 如果已处于多指书写模式,禁用手掌擦功能
|
||||
if (isInMultiTouchMode) {
|
||||
isLastTouchEraser = false;
|
||||
currentPalmEraserShape = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果已经处于手掌擦状态,保持状态不变
|
||||
if (isLastTouchEraser && currentPalmEraserShape != null) {
|
||||
inkCanvas.EraserShape = currentPalmEraserShape;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
|
||||
return;
|
||||
}
|
||||
|
||||
double boundsWidth = GetTouchBoundWidth(e), eraserMultiplier = 1.0;
|
||||
if (!Settings.Advanced.EraserBindTouchMultiplier && Settings.Advanced.IsSpecialScreen)
|
||||
eraserMultiplier = 1 / Settings.Advanced.TouchMultiplier;
|
||||
if (boundsWidth > BoundsWidth) {
|
||||
|
||||
// 检查触控点数量,只有大于等于三个触控点时才激活手掌擦功能
|
||||
if (dec.Count >= 3 && boundsWidth > BoundsWidth) {
|
||||
// 保存当前的编辑模式,以便恢复
|
||||
if (!isLastTouchEraser) {
|
||||
prePalmEraserEditingMode = inkCanvas.EditingMode;
|
||||
// 模拟点击橡皮选项卡
|
||||
EraserIcon_Click(null, null);
|
||||
}
|
||||
|
||||
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;
|
||||
// 直接使用固定尺寸的矩形黑板擦形状,不随触控面积动态变化
|
||||
currentPalmEraserShape = GetPalmRectangleEraserShape(eraserMultiplier);
|
||||
inkCanvas.EraserShape = currentPalmEraserShape;
|
||||
TouchDownPointsList[e.TouchDevice.Id] = InkCanvasEditingMode.EraseByPoint;
|
||||
}
|
||||
else {
|
||||
if (StackPanelPPTControls.Visibility == Visibility.Visible && inkCanvas.Strokes.Count == 0 &&
|
||||
Settings.PowerPointSettings.IsEnableFingerGestureSlideShowControl) {
|
||||
isLastTouchEraser = false;
|
||||
currentPalmEraserShape = null;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.GestureOnly;
|
||||
inkCanvas.Opacity = 0.1;
|
||||
}
|
||||
else {
|
||||
inkCanvas.EraserShape = new EllipseStylusShape(5, 5);
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
|
||||
// 手掌橡皮固定为矩形黑板擦,大小由设置决定
|
||||
currentPalmEraserShape = GetPalmRectangleEraserShape(eraserMultiplier);
|
||||
inkCanvas.EraserShape = currentPalmEraserShape;
|
||||
TouchDownPointsList[e.TouchDevice.Id] = InkCanvasEditingMode.EraseByPoint;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
isLastTouchEraser = false;
|
||||
inkCanvas.EraserShape =
|
||||
forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5);
|
||||
if (forceEraser) return;
|
||||
currentPalmEraserShape = null;
|
||||
// 修复面积擦时不显示橡皮形状:无论 forcePointEraser 状态,均显示 50x50 橡皮
|
||||
inkCanvas.EraserShape = new EllipseStylusShape(50, 50);
|
||||
// 修复触屏状态下几何绘制功能不可用的问题:在几何绘制模式下不应该因为forceEraser而直接返回
|
||||
if (forceEraser && drawingShapeMode == 0) return;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
}
|
||||
}
|
||||
@@ -260,6 +331,9 @@ namespace Ink_Canvas {
|
||||
private InkCanvasEditingMode lastInkCanvasEditingMode = InkCanvasEditingMode.Ink;
|
||||
private bool isSingleFingerDragMode = false;
|
||||
|
||||
// 保存触发手掌擦前的编辑模式,用于手掌擦结束后恢复
|
||||
private InkCanvasEditingMode prePalmEraserEditingMode = InkCanvasEditingMode.Ink;
|
||||
|
||||
private void inkCanvas_PreviewTouchDown(object sender, TouchEventArgs e) {
|
||||
|
||||
inkCanvas.CaptureTouch(e.TouchDevice);
|
||||
@@ -286,7 +360,6 @@ namespace Ink_Canvas {
|
||||
}
|
||||
|
||||
private void inkCanvas_PreviewTouchUp(object sender, TouchEventArgs e) {
|
||||
|
||||
inkCanvas.ReleaseAllTouchCaptures();
|
||||
ViewboxFloatingBar.IsHitTestVisible = true;
|
||||
BlackboardUIGridForInkReplay.IsHitTestVisible = true;
|
||||
@@ -297,6 +370,33 @@ namespace Ink_Canvas {
|
||||
inkCanvas.EditingMode = lastInkCanvasEditingMode;
|
||||
dec.Remove(e.TouchDevice.Id);
|
||||
inkCanvas.Opacity = 1;
|
||||
|
||||
// 如果是手掌触发的面积擦抬起,需要确保橡皮擦形状被正确重置
|
||||
if (isLastTouchEraser && dec.Count == 0) {
|
||||
isLastTouchEraser = false;
|
||||
currentPalmEraserShape = null; // 清除保存的手掌擦形状
|
||||
|
||||
// 当手掌擦消失时,恢复到之前的编辑模式
|
||||
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint) {
|
||||
// 根据之前的编辑模式模拟点击相应的选项卡
|
||||
if (prePalmEraserEditingMode == InkCanvasEditingMode.Ink) {
|
||||
// 模拟点击批注选项卡
|
||||
PenIcon_Click(null, null);
|
||||
} else if (prePalmEraserEditingMode == InkCanvasEditingMode.None ||
|
||||
prePalmEraserEditingMode == InkCanvasEditingMode.Select) {
|
||||
// 模拟点击光标选项卡
|
||||
CursorIcon_Click(null, null);
|
||||
} else {
|
||||
// 其他编辑模式时恢复之前的模式
|
||||
inkCanvas.EditingMode = prePalmEraserEditingMode;
|
||||
if (forcePointEraser) {
|
||||
// 重新应用当前设置的橡皮擦形状
|
||||
ApplyCurrentEraserShape();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dec.Count == 0)
|
||||
if (lastTouchDownStrokeCollection.Count() != inkCanvas.Strokes.Count() &&
|
||||
!(drawingShapeMode == 9 && !isFirstTouchCuboid)) {
|
||||
@@ -318,27 +418,12 @@ namespace Ink_Canvas {
|
||||
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) {
|
||||
// 手掌擦时禁止移动/缩放
|
||||
if (isLastTouchEraser || inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint)
|
||||
return;
|
||||
// 三指及以上禁止缩放
|
||||
bool disableScale = dec.Count >= 3;
|
||||
if (isInMultiTouchMode || !Settings.Gesture.IsEnableTwoFingerGesture) return;
|
||||
if ((dec.Count >= 2 && (Settings.PowerPointSettings.IsEnableTwoFingerGestureInPresentationMode ||
|
||||
StackPanelPPTControls.Visibility != Visibility.Visible ||
|
||||
@@ -363,7 +448,7 @@ namespace Ink_Canvas {
|
||||
|
||||
if (Settings.Gesture.IsEnableTwoFingerRotation)
|
||||
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); // 缩放
|
||||
}
|
||||
|
||||
@@ -424,4 +509,4 @@ namespace Ink_Canvas {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,12 +54,34 @@ namespace Ink_Canvas
|
||||
|
||||
private void CloseAppTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e) {
|
||||
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) {
|
||||
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) {
|
||||
|
||||
@@ -49,5 +49,5 @@ using System.Windows;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("5.0.5.1")]
|
||||
[assembly: AssemblyFileVersion("5.0.5.1")]
|
||||
[assembly: AssemblyVersion("1.7.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.7.1.0")]
|
||||
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
@@ -1,4 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
@@ -48,9 +50,26 @@ namespace Ink_Canvas
|
||||
public bool FitToCurve { get; set; } = true;
|
||||
[JsonProperty("clearCanvasAndClearTimeMachine")]
|
||||
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("highPrecisionLineStraighten")]
|
||||
public bool HighPrecisionLineStraighten { get; set; } = true; // 是否启用高精度直线拉直
|
||||
[JsonProperty("lineEndpointSnapping")]
|
||||
public bool LineEndpointSnapping { get; set; } = true; // 是否启用直线端点吸附
|
||||
[JsonProperty("lineEndpointSnappingThreshold")]
|
||||
public int LineEndpointSnappingThreshold { get; set; } = 15; // 直线端点吸附的距离阈值(像素)
|
||||
|
||||
[JsonProperty("usingWhiteboard")]
|
||||
public bool UsingWhiteboard { get; set; }
|
||||
public bool UsingWhiteboard { get; set; } = false;
|
||||
|
||||
[JsonProperty("customBackgroundColor")]
|
||||
public string CustomBackgroundColor { get; set; } = "#162924";
|
||||
|
||||
[JsonProperty("hyperbolaAsymptoteOption")]
|
||||
public OptionalOperation HyperbolaAsymptoteOption { get; set; } = OptionalOperation.Ask;
|
||||
@@ -83,6 +102,13 @@ namespace Ink_Canvas
|
||||
public bool IsEnableTwoFingerRotationOnSelection { get; set; } = false;
|
||||
}
|
||||
|
||||
// 更新通道枚举
|
||||
public enum UpdateChannel
|
||||
{
|
||||
Release,
|
||||
Beta
|
||||
}
|
||||
|
||||
public class Startup
|
||||
{
|
||||
[JsonProperty("isAutoUpdate")]
|
||||
@@ -90,19 +116,19 @@ namespace Ink_Canvas
|
||||
[JsonProperty("isAutoUpdateWithSilence")]
|
||||
public bool IsAutoUpdateWithSilence { get; set; } = false;
|
||||
[JsonProperty("isAutoUpdateWithSilenceStartTime")]
|
||||
public string AutoUpdateWithSilenceStartTime { get; set; } = "00:00";
|
||||
public string AutoUpdateWithSilenceStartTime { get; set; } = "06:00";
|
||||
[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")]
|
||||
public bool IsEnableNibMode { get; set; } = false;
|
||||
/*
|
||||
[JsonProperty("isAutoHideCanvas")]
|
||||
public bool IsAutoHideCanvas { get; set; } = true;
|
||||
[JsonProperty("isAutoEnterModeFinger")]
|
||||
public bool IsAutoEnterModeFinger { get; set; } = false;*/
|
||||
[JsonProperty("isFoldAtStartup")]
|
||||
public bool IsFoldAtStartup { get; set; } = false;
|
||||
[JsonProperty("crashAction")]
|
||||
public int CrashAction { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class Appearance
|
||||
@@ -117,6 +143,8 @@ namespace Ink_Canvas
|
||||
public double ViewboxFloatingBarScaleTransformValue { get; set; } = 1.0;
|
||||
[JsonProperty("floatingBarImg")]
|
||||
public int FloatingBarImg { get; set; } = 0;
|
||||
[JsonProperty("customFloatingBarImgs")]
|
||||
public List<CustomFloatingBarIcon> CustomFloatingBarImgs { get; set; } = new List<CustomFloatingBarIcon>();
|
||||
[JsonProperty("viewboxFloatingBarOpacityValue")]
|
||||
public double ViewboxFloatingBarOpacityValue { get; set; } = 1.0;
|
||||
[JsonProperty("enableTrayIcon")]
|
||||
@@ -228,6 +256,9 @@ namespace Ink_Canvas
|
||||
|| IsAutoFoldInYiYunVisualPresenter
|
||||
|| IsAutoFoldInMaxHubWhiteboard;
|
||||
|
||||
[JsonProperty("isAutoEnterAnnotationModeWhenExitFoldMode")]
|
||||
public bool IsAutoEnterAnnotationModeWhenExitFoldMode { get; set; } = false;
|
||||
|
||||
[JsonProperty("isAutoFoldInEasiNote")]
|
||||
public bool IsAutoFoldInEasiNote { get; set; } = false;
|
||||
|
||||
@@ -308,7 +339,7 @@ namespace Ink_Canvas
|
||||
public bool IsAutoKillICA { get; set; } = false;
|
||||
|
||||
[JsonProperty("isAutoKillIDT")]
|
||||
public bool IsAutoKillIDT { get; set; } = true;
|
||||
public bool IsAutoKillIDT { get; set; } = false;
|
||||
|
||||
[JsonProperty("isSaveScreenshotsInDateFolders")]
|
||||
public bool IsSaveScreenshotsInDateFolders { get; set; } = false;
|
||||
@@ -326,13 +357,16 @@ namespace Ink_Canvas
|
||||
public int MinimumAutomationStrokeNumber { get; set; } = 0;
|
||||
|
||||
[JsonProperty("autoSavedStrokesLocation")]
|
||||
public string AutoSavedStrokesLocation = @"D:\Ink Canvas";
|
||||
public string AutoSavedStrokesLocation = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "saves");
|
||||
|
||||
[JsonProperty("autoDelSavedFiles")]
|
||||
public bool AutoDelSavedFiles = false;
|
||||
|
||||
[JsonProperty("autoDelSavedFilesDaysThreshold")]
|
||||
public int AutoDelSavedFilesDaysThreshold = 15;
|
||||
|
||||
[JsonProperty("isSaveFullPageStrokes")]
|
||||
public bool IsSaveFullPageStrokes = false;
|
||||
}
|
||||
|
||||
public class Advanced
|
||||
@@ -357,6 +391,9 @@ namespace Ink_Canvas
|
||||
|
||||
[JsonProperty("isLogEnabled")]
|
||||
public bool IsLogEnabled { get; set; } = true;
|
||||
|
||||
[JsonProperty("isSaveLogByDate")]
|
||||
public bool IsSaveLogByDate { get; set; } = true;
|
||||
|
||||
[JsonProperty("isEnableFullScreenHelper")]
|
||||
public bool IsEnableFullScreenHelper { get; set; } = false;
|
||||
@@ -397,6 +434,8 @@ namespace Ink_Canvas
|
||||
public bool IsInkToShapeRectangle { get; set; } = true;
|
||||
[JsonProperty("isInkToShapeRounded")]
|
||||
public bool IsInkToShapeRounded { get; set; } = true;
|
||||
[JsonProperty("lineStraightenSensitivity")]
|
||||
public double LineStraightenSensitivity { get; set; } = 0.20; // 直线检测灵敏度,值越小越严格(0.05-2.0)
|
||||
}
|
||||
|
||||
public class RandSettings {
|
||||
@@ -406,5 +445,49 @@ namespace Ink_Canvas
|
||||
public double RandWindowOnceCloseLatency { get; set; } = 2.5;
|
||||
[JsonProperty("randWindowOnceMaxStudents")]
|
||||
public int RandWindowOnceMaxStudents { get; set; } = 10;
|
||||
[JsonProperty("showRandomAndSingleDraw")]
|
||||
public bool ShowRandomAndSingleDraw { get; set; } = true;
|
||||
[JsonProperty("directCallCiRand")]
|
||||
public bool DirectCallCiRand { get; set; } = false;
|
||||
[JsonProperty("selectedBackgroundIndex")]
|
||||
public int SelectedBackgroundIndex { get; set; } = 0;
|
||||
[JsonProperty("customPickNameBackgrounds")]
|
||||
public List<CustomPickNameBackground> CustomPickNameBackgrounds { get; set; } = new List<CustomPickNameBackground>();
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomPickNameBackground
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("filePath")]
|
||||
public string FilePath { get; set; }
|
||||
|
||||
public CustomPickNameBackground(string name, string filePath)
|
||||
{
|
||||
Name = name;
|
||||
FilePath = filePath;
|
||||
}
|
||||
|
||||
// 用于JSON序列化
|
||||
public CustomPickNameBackground() { }
|
||||
}
|
||||
|
||||
public class CustomFloatingBarIcon
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("filePath")]
|
||||
public string FilePath { get; set; }
|
||||
|
||||
public CustomFloatingBarIcon(string name, string filePath)
|
||||
{
|
||||
Name = name;
|
||||
FilePath = filePath;
|
||||
}
|
||||
|
||||
// 用于JSON序列化
|
||||
public CustomFloatingBarIcon() { }
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,44 @@
|
||||
<Window x:Class="Ink_Canvas.AddCustomIconWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:local="clr-namespace:Ink_Canvas"
|
||||
mc:Ignorable="d"
|
||||
Title="添加自定义图标" Height="500" Width="750" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="添加自定义浮动栏图标" FontSize="18" FontWeight="Bold" Margin="0,0,0,15" Grid.Row="0"/>
|
||||
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,20">
|
||||
<TextBlock Text="选择图标文件:" VerticalAlignment="Center" FontSize="14"/>
|
||||
<TextBox Name="IconPathTextBox" Width="220" IsReadOnly="True" Margin="10,0" Height="25"/>
|
||||
<Button Content="浏览..." Click="BrowseButton_Click" Width="80" Height="45"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0,0,0,20">
|
||||
<TextBlock Text="图标名称:" VerticalAlignment="Center" FontSize="14"/>
|
||||
<TextBox Name="IconNameTextBox" Width="280" Margin="28,0,0,0" Height="25"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="3" Text="预览:" Margin="0,0,0,8" FontSize="14"/>
|
||||
|
||||
<Border Grid.Row="4" BorderBrush="#CCCCCC" BorderThickness="1" Padding="8" HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<Image Name="IconPreviewImage" Width="72" Height="72" Stretch="Uniform"/>
|
||||
</Border>
|
||||
|
||||
<StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,25,0,0">
|
||||
<Button Content="取消" Width="100" Height="30" Click="CancelButton_Click" Margin="0,0,15,0"/>
|
||||
<Button Name="SaveButton" Content="保存" Width="100" Height="30" Click="SaveButton_Click" IsEnabled="False"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
/// <summary>
|
||||
/// AddCustomIconWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class AddCustomIconWindow : Window
|
||||
{
|
||||
private MainWindow mainWindow;
|
||||
private string selectedFilePath;
|
||||
public bool IsSuccess { get; private set; }
|
||||
|
||||
public AddCustomIconWindow(MainWindow owner)
|
||||
{
|
||||
InitializeComponent();
|
||||
mainWindow = owner;
|
||||
IsSuccess = false;
|
||||
|
||||
// 添加TextBox内容变化事件以检查是否可以保存
|
||||
IconNameTextBox.TextChanged += (s, e) => ValidateSaveButton();
|
||||
}
|
||||
|
||||
private void BrowseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog
|
||||
{
|
||||
Filter = "图像文件|*.png;*.jpg;*.jpeg;*.bmp;*.gif;*.ico",
|
||||
Title = "选择一个图标文件"
|
||||
};
|
||||
|
||||
if (openFileDialog.ShowDialog() == true)
|
||||
{
|
||||
selectedFilePath = openFileDialog.FileName;
|
||||
IconPathTextBox.Text = selectedFilePath;
|
||||
|
||||
// 显示预览
|
||||
try
|
||||
{
|
||||
BitmapImage bitmap = new BitmapImage();
|
||||
bitmap.BeginInit();
|
||||
bitmap.UriSource = new Uri(selectedFilePath);
|
||||
bitmap.EndInit();
|
||||
IconPreviewImage.Source = bitmap;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"无法加载图像: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
|
||||
// 自动填充名称建议(文件名,不包括扩展名)
|
||||
string suggestedName = Path.GetFileNameWithoutExtension(selectedFilePath);
|
||||
IconNameTextBox.Text = suggestedName;
|
||||
|
||||
ValidateSaveButton();
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidateSaveButton()
|
||||
{
|
||||
SaveButton.IsEnabled = !string.IsNullOrWhiteSpace(IconNameTextBox.Text) && !string.IsNullOrEmpty(selectedFilePath);
|
||||
}
|
||||
|
||||
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void SaveButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 创建pictures/icons文件夹结构(如果不存在)
|
||||
string picturesFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "pictures");
|
||||
string iconsFolder = Path.Combine(picturesFolder, "icons");
|
||||
|
||||
if (!Directory.Exists(picturesFolder))
|
||||
{
|
||||
Directory.CreateDirectory(picturesFolder);
|
||||
}
|
||||
|
||||
if (!Directory.Exists(iconsFolder))
|
||||
{
|
||||
Directory.CreateDirectory(iconsFolder);
|
||||
}
|
||||
|
||||
// 生成一个唯一的文件名(使用GUID)
|
||||
string extension = Path.GetExtension(selectedFilePath);
|
||||
string newFileName = $"{Guid.NewGuid()}{extension}";
|
||||
string destPath = Path.Combine(iconsFolder, newFileName);
|
||||
|
||||
// 复制文件到pictures/icons文件夹
|
||||
File.Copy(selectedFilePath, destPath);
|
||||
|
||||
// 创建新的自定义图标对象
|
||||
var customIcon = new CustomFloatingBarIcon(IconNameTextBox.Text, destPath);
|
||||
|
||||
// 添加到主窗口的设置中
|
||||
MainWindow.Settings.Appearance.CustomFloatingBarImgs.Add(customIcon);
|
||||
|
||||
// 更新ComboBox
|
||||
mainWindow.UpdateCustomIconsInComboBox();
|
||||
|
||||
// 保存设置
|
||||
MainWindow.SaveSettingsToFile();
|
||||
|
||||
IsSuccess = true;
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"保存图标时出错: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<Window x:Class="Ink_Canvas.AddPickNameBackgroundWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:local="clr-namespace:Ink_Canvas"
|
||||
mc:Ignorable="d"
|
||||
Title="添加自定义点名背景" Height="550" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="添加自定义点名背景" FontSize="20" FontWeight="Bold" Margin="0,0,0,20" Grid.Row="0"/>
|
||||
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,20">
|
||||
<TextBlock Text="选择背景图片:" VerticalAlignment="Center" FontSize="14"/>
|
||||
<TextBox Name="BackgroundPathTextBox" Width="400" IsReadOnly="True" Margin="10,0" Height="25"/>
|
||||
<Button Content="浏览..." Click="BrowseButton_Click" Width="100" Height="45"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0,0,0,20">
|
||||
<TextBlock Text="背景名称:" VerticalAlignment="Center" FontSize="14"/>
|
||||
<TextBox Name="BackgroundNameTextBox" Width="400" Margin="28,0,0,0" Height="25"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="3" Text="预览:" Margin="0,0,0,10" FontSize="14"/>
|
||||
|
||||
<Border Grid.Row="4" BorderBrush="#CCCCCC" BorderThickness="1" Padding="8">
|
||||
<Grid>
|
||||
<Image Name="BackgroundPreviewImage" Stretch="Uniform" MaxHeight="250"/>
|
||||
<TextBlock Text="未选择图片" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="Gray" FontSize="16" Name="NoImageText"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,25,0,0">
|
||||
<Button Content="取消" Width="120" Height="40" Click="CancelButton_Click" Margin="0,0,15,0"/>
|
||||
<Button Name="SaveButton" Content="保存" Width="120" Height="40" Click="SaveButton_Click" IsEnabled="False"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
/// <summary>
|
||||
/// AddPickNameBackgroundWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class AddPickNameBackgroundWindow : Window
|
||||
{
|
||||
private MainWindow mainWindow;
|
||||
private string selectedFilePath;
|
||||
public bool IsSuccess { get; private set; }
|
||||
|
||||
public AddPickNameBackgroundWindow(MainWindow owner)
|
||||
{
|
||||
InitializeComponent();
|
||||
mainWindow = owner;
|
||||
IsSuccess = false;
|
||||
|
||||
// 添加TextBox内容变化事件以检查是否可以保存
|
||||
BackgroundNameTextBox.TextChanged += (s, e) => ValidateSaveButton();
|
||||
}
|
||||
|
||||
private void BrowseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog
|
||||
{
|
||||
Filter = "图像文件|*.png;*.jpg;*.jpeg;*.bmp;*.gif",
|
||||
Title = "选择一个背景图片"
|
||||
};
|
||||
|
||||
if (openFileDialog.ShowDialog() == true)
|
||||
{
|
||||
selectedFilePath = openFileDialog.FileName;
|
||||
BackgroundPathTextBox.Text = selectedFilePath;
|
||||
|
||||
// 显示预览
|
||||
try
|
||||
{
|
||||
BitmapImage bitmap = new BitmapImage();
|
||||
bitmap.BeginInit();
|
||||
bitmap.UriSource = new Uri(selectedFilePath);
|
||||
bitmap.EndInit();
|
||||
BackgroundPreviewImage.Source = bitmap;
|
||||
NoImageText.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"无法加载图像: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
|
||||
// 自动填充名称建议(文件名,不包括扩展名)
|
||||
string suggestedName = Path.GetFileNameWithoutExtension(selectedFilePath);
|
||||
BackgroundNameTextBox.Text = suggestedName;
|
||||
|
||||
ValidateSaveButton();
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidateSaveButton()
|
||||
{
|
||||
SaveButton.IsEnabled = !string.IsNullOrWhiteSpace(BackgroundNameTextBox.Text) && !string.IsNullOrEmpty(selectedFilePath);
|
||||
}
|
||||
|
||||
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void SaveButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 创建pictures/picknamebackgrounds文件夹结构(如果不存在)
|
||||
string picturesFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "pictures");
|
||||
string backgroundsFolder = Path.Combine(picturesFolder, "picknamebackgrounds");
|
||||
|
||||
if (!Directory.Exists(picturesFolder))
|
||||
{
|
||||
Directory.CreateDirectory(picturesFolder);
|
||||
}
|
||||
|
||||
if (!Directory.Exists(backgroundsFolder))
|
||||
{
|
||||
Directory.CreateDirectory(backgroundsFolder);
|
||||
}
|
||||
|
||||
// 生成一个唯一的文件名(使用GUID)
|
||||
string extension = Path.GetExtension(selectedFilePath);
|
||||
string newFileName = $"{Guid.NewGuid()}{extension}";
|
||||
string destPath = Path.Combine(backgroundsFolder, newFileName);
|
||||
|
||||
// 复制文件到pictures/picknamebackgrounds文件夹
|
||||
File.Copy(selectedFilePath, destPath);
|
||||
|
||||
// 创建新的自定义背景对象
|
||||
var customBackground = new CustomPickNameBackground(BackgroundNameTextBox.Text, destPath);
|
||||
|
||||
// 添加到主窗口的设置中
|
||||
MainWindow.Settings.RandSettings.CustomPickNameBackgrounds.Add(customBackground);
|
||||
|
||||
// 更新ComboBox
|
||||
mainWindow.UpdatePickNameBackgroundsInComboBox();
|
||||
|
||||
// 保存设置
|
||||
MainWindow.SaveSettingsToFile();
|
||||
|
||||
IsSuccess = true;
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"保存背景时出错: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<Window x:Class="Ink_Canvas.CustomIconWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:local="clr-namespace:Ink_Canvas"
|
||||
mc:Ignorable="d"
|
||||
Title="自定义浮动栏图标" Height="450" Width="500" WindowStartupLocation="CenterScreen">
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="自定义浮动栏图标管理" FontSize="20" FontWeight="Bold" Margin="0,0,0,15"/>
|
||||
|
||||
<ListView Grid.Row="1" Name="CustomIconsListView" BorderBrush="#CCCCCC" BorderThickness="1">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Header="预览" Width="80">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Image Source="{Binding FilePath}" Width="32" Height="32"/>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Header="名称" Width="200" DisplayMemberBinding="{Binding Name}"/>
|
||||
<GridViewColumn Header="操作" Width="100">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="删除" Click="DeleteCustomIcon_Click" Tag="{Binding}"/>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,15,0,0">
|
||||
<Button Content="关闭" Width="80" Click="CloseButton_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
/// <summary>
|
||||
/// CustomIconWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class CustomIconWindow : Window
|
||||
{
|
||||
private MainWindow mainWindow;
|
||||
public ObservableCollection<CustomFloatingBarIcon> CustomIcons { get; set; }
|
||||
|
||||
public CustomIconWindow(MainWindow owner)
|
||||
{
|
||||
InitializeComponent();
|
||||
mainWindow = owner;
|
||||
|
||||
// 从主窗口的设置获取自定义图标列表
|
||||
CustomIcons = new ObservableCollection<CustomFloatingBarIcon>(MainWindow.Settings.Appearance.CustomFloatingBarImgs);
|
||||
CustomIconsListView.ItemsSource = CustomIcons;
|
||||
}
|
||||
|
||||
private void DeleteCustomIcon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.Tag is CustomFloatingBarIcon icon)
|
||||
{
|
||||
// 从列表中移除图标
|
||||
CustomIcons.Remove(icon);
|
||||
|
||||
// 更新主窗口的设置
|
||||
MainWindow.Settings.Appearance.CustomFloatingBarImgs.Clear();
|
||||
foreach (var customIcon in CustomIcons)
|
||||
{
|
||||
MainWindow.Settings.Appearance.CustomFloatingBarImgs.Add(customIcon);
|
||||
}
|
||||
|
||||
// 如果当前选中的是被删除的图标,重置为默认图标
|
||||
if (MainWindow.Settings.Appearance.FloatingBarImg >= 8 &&
|
||||
MainWindow.Settings.Appearance.FloatingBarImg - 8 >= MainWindow.Settings.Appearance.CustomFloatingBarImgs.Count)
|
||||
{
|
||||
MainWindow.Settings.Appearance.FloatingBarImg = 0;
|
||||
mainWindow.ComboBoxFloatingBarImg.SelectedIndex = 0;
|
||||
mainWindow.UpdateFloatingBarIcon();
|
||||
}
|
||||
|
||||
// 更新ComboBox
|
||||
mainWindow.UpdateCustomIconsInComboBox();
|
||||
|
||||
// 保存设置
|
||||
MainWindow.SaveSettingsToFile();
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,23 +10,27 @@
|
||||
ui:WindowHelper.UseModernWindowStyle = "True"
|
||||
ui:WindowHelper.SystemBackdropType="Mica"
|
||||
ui:TitleBar.Height="36"
|
||||
Title="InkCanvasForClass有新版本可用" Height="475" Width="800" ResizeMode="NoResize">
|
||||
<Grid Background="#fafafa">
|
||||
<ui:SimpleStackPanel VerticalAlignment="Stretch" Spacing="0">
|
||||
Title="InkCanvasForClass CE有新版本可用" Height="600" Width="850" ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<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="Vertical" Width="685" Margin="24,18,0,12" Spacing="2">
|
||||
<TextBlock Text="InkCanvasForClass 新版本来了!" FontSize="24" FontWeight="Bold" Foreground="White" TextAlignment="Left"/>
|
||||
<ui:SimpleStackPanel Orientation="Vertical" Width="735" Margin="24,18,0,12" Spacing="2">
|
||||
<TextBlock Text="InkCanvasForClass CE新版本来了!" FontSize="24" FontWeight="Bold" Foreground="White" TextAlignment="Left"/>
|
||||
<TextBlock Text="希望您能喜欢我们的新版本 :-)" FontSize="20" TextAlignment="Left" Foreground="White"/>
|
||||
</ui:SimpleStackPanel>
|
||||
<Image Source="/Resources/Icons-fluent/party.png" Width="72" Height="72"/>
|
||||
</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">
|
||||
<mdxam:MarkdownScrollViewer xml:space="preserve" Foreground="Black" MarkdownStyleName="GithubLike">
|
||||
<!-- 更新内容 -->
|
||||
<Border BorderBrush="#3f3f46" Background="White" BorderThickness="1" CornerRadius="4" Margin="24,16,24,0">
|
||||
<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更新带来了如下新功能供您探索:
|
||||
你好,旅行者们,本次InkCanvasForClass Community Edition更新带来了如下新功能供您探索:
|
||||
|
||||
1. 全新设计的UI界面,包括浮动工具栏和白板页面均经过重新设计,更加现代化的UI让您在使用的过程中更加舒适。
|
||||
2. 带来了实时修改橡皮大小和橡皮形状的菜单。您可以选择使用圆形橡皮,方形橡皮,和类似希沃白板的真实黑板擦(矩形)橡皮。
|
||||
@@ -39,21 +43,42 @@
|
||||
</mdxam:MarkdownScrollViewer>
|
||||
</ui:ScrollViewerEx>
|
||||
</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 Orientation="Horizontal" HorizontalAlignment="Center" Spacing="12">
|
||||
<Button Content="立刻更新" Foreground="White" HorizontalAlignment="Center" Margin="0,10,0,0">
|
||||
<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 Content="下次更新" Foreground="Black" HorizontalAlignment="Center" Margin="0,10,0,0"/>
|
||||
<Button Content="跳过该版本" HorizontalAlignment="Center" Foreground="#71717a" Margin="0,10,0,0"/>
|
||||
|
||||
<!-- 更新按钮组 -->
|
||||
<Border Background="#f1f5f9" BorderBrush="#e2e8f0" BorderThickness="1" CornerRadius="4" Margin="24,16,24,20">
|
||||
<ui:SimpleStackPanel Orientation="Vertical" HorizontalAlignment="Center" Spacing="14" Margin="0,16,0,16">
|
||||
<TextBlock Text="请选择更新方式" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center" Margin="0,0,0,6"/>
|
||||
|
||||
<!-- 立即更新按钮 -->
|
||||
<Button x:Name="UpdateNowButton" Content="立刻下载并安装" Foreground="White" FontSize="15" FontWeight="SemiBold"
|
||||
Padding="20,10" Width="360" Height="48" HorizontalAlignment="Center"
|
||||
Click="UpdateNowButton_Click" ToolTip="立即下载更新并在完成后安装" Visibility="Visible" IsEnabled="True">
|
||||
<Button.Resources>
|
||||
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundKey}" Color="#15803d"/>
|
||||
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundPointerOverKey}" Color="#15803d"/>
|
||||
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundPressedKey}" Color="#166534"/>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
|
||||
<!-- 稍后更新按钮 -->
|
||||
<Button x:Name="UpdateLaterButton" Content="下载并在软件关闭时安装" Foreground="Black" FontSize="15"
|
||||
Padding="20,10" Width="360" Height="48" HorizontalAlignment="Center"
|
||||
Click="UpdateLaterButton_Click" Background="#e2e8f0" BorderBrush="#cbd5e1"
|
||||
ToolTip="后台下载更新,在软件关闭时自动安装" Visibility="Visible" IsEnabled="True"/>
|
||||
|
||||
<!-- 跳过版本按钮 -->
|
||||
<Button x:Name="SkipVersionButton" Content="跳过该版本" HorizontalAlignment="Center" Foreground="#71717a"
|
||||
FontSize="15" Padding="20,10" Width="360" Height="48" Click="SkipVersionButton_Click"
|
||||
Background="#f8fafc" BorderBrush="#cbd5e1" ToolTip="跳过此版本更新" Visibility="Visible" IsEnabled="True"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
</ui:SimpleStackPanel>
|
||||
</ui:SimpleStackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Window>
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Ink_Canvas
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -55,12 +55,238 @@ namespace Ink_Canvas
|
||||
{
|
||||
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();
|
||||
|
||||
// 设置版本信息
|
||||
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);
|
||||
Trace.WriteLine(new WindowInteropHelper(this).Handle);
|
||||
|
||||
// 设置深色模式
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<Window x:Class="Ink_Canvas.ManagePickNameBackgroundsWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:local="clr-namespace:Ink_Canvas"
|
||||
mc:Ignorable="d"
|
||||
Title="管理点名背景" Height="500" Width="750" WindowStartupLocation="CenterScreen">
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="管理自定义点名背景" FontSize="20" FontWeight="Bold" Margin="0,0,0,15"/>
|
||||
|
||||
<ListView Grid.Row="1" Name="BackgroundsListView" BorderBrush="#CCCCCC" BorderThickness="1">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Header="预览" Width="150">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderThickness="1" BorderBrush="#CCCCCC">
|
||||
<Image Source="{Binding FilePath}" Width="140" Height="80" Stretch="Uniform"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Header="名称" Width="300" DisplayMemberBinding="{Binding Name}"/>
|
||||
<GridViewColumn Header="操作" Width="200">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Content="设为当前" Width="90" Margin="0,0,5,0" Click="SetAsCurrentButton_Click" Tag="{Binding}"/>
|
||||
<Button Content="删除" Width="70" Click="DeleteBackgroundButton_Click" Tag="{Binding}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,15,0,0">
|
||||
<Button Content="关闭" Width="120" Height="40" Click="CloseButton_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
/// <summary>
|
||||
/// ManagePickNameBackgroundsWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ManagePickNameBackgroundsWindow : Window
|
||||
{
|
||||
private MainWindow mainWindow;
|
||||
public ObservableCollection<CustomPickNameBackground> Backgrounds { get; set; }
|
||||
|
||||
public ManagePickNameBackgroundsWindow(MainWindow owner)
|
||||
{
|
||||
InitializeComponent();
|
||||
mainWindow = owner;
|
||||
|
||||
// 从主窗口的设置获取自定义背景列表
|
||||
Backgrounds = new ObservableCollection<CustomPickNameBackground>(MainWindow.Settings.RandSettings.CustomPickNameBackgrounds);
|
||||
BackgroundsListView.ItemsSource = Backgrounds;
|
||||
}
|
||||
|
||||
private void SetAsCurrentButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.Tag is CustomPickNameBackground background)
|
||||
{
|
||||
// 找到背景在列表中的索引(加8,因为前8个是默认值)
|
||||
int index = Backgrounds.IndexOf(background) + 1; // 增加1因为索引0将是"默认"
|
||||
|
||||
// 更新设置
|
||||
MainWindow.Settings.RandSettings.SelectedBackgroundIndex = index;
|
||||
|
||||
// 更新UI
|
||||
mainWindow.UpdatePickNameBackgroundDisplay();
|
||||
|
||||
// 保存设置
|
||||
MainWindow.SaveSettingsToFile();
|
||||
|
||||
MessageBox.Show($"已将\"{background.Name}\"设置为当前点名背景", "设置成功", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteBackgroundButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && button.Tag is CustomPickNameBackground background)
|
||||
{
|
||||
if (MessageBox.Show($"确定要删除背景\"{background.Name}\"吗?", "确认删除", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 尝试删除文件
|
||||
if (File.Exists(background.FilePath))
|
||||
{
|
||||
File.Delete(background.FilePath);
|
||||
}
|
||||
|
||||
// 从列表中移除背景
|
||||
Backgrounds.Remove(background);
|
||||
|
||||
// 更新主窗口的设置
|
||||
MainWindow.Settings.RandSettings.CustomPickNameBackgrounds.Clear();
|
||||
foreach (var bg in Backgrounds)
|
||||
{
|
||||
MainWindow.Settings.RandSettings.CustomPickNameBackgrounds.Add(bg);
|
||||
}
|
||||
|
||||
// 如果当前选中的是被删除的背景,重置为默认背景
|
||||
int selectedIndex = MainWindow.Settings.RandSettings.SelectedBackgroundIndex;
|
||||
if (selectedIndex > 0 && selectedIndex - 1 >= MainWindow.Settings.RandSettings.CustomPickNameBackgrounds.Count)
|
||||
{
|
||||
MainWindow.Settings.RandSettings.SelectedBackgroundIndex = 0;
|
||||
mainWindow.UpdatePickNameBackgroundDisplay();
|
||||
}
|
||||
|
||||
// 更新ComboBox
|
||||
mainWindow.UpdatePickNameBackgroundsInComboBox();
|
||||
|
||||
// 保存设置
|
||||
MainWindow.SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"删除背景时出错: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
<Window x:Class="Ink_Canvas.Windows.PluginSettingsWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:local="clr-namespace:Ink_Canvas.Windows"
|
||||
mc:Ignorable="d"
|
||||
Title="插件管理" Height="550" Width="800"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
ResizeMode="CanResize"
|
||||
Background="#F9F9F9">
|
||||
|
||||
<Window.Resources>
|
||||
<!-- 定义必要的资源 -->
|
||||
<SolidColorBrush x:Key="BorderBrush" Color="#DDDDDD"/>
|
||||
<SolidColorBrush x:Key="SystemAccentColorLight1" Color="#3B82F6"/>
|
||||
<SolidColorBrush x:Key="SystemAccentColor" Color="#2563EB"/>
|
||||
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumBrush" Color="#F0F0F0"/>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题栏 -->
|
||||
<Border Grid.Row="0" Background="{DynamicResource SystemAccentColorLight1}" Height="60">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0,0,0">
|
||||
<TextBlock Text="插件管理" FontSize="22" FontWeight="SemiBold" Foreground="White" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<Button x:Name="BtnClose" Content="" FontFamily="Segoe MDL2 Assets"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,20,0"
|
||||
Background="Transparent" BorderThickness="0" FontSize="16" Foreground="White"
|
||||
Click="BtnClose_Click"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 主内容区 -->
|
||||
<Grid Grid.Row="1" Margin="20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="250"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 左侧插件列表 -->
|
||||
<Border Grid.Column="0" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Margin="0,0,10,0" CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Text="插件列表" Margin="10,10,0,5" FontSize="16" FontWeight="SemiBold"/>
|
||||
|
||||
<ListView Grid.Row="1" x:Name="PluginListView" BorderThickness="0" Margin="0,5,0,0"
|
||||
SelectionChanged="PluginListView_SelectionChanged">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Name}" Grid.Column="0" VerticalAlignment="Center"
|
||||
Foreground="Black" FontWeight="Normal" FontSize="14"/>
|
||||
<ui:ToggleSwitch Grid.Column="1" IsOn="{Binding IsEnabled}"
|
||||
Toggled="PluginToggleSwitch_Toggled"
|
||||
Tag="{Binding}" MinWidth="40"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 右侧插件详情和设置 -->
|
||||
<ScrollViewer Grid.Column="1" Margin="10,0,0,0" VerticalScrollBarVisibility="Auto">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 插件详情 -->
|
||||
<Border Grid.Row="0" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Padding="15" CornerRadius="5">
|
||||
<Grid x:Name="PluginDetailGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="名称:" FontWeight="SemiBold" Margin="0,0,0,5"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Name}" Margin="0,0,0,5"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="版本:" FontWeight="SemiBold" Margin="0,0,0,5"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Version}" Margin="0,0,0,5"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="作者:" FontWeight="SemiBold" Margin="0,0,0,5"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Author}" Margin="0,0,0,5"/>
|
||||
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="描述:" FontWeight="SemiBold" Margin="0,0,0,5"/>
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding Description}" TextWrapping="Wrap" Margin="0,0,0,5"/>
|
||||
|
||||
<Button Grid.Row="3" Grid.Column="2" x:Name="BtnDeletePlugin" Content="删除插件"
|
||||
Visibility="Collapsed" Click="BtnDeletePlugin_Click"
|
||||
Margin="10,0,0,0" Padding="8,3" HorizontalAlignment="Right"
|
||||
Background="#FFEE5555" Foreground="White"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 插件设置区域 -->
|
||||
<Border Grid.Row="1" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Margin="0,10,0,0" Padding="15" CornerRadius="5">
|
||||
<StackPanel>
|
||||
<TextBlock Text="插件设置" FontSize="16" FontWeight="SemiBold" Margin="0,0,0,10"/>
|
||||
<ContentControl x:Name="PluginSettingsContainer" MinHeight="50"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 插件配置内容区 -->
|
||||
<Border Grid.Row="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Margin="0,10,0,0" Padding="0" CornerRadius="5">
|
||||
<ContentControl x:Name="PluginContentContainer" Margin="0"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<Border Grid.Row="2" Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}" Height="60">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20,0,0,0">
|
||||
<Button x:Name="BtnLoadPlugin" Content="加载本地插件" Click="BtnLoadPlugin_Click"
|
||||
Padding="15,5" Background="{DynamicResource SystemAccentColor}" Foreground="White"/>
|
||||
<Button x:Name="BtnSaveConfig" Content="保存状态" Click="BtnSaveConfig_Click"
|
||||
Padding="15,5" Margin="10,0,0,0" Background="{DynamicResource SystemAccentColor}" Foreground="White"
|
||||
ToolTip="手动保存当前所有插件的启用/禁用状态到配置文件"/>
|
||||
<Button x:Name="BtnExportPlugin" Content="导出插件" Click="BtnExportPlugin_Click"
|
||||
Padding="15,5" Margin="10,0,0,0" Background="{DynamicResource SystemAccentColor}" Foreground="White"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,711 @@
|
||||
using Ink_Canvas.Helpers.Plugins;
|
||||
using Ink_Canvas.Helpers.Plugins.BuiltIn;
|
||||
using Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Ink_Canvas.Helpers;
|
||||
using System.Linq;
|
||||
|
||||
namespace Ink_Canvas.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// PluginSettingsWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PluginSettingsWindow : Window, INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 刷新插件列表
|
||||
/// </summary>
|
||||
public void RefreshPluginList()
|
||||
{
|
||||
LoadPlugins();
|
||||
|
||||
// 如果当前选中的插件仍然存在,保持其选中状态
|
||||
if (SelectedPlugin != null)
|
||||
{
|
||||
var matchingPlugin = Plugins.FirstOrDefault(p => p.Plugin.GetType().FullName == SelectedPlugin.GetType().FullName);
|
||||
if (matchingPlugin != null)
|
||||
{
|
||||
PluginListView.SelectedItem = matchingPlugin;
|
||||
}
|
||||
}
|
||||
|
||||
OnPropertyChanged(nameof(SelectedPlugin));
|
||||
LogHelper.WriteLogToFile("插件列表已刷新", LogHelper.LogType.Info);
|
||||
}
|
||||
|
||||
private IPlugin _selectedPlugin;
|
||||
|
||||
/// <summary>
|
||||
/// 当前选中的插件
|
||||
/// </summary>
|
||||
public IPlugin SelectedPlugin
|
||||
{
|
||||
get => _selectedPlugin;
|
||||
set
|
||||
{
|
||||
if (_selectedPlugin != value)
|
||||
{
|
||||
_selectedPlugin = value;
|
||||
OnPropertyChanged(nameof(SelectedPlugin));
|
||||
OnPropertyChanged(nameof(Name));
|
||||
OnPropertyChanged(nameof(Version));
|
||||
OnPropertyChanged(nameof(Author));
|
||||
OnPropertyChanged(nameof(Description));
|
||||
OnPropertyChanged(nameof(IsEnabled));
|
||||
OnPropertyChanged(nameof(IsBuiltIn));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string Name => SelectedPlugin?.Name ?? string.Empty;
|
||||
public string Version => SelectedPlugin?.Version?.ToString() ?? string.Empty;
|
||||
public string Author => SelectedPlugin?.Author ?? string.Empty;
|
||||
public string Description => SelectedPlugin?.Description ?? string.Empty;
|
||||
public bool IsEnabled => SelectedPlugin is PluginBase plugin && plugin.IsEnabled;
|
||||
public bool IsBuiltIn => SelectedPlugin?.IsBuiltIn ?? false;
|
||||
|
||||
/// <summary>
|
||||
/// 插件列表
|
||||
/// </summary>
|
||||
public ObservableCollection<PluginViewModel> Plugins { get; } = new ObservableCollection<PluginViewModel>();
|
||||
|
||||
public PluginSettingsWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置数据上下文
|
||||
PluginDetailGrid.DataContext = this;
|
||||
|
||||
// 设置导出按钮初始状态
|
||||
BtnExportPlugin.IsEnabled = false;
|
||||
BtnExportPlugin.ToolTip = "请先选择要导出的插件";
|
||||
|
||||
// 加载插件列表
|
||||
LoadPlugins();
|
||||
|
||||
// 注册窗口关闭事件
|
||||
this.Closing += PluginSettingsWindow_Closing;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗口关闭事件处理
|
||||
/// </summary>
|
||||
private void PluginSettingsWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 保存插件配置
|
||||
LogHelper.WriteLogToFile("插件管理窗口关闭,保存插件配置...", LogHelper.LogType.Info);
|
||||
PluginManager.Instance.SaveConfig();
|
||||
LogHelper.WriteLogToFile("插件配置已保存", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"关闭窗口时保存插件配置出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载插件列表
|
||||
/// </summary>
|
||||
private void LoadPlugins()
|
||||
{
|
||||
Plugins.Clear();
|
||||
|
||||
LogHelper.WriteLogToFile($"开始加载插件列表到UI,插件总数: {PluginManager.Instance.Plugins.Count}", LogHelper.LogType.Info);
|
||||
|
||||
// 添加所有已加载的插件
|
||||
foreach (var plugin in PluginManager.Instance.Plugins)
|
||||
{
|
||||
bool isEnabled = false;
|
||||
|
||||
// 从插件实例获取启用状态
|
||||
if (plugin is PluginBase pluginBase)
|
||||
{
|
||||
isEnabled = pluginBase.IsEnabled;
|
||||
}
|
||||
|
||||
// 记录插件详细信息
|
||||
LogHelper.WriteLogToFile($"正在加载插件到UI: 类型={plugin.GetType().FullName}, 名称={plugin.Name ?? "未命名"}, 状态={isEnabled}",
|
||||
LogHelper.LogType.Info);
|
||||
|
||||
// 创建视图模型并添加到集合
|
||||
var viewModel = new PluginViewModel(plugin)
|
||||
{
|
||||
IsEnabled = isEnabled
|
||||
};
|
||||
Plugins.Add(viewModel);
|
||||
|
||||
LogHelper.WriteLogToFile($"已加载插件到UI列表: {plugin.Name},状态: {(isEnabled ? "启用" : "禁用")}", LogHelper.LogType.Info);
|
||||
}
|
||||
|
||||
// 绑定到ListView
|
||||
LogHelper.WriteLogToFile($"绑定 {Plugins.Count} 个插件到ListView", LogHelper.LogType.Info);
|
||||
PluginListView.ItemsSource = Plugins;
|
||||
|
||||
// 如果有插件,选择第一个
|
||||
if (Plugins.Count > 0)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"选择第一个插件: {Plugins[0].Name}", LogHelper.LogType.Info);
|
||||
PluginListView.SelectedIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogToFile("没有找到任何插件", LogHelper.LogType.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新属性变更通知
|
||||
/// </summary>
|
||||
/// <param name="propertyName">属性名称</param>
|
||||
protected void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插件列表选择变更事件
|
||||
/// </summary>
|
||||
private void PluginListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (PluginListView.SelectedItem is PluginViewModel viewModel)
|
||||
{
|
||||
// 设置当前选中的插件
|
||||
SelectedPlugin = viewModel.Plugin;
|
||||
|
||||
// 加载插件设置界面
|
||||
PluginSettingsContainer.Content = SelectedPlugin.GetSettingsView();
|
||||
|
||||
// 设置删除按钮的可见性
|
||||
BtnDeletePlugin.Visibility = !SelectedPlugin.IsBuiltIn ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
// 设置导出按钮的可用状态
|
||||
BtnExportPlugin.IsEnabled = !SelectedPlugin.IsBuiltIn;
|
||||
if (SelectedPlugin.IsBuiltIn)
|
||||
{
|
||||
BtnExportPlugin.ToolTip = "内置插件无法导出";
|
||||
}
|
||||
else
|
||||
{
|
||||
BtnExportPlugin.ToolTip = "将插件导出为.iccpp文件";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedPlugin = null;
|
||||
PluginSettingsContainer.Content = null;
|
||||
BtnDeletePlugin.Visibility = Visibility.Collapsed;
|
||||
BtnExportPlugin.IsEnabled = false;
|
||||
BtnExportPlugin.ToolTip = "请先选择要导出的插件";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载本地插件按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnLoadPlugin_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 创建文件对话框
|
||||
OpenFileDialog dialog = new OpenFileDialog
|
||||
{
|
||||
Filter = "ICC插件文件(*.iccpp)|*.iccpp",
|
||||
Title = "选择要加载的插件文件"
|
||||
};
|
||||
|
||||
// 显示对话框
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
// 获取插件文件路径
|
||||
string pluginPath = dialog.FileName;
|
||||
|
||||
// 检查是否在Plugins目录下
|
||||
string pluginsDirectory = Path.Combine(App.RootPath, "Plugins");
|
||||
string targetPath = Path.Combine(pluginsDirectory, Path.GetFileName(pluginPath));
|
||||
|
||||
// 确保Plugins目录存在
|
||||
if (!Directory.Exists(pluginsDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(pluginsDirectory);
|
||||
}
|
||||
|
||||
// 如果插件不在Plugins目录下,复制过去
|
||||
if (!string.Equals(pluginPath, targetPath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
File.Copy(pluginPath, targetPath, true);
|
||||
pluginPath = targetPath;
|
||||
}
|
||||
|
||||
// 加载插件
|
||||
IPlugin plugin = PluginManager.Instance.LoadExternalPlugin(pluginPath);
|
||||
|
||||
if (plugin != null)
|
||||
{
|
||||
// 刷新插件列表
|
||||
LoadPlugins();
|
||||
|
||||
// 选择新加载的插件
|
||||
foreach (var item in Plugins)
|
||||
{
|
||||
if (item.Plugin == plugin)
|
||||
{
|
||||
PluginListView.SelectedItem = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MessageBox.Show($"插件 {plugin.Name} v{plugin.Version} 已成功加载!", "成功", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("插件加载失败,请检查文件是否有效。", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"加载插件时发生错误:{ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除插件按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnDeletePlugin_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (SelectedPlugin == null) return;
|
||||
|
||||
// 不能删除内置插件
|
||||
if (SelectedPlugin.IsBuiltIn)
|
||||
{
|
||||
MessageBox.Show("内置插件无法删除。", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
// 确认删除
|
||||
MessageBoxResult result = MessageBox.Show(
|
||||
$"确定要删除插件 {SelectedPlugin.Name} 吗?\n此操作将永久删除插件文件,无法恢复。",
|
||||
"删除确认",
|
||||
MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Warning);
|
||||
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
// 删除插件
|
||||
bool success = PluginManager.Instance.DeletePlugin(SelectedPlugin);
|
||||
|
||||
if (success)
|
||||
{
|
||||
// 刷新插件列表
|
||||
LoadPlugins();
|
||||
|
||||
// 如果还有插件,选择第一个
|
||||
if (Plugins.Count > 0)
|
||||
{
|
||||
PluginListView.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
MessageBox.Show($"插件 {SelectedPlugin.Name} 已成功删除。", "成功", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("删除插件失败,请稍后重试。", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出插件按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnExportPlugin_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 检查是否有选中的插件
|
||||
if (SelectedPlugin == null)
|
||||
{
|
||||
MessageBox.Show("请先选择要导出的插件", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查是否为内置插件
|
||||
if (SelectedPlugin.IsBuiltIn)
|
||||
{
|
||||
MessageBox.Show("内置插件无法导出", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查插件文件是否存在
|
||||
string pluginPath = null;
|
||||
if (SelectedPlugin is PluginBase pluginBase)
|
||||
{
|
||||
pluginPath = pluginBase.PluginPath;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(pluginPath) || !File.Exists(pluginPath))
|
||||
{
|
||||
MessageBox.Show("插件文件不存在或无法访问", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建保存文件对话框
|
||||
SaveFileDialog dialog = new SaveFileDialog
|
||||
{
|
||||
Filter = "ICC插件文件(*.iccpp)|*.iccpp",
|
||||
Title = "导出插件",
|
||||
FileName = Path.GetFileName(pluginPath)
|
||||
};
|
||||
|
||||
// 显示对话框
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
// 获取目标路径
|
||||
string targetPath = dialog.FileName;
|
||||
|
||||
// 如果目标文件已存在,询问是否覆盖
|
||||
if (File.Exists(targetPath) && !string.Equals(pluginPath, targetPath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MessageBoxResult result = MessageBox.Show("目标文件已存在,是否覆盖?", "确认", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||
if (result != MessageBoxResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 复制插件文件到目标路径
|
||||
if (!string.Equals(pluginPath, targetPath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
File.Copy(pluginPath, targetPath, true);
|
||||
}
|
||||
|
||||
LogHelper.WriteLogToFile($"插件 {SelectedPlugin.Name} 已成功导出到: {targetPath}", LogHelper.LogType.Info);
|
||||
MessageBox.Show($"插件 {SelectedPlugin.Name} 已成功导出!", "成功", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"导出插件时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show($"导出插件时发生错误: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插件开关切换事件
|
||||
/// </summary>
|
||||
private void PluginToggleSwitch_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (sender is iNKORE.UI.WPF.Modern.Controls.ToggleSwitch toggleSwitch &&
|
||||
toggleSwitch.Tag is IPlugin plugin)
|
||||
{
|
||||
// 记录当前开关状态
|
||||
bool targetState = toggleSwitch.IsOn;
|
||||
|
||||
// 记录插件类型名称和名称,用于稍后查找重载后的插件
|
||||
string pluginTypeName = plugin.GetType().FullName;
|
||||
string pluginName = plugin.Name;
|
||||
bool wasBuiltIn = plugin.IsBuiltIn;
|
||||
|
||||
LogHelper.WriteLogToFile($"UI开关切换: {pluginName}, 目标状态: {(targetState ? "启用" : "禁用")}", LogHelper.LogType.Info);
|
||||
|
||||
// 切换插件状态
|
||||
PluginManager.Instance.TogglePlugin(plugin, targetState);
|
||||
|
||||
// 立即同步保存配置到文件(确保状态被立即持久化)
|
||||
PluginManager.Instance.SaveConfig();
|
||||
LogHelper.WriteLogToFile($"插件状态已立即保存到配置文件", LogHelper.LogType.Info);
|
||||
|
||||
// 延迟一下再检查状态,确保变更已应用
|
||||
Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
// 查找最新的插件实例
|
||||
IPlugin currentPlugin = null;
|
||||
foreach (var p in PluginManager.Instance.Plugins)
|
||||
{
|
||||
if (p.GetType().FullName == pluginTypeName || p.Name == pluginName)
|
||||
{
|
||||
currentPlugin = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentPlugin == null)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"无法找到插件: {pluginName},UI状态可能不准确", LogHelper.LogType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查实际状态
|
||||
bool actualState = currentPlugin is PluginBase pb && pb.IsEnabled;
|
||||
LogHelper.WriteLogToFile($"插件 {pluginName} 实际状态: {(actualState ? "启用" : "禁用")}", LogHelper.LogType.Info);
|
||||
|
||||
// 更新视图模型
|
||||
PluginViewModel viewModel = null;
|
||||
if (toggleSwitch.DataContext is PluginViewModel vm)
|
||||
{
|
||||
viewModel = vm;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewModel = Plugins.FirstOrDefault(p => p.Plugin == currentPlugin);
|
||||
}
|
||||
|
||||
if (viewModel != null)
|
||||
{
|
||||
// 确保视图模型状态与实际状态一致
|
||||
if (viewModel.IsEnabled != actualState)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"同步视图模型状态: {(actualState ? "启用" : "禁用")}", LogHelper.LogType.Info);
|
||||
viewModel.IsEnabled = actualState;
|
||||
}
|
||||
|
||||
// 确保UI开关状态与实际状态一致
|
||||
if (toggleSwitch.IsOn != actualState)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"同步UI开关状态: {(actualState ? "启用" : "禁用")}", LogHelper.LogType.Info);
|
||||
toggleSwitch.IsOn = actualState;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果是当前选中的插件,更新属性
|
||||
if (currentPlugin == SelectedPlugin)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsEnabled));
|
||||
}
|
||||
|
||||
// 对于内置插件,特别处理
|
||||
if (wasBuiltIn)
|
||||
{
|
||||
// 特殊插件刷新逻辑,如果是超级启动台插件,立即刷新UI
|
||||
if (currentPlugin is Helpers.Plugins.BuiltIn.SuperLauncherPlugin &&
|
||||
PluginSettingsContainer.Content is Helpers.Plugins.BuiltIn.SuperLauncher.LauncherSettingsControl)
|
||||
{
|
||||
// 重新获取设置界面
|
||||
PluginSettingsContainer.Content = currentPlugin.GetSettingsView();
|
||||
}
|
||||
}
|
||||
|
||||
LogHelper.WriteLogToFile($"插件 {pluginName} UI状态同步完成", LogHelper.LogType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"同步UI状态时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}), System.Windows.Threading.DispatcherPriority.Background);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"切换插件状态时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show($"切换插件状态时出错: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存插件状态按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnSaveConfig_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int syncCount = 0;
|
||||
|
||||
// 遍历界面上所有插件视图模型,获取开关状态
|
||||
foreach (var viewModel in Plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (viewModel.Plugin != null)
|
||||
{
|
||||
// 获取UI中开关的当前状态(从界面控件读取)
|
||||
bool uiState = viewModel.IsEnabled;
|
||||
|
||||
// 获取插件类型名,用于查找配置
|
||||
string pluginTypeName = viewModel.Plugin.GetType().FullName;
|
||||
|
||||
// 查找实际的插件实例(可能与viewModel.Plugin不同,因为可能已经重新加载)
|
||||
IPlugin actualPlugin = null;
|
||||
foreach (var p in PluginManager.Instance.Plugins)
|
||||
{
|
||||
if (p.GetType().FullName == pluginTypeName)
|
||||
{
|
||||
actualPlugin = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果找不到对应的实际插件实例,跳过
|
||||
if (actualPlugin == null)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"手动保存:无法找到与UI对应的插件实例:{viewModel.Name}", LogHelper.LogType.Warning);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取插件实际状态
|
||||
bool pluginState = false;
|
||||
if (actualPlugin is PluginBase pluginBase)
|
||||
{
|
||||
pluginState = pluginBase.IsEnabled;
|
||||
}
|
||||
|
||||
// 如果界面状态与插件实际状态不一致,应用界面状态
|
||||
if (uiState != pluginState)
|
||||
{
|
||||
// 应用界面的状态到插件
|
||||
PluginManager.Instance.TogglePlugin(actualPlugin, uiState);
|
||||
LogHelper.WriteLogToFile($"手动保存:同步插件 {actualPlugin.Name} 状态 {pluginState} -> {uiState}", LogHelper.LogType.Info);
|
||||
syncCount++;
|
||||
}
|
||||
|
||||
// 确保配置中的状态也与界面一致
|
||||
if (PluginManager.Instance.PluginStates.TryGetValue(pluginTypeName, out bool configState) && configState != uiState)
|
||||
{
|
||||
PluginManager.Instance.PluginStates[pluginTypeName] = uiState;
|
||||
LogHelper.WriteLogToFile($"手动保存:更新配置中插件 {actualPlugin.Name} 状态 {configState} -> {uiState}", LogHelper.LogType.Info);
|
||||
syncCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception pluginEx)
|
||||
{
|
||||
// 单个插件处理失败不应该影响其他插件
|
||||
LogHelper.WriteLogToFile($"手动保存:处理插件 {viewModel.Name} 时出错: {pluginEx.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
// 保存插件状态配置
|
||||
PluginManager.Instance.SaveConfig();
|
||||
|
||||
// 记录日志
|
||||
LogHelper.WriteLogToFile($"用户手动保存插件状态配置,同步了 {syncCount} 个状态变更", LogHelper.LogType.Info);
|
||||
|
||||
// 刷新插件列表,确保UI与最新状态同步
|
||||
RefreshPluginList();
|
||||
|
||||
// 显示保存成功提示
|
||||
string message = syncCount > 0
|
||||
? $"插件状态已成功保存,同步了 {syncCount} 个状态变更"
|
||||
: "插件状态已成功保存,所有插件状态已是最新";
|
||||
MessageBox.Show(message, "保存成功", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 记录错误日志
|
||||
LogHelper.WriteLogToFile($"手动保存插件状态时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
|
||||
// 显示错误信息
|
||||
MessageBox.Show($"保存插件状态时发生错误: {ex.Message}", "保存失败", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭按钮点击事件
|
||||
/// </summary>
|
||||
private void BtnClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 直接关闭窗口,窗口关闭事件会处理配置保存
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插件视图模型
|
||||
/// </summary>
|
||||
public class PluginViewModel : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 插件实例
|
||||
/// </summary>
|
||||
public IPlugin Plugin { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 插件名称
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
string name = Plugin?.Name ?? "未命名插件";
|
||||
LogHelper.WriteLogToFile($"获取插件名称: {name},类型: {Plugin?.GetType().FullName ?? "未知"}", LogHelper.LogType.Info);
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插件是否启用
|
||||
/// </summary>
|
||||
private bool _isEnabled;
|
||||
public bool IsEnabled
|
||||
{
|
||||
get => _isEnabled;
|
||||
set
|
||||
{
|
||||
if (_isEnabled != value)
|
||||
{
|
||||
_isEnabled = value;
|
||||
OnPropertyChanged(nameof(IsEnabled));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public PluginViewModel(IPlugin plugin)
|
||||
{
|
||||
Plugin = plugin;
|
||||
|
||||
// 获取实际状态
|
||||
_isEnabled = plugin is PluginBase pluginBase && pluginBase.IsEnabled;
|
||||
|
||||
// 记录日志
|
||||
LogHelper.WriteLogToFile($"创建插件视图模型: {plugin?.GetType().FullName ?? "未知"}, 名称: {plugin?.Name ?? "未命名"}", LogHelper.LogType.Info);
|
||||
|
||||
// 注册插件状态变更事件
|
||||
if (plugin is PluginBase pb)
|
||||
{
|
||||
pb.EnabledStateChanged += Plugin_EnabledStateChanged;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理插件状态变更事件
|
||||
/// </summary>
|
||||
private void Plugin_EnabledStateChanged(object sender, bool isEnabled)
|
||||
{
|
||||
// 在UI线程上更新状态
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
IsEnabled = isEnabled;
|
||||
|
||||
// 确保配置立即保存
|
||||
if (sender is IPlugin plugin)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"视图模型捕获到插件 {plugin.Name} 状态变更: {(isEnabled ? "启用" : "禁用")}", LogHelper.LogType.Info);
|
||||
Helpers.Plugins.PluginManager.Instance.SaveConfig();
|
||||
LogHelper.WriteLogToFile($"视图模型已触发配置保存", LogHelper.LogType.Info);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 属性变更通知
|
||||
/// </summary>
|
||||
protected void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,11 @@
|
||||
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True" Loaded="Window_Loaded"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="Ink Canvas 抽奖" Height="500" Width="900">
|
||||
<Border Background="#F0F3F9" CornerRadius="10" BorderThickness="1" BorderBrush="#0066BF" Margin="0" ClipToBounds="True">
|
||||
<Border x:Name="MainBorder" CornerRadius="10" BorderThickness="1" BorderBrush="#0066BF" Margin="0" ClipToBounds="True">
|
||||
<Border.Background>
|
||||
<ImageBrush x:Name="BackgroundImage" Stretch="UniformToFill" Opacity="1.0"/>
|
||||
</Border.Background>
|
||||
<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.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.8*"/>
|
||||
@@ -101,6 +103,14 @@
|
||||
<TextBlock Text="开抽" Foreground="White" FontSize="32" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<Border x:Name="BorderBtnIslandCaller" MouseUp="BorderBtnIslandCaller_MouseUp" Background="#00B894" Height="50" Width="200" CornerRadius="25" Margin="0,16,0,0">
|
||||
<ui:SimpleStackPanel Margin="3,0" Spacing="12" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Viewbox Margin="0,10">
|
||||
<ui:SymbolIcon Symbol="Globe" Foreground="White"/>
|
||||
</Viewbox>
|
||||
<TextBlock Text="ClassIsland点名" Foreground="White" FontSize="18" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
</ui:SimpleStackPanel>
|
||||
</Grid>
|
||||
<Border UseLayoutRounding="True" Canvas.Bottom="8" Canvas.Right="8" x:Name="BorderBtnHelp" MouseUp="BorderBtnHelp_MouseUp" Background="#FBFBFD" Grid.Column="1" Margin="10,10,60,10" Height="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" CornerRadius="20">
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
/// <summary>
|
||||
@@ -20,6 +21,40 @@ namespace Ink_Canvas {
|
||||
BorderBtnHelp.Visibility = settings.RandSettings.DisplayRandWindowNamesInputBtn == false ? Visibility.Collapsed : Visibility.Visible;
|
||||
RandMaxPeopleOneTime = settings.RandSettings.RandWindowOnceMaxStudents;
|
||||
RandDoneAutoCloseWaitTime = (int)settings.RandSettings.RandWindowOnceCloseLatency*1000;
|
||||
|
||||
// 加载背景
|
||||
LoadBackground(settings);
|
||||
}
|
||||
|
||||
private void LoadBackground(Settings settings)
|
||||
{
|
||||
try
|
||||
{
|
||||
int selectedIndex = settings.RandSettings.SelectedBackgroundIndex;
|
||||
if (selectedIndex <= 0)
|
||||
{
|
||||
// 默认背景(无背景)
|
||||
BackgroundImage.ImageSource = null;
|
||||
MainBorder.Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(240, 243, 249));
|
||||
}
|
||||
else if (selectedIndex <= settings.RandSettings.CustomPickNameBackgrounds.Count)
|
||||
{
|
||||
// 自定义背景
|
||||
var customBackground = settings.RandSettings.CustomPickNameBackgrounds[selectedIndex - 1];
|
||||
if (File.Exists(customBackground.FilePath))
|
||||
{
|
||||
var bitmap = new System.Windows.Media.Imaging.BitmapImage();
|
||||
bitmap.BeginInit();
|
||||
bitmap.UriSource = new Uri(customBackground.FilePath);
|
||||
bitmap.EndInit();
|
||||
BackgroundImage.ImageSource = bitmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"加载点名背景出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
public RandWindow(Settings settings, bool IsAutoClose) {
|
||||
@@ -30,6 +65,9 @@ namespace Ink_Canvas {
|
||||
BorderBtnHelp.Visibility = settings.RandSettings.DisplayRandWindowNamesInputBtn == false ? Visibility.Collapsed : Visibility.Visible;
|
||||
RandMaxPeopleOneTime = settings.RandSettings.RandWindowOnceMaxStudents;
|
||||
RandDoneAutoCloseWaitTime = (int)settings.RandSettings.RandWindowOnceCloseLatency * 1000;
|
||||
|
||||
// 加载背景
|
||||
LoadBackground(settings);
|
||||
|
||||
new Thread(new ThreadStart(() => {
|
||||
Thread.Sleep(100);
|
||||
@@ -205,5 +243,34 @@ namespace Ink_Canvas {
|
||||
private void BtnClose_MouseUp(object sender, MouseButtonEventArgs e) {
|
||||
Close();
|
||||
}
|
||||
|
||||
// 将 isIslandCallerFirstClick 设为静态字段,实现全局记录
|
||||
private static bool isIslandCallerFirstClick = true;
|
||||
|
||||
private void BorderBtnIslandCaller_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (isIslandCallerFirstClick)
|
||||
{
|
||||
MessageBox.Show(
|
||||
"首次使用ClassIsland点名功能,请确保已安装ClassIsland和Island caller插件。\n" +
|
||||
"如未安装,请前往官网下载并安装后再使用。如果安装请再次点击此按钮。",
|
||||
"提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
isIslandCallerFirstClick = false;
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
|
||||
{
|
||||
FileName = "classisland://plugins/IslandCaller/Run",
|
||||
UseShellExecute = true
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("无法调用外部点名:" + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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\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;;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||