├── .gitattributes ├── .gitignore ├── ArkDesktop.sln ├── ArkDesktopCoreKit ├── ArkDesktopCoreKit.csproj ├── ConfigManager.cs ├── IArkDesktopPluginModule.cs ├── InstanceManager.cs ├── LayeredWindow.cs ├── LayeredWindowManager.Designer.cs ├── LayeredWindowManager.cs ├── LayeredWindowManager.resx ├── PackageManager.cs ├── PluginGuiContainer.Designer.cs ├── PluginGuiContainer.cs ├── PluginGuiContainer.resx ├── Properties │ └── AssemblyInfo.cs ├── UpdateChecker.cs └── Win32Api.cs ├── ArkDesktopHelperWPF ├── !!!!!!操作必看.txt ├── !!!!!!界面介绍.png ├── About.xaml ├── About.xaml.cs ├── App.config ├── App.xaml ├── App.xaml.cs ├── ArkDesktopHelperWPF.csproj ├── ConfigCard.xaml ├── ConfigCard.xaml.cs ├── ConfigSelect.xaml ├── ConfigSelect.xaml.cs ├── Dialog.xaml ├── Dialog.xaml.cs ├── GlobalIcon.ico ├── GlobalIcon.png ├── GlobalSetting.xaml ├── GlobalSetting.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── packages.config └── testimg.png ├── ArkDesktopLua ├── ArkDesktopLua.cs ├── ArkDesktopLua.csproj ├── LuaApi.cs ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── GlobalIcon.ico ├── GlobalIcon.png ├── LICENSE ├── LicenseForGlobalIcon.txt ├── Readme.md ├── TestApp ├── App.config ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── TestApp.csproj └── testimg.png └── docs └── index.html /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Cake - Uncomment if you are using it 306 | # tools/** 307 | # !tools/packages.config 308 | 309 | # Tabs Studio 310 | *.tss 311 | 312 | # Telerik's JustMock configuration file 313 | *.jmconfig 314 | 315 | # BizTalk build output 316 | *.btp.cs 317 | *.btm.cs 318 | *.odx.cs 319 | *.xsd.cs 320 | 321 | # OpenCover UI analysis results 322 | OpenCover/ 323 | 324 | # Azure Stream Analytics local run output 325 | ASALocalRun/ 326 | 327 | # MSBuild Binary and Structured Log 328 | *.binlog 329 | 330 | # NVidia Nsight GPU debugger configuration file 331 | *.nvuser 332 | 333 | # MFractors (Xamarin productivity tool) working folder 334 | .mfractor/ 335 | 336 | # Local History for Visual Studio 337 | .localhistory/ 338 | 339 | # BeatPulse healthcheck temp database 340 | healthchecksdb 341 | 342 | # self build folder 343 | Build/ -------------------------------------------------------------------------------- /ArkDesktop.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29123.88 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArkDesktopLua", "ArkDesktopLua\ArkDesktopLua.csproj", "{AA4D8756-09C4-4C9A-A117-D3DB36085F0F}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lua", "Lua", "{616FB4B8-B309-4F8F-B008-4EE7643EC1A6}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArkDesktopCoreKit", "ArkDesktopCoreKit\ArkDesktopCoreKit.csproj", "{ED7282FD-04A9-400D-ABC4-540724FA8A44}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{764ECBC1-EB5C-46CE-9C35-E58729D31847}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArkDesktopHelperWPF", "ArkDesktopHelperWPF\ArkDesktopHelperWPF.csproj", "{B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}" 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Debug|x64 = Debug|x64 20 | Debug|x86 = Debug|x86 21 | Release|Any CPU = Release|Any CPU 22 | Release|x64 = Release|x64 23 | Release|x86 = Release|x86 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Debug|x64.ActiveCfg = Debug|Any CPU 29 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Debug|x64.Build.0 = Debug|Any CPU 30 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Debug|x86.ActiveCfg = Debug|Any CPU 31 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Debug|x86.Build.0 = Debug|Any CPU 32 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Release|x64.ActiveCfg = Release|Any CPU 35 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Release|x64.Build.0 = Release|Any CPU 36 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Release|x86.ActiveCfg = Release|Any CPU 37 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F}.Release|x86.Build.0 = Release|Any CPU 38 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Debug|x64.ActiveCfg = Debug|Any CPU 41 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Debug|x64.Build.0 = Debug|Any CPU 42 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Debug|x86.ActiveCfg = Debug|Any CPU 43 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Debug|x86.Build.0 = Debug|Any CPU 44 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Release|x64.ActiveCfg = Release|Any CPU 47 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Release|x64.Build.0 = Release|Any CPU 48 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Release|x86.ActiveCfg = Release|Any CPU 49 | {ED7282FD-04A9-400D-ABC4-540724FA8A44}.Release|x86.Build.0 = Release|Any CPU 50 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Debug|x64.ActiveCfg = Debug|Any CPU 53 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Debug|x64.Build.0 = Debug|Any CPU 54 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Debug|x86.ActiveCfg = Debug|Any CPU 55 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Debug|x86.Build.0 = Debug|Any CPU 56 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Release|Any CPU.ActiveCfg = Release|Any CPU 57 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Release|Any CPU.Build.0 = Release|Any CPU 58 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Release|x64.ActiveCfg = Release|Any CPU 59 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Release|x64.Build.0 = Release|Any CPU 60 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Release|x86.ActiveCfg = Release|Any CPU 61 | {764ECBC1-EB5C-46CE-9C35-E58729D31847}.Release|x86.Build.0 = Release|Any CPU 62 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 63 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Debug|x64.ActiveCfg = Debug|Any CPU 65 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Debug|x64.Build.0 = Debug|Any CPU 66 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Debug|x86.ActiveCfg = Debug|Any CPU 67 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Debug|x86.Build.0 = Debug|Any CPU 68 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Release|Any CPU.ActiveCfg = Release|Any CPU 69 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Release|Any CPU.Build.0 = Release|Any CPU 70 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Release|x64.ActiveCfg = Release|Any CPU 71 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Release|x64.Build.0 = Release|Any CPU 72 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Release|x86.ActiveCfg = Release|Any CPU 73 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB}.Release|x86.Build.0 = Release|Any CPU 74 | EndGlobalSection 75 | GlobalSection(SolutionProperties) = preSolution 76 | HideSolutionNode = FALSE 77 | EndGlobalSection 78 | GlobalSection(NestedProjects) = preSolution 79 | {AA4D8756-09C4-4C9A-A117-D3DB36085F0F} = {616FB4B8-B309-4F8F-B008-4EE7643EC1A6} 80 | EndGlobalSection 81 | GlobalSection(ExtensibilityGlobals) = postSolution 82 | SolutionGuid = {BC85A314-D1BC-4F4E-9B27-56309804FAE0} 83 | EndGlobalSection 84 | EndGlobal 85 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/ArkDesktopCoreKit.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {ED7282FD-04A9-400D-ABC4-540724FA8A44} 8 | Library 9 | Properties 10 | ArkDesktop.CoreKit 11 | ArkDesktopCoreKit 12 | v4.7.2 13 | 512 14 | true 15 | 16 | 17 | true 18 | full 19 | false 20 | ..\Build\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | none 27 | true 28 | ..\Build\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Form 52 | 53 | 54 | UserControl 55 | 56 | 57 | LayeredWindowManager.cs 58 | 59 | 60 | 61 | Form 62 | 63 | 64 | PluginGuiContainer.cs 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | LayeredWindowManager.cs 73 | 74 | 75 | PluginGuiContainer.cs 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/ConfigManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Xml; 9 | using System.Xml.Linq; 10 | 11 | namespace ArkDesktop.CoreKit 12 | { 13 | public static class BinaryFileHelper 14 | { 15 | public static int ReadInt32(Stream stream) 16 | { 17 | byte[] cov = new byte[4]; 18 | for (int i = 0; i < 4; ++i) cov[i] = (byte)stream.ReadByte(); 19 | return BitConverter.ToInt32(cov, 0); 20 | } 21 | static bool ConvertIntToByteArray(Int32 m, ref byte[] arry) 22 | { 23 | if (arry == null) return false; 24 | if (arry.Length < 4) return false; 25 | 26 | arry[0] = (byte)(m & 0xFF); 27 | arry[1] = (byte)((m & 0xFF00) >> 8); 28 | arry[2] = (byte)((m & 0xFF0000) >> 16); 29 | arry[3] = (byte)((m >> 24) & 0xFF); 30 | 31 | return true; 32 | } 33 | public static void WriteInt32(Stream stream, int s) 34 | { 35 | byte[] cov = new byte[4]; 36 | ConvertIntToByteArray(s, ref cov); 37 | stream.Write(cov, 0, 4); 38 | } 39 | public static byte[] ReadBytes(Stream stream, int count) 40 | { 41 | byte[] ret = new byte[count]; 42 | stream.Read(ret, 0, count); 43 | return ret; 44 | } 45 | public static void WriteBytes(Stream stream, byte[] s) 46 | { 47 | stream.Write(s, 0, s.Length); 48 | } 49 | public static void WriteString(Stream stream, string s) 50 | { 51 | WriteBytes(stream, Encoding.UTF8.GetBytes(s)); 52 | } 53 | } 54 | 55 | public class ResourceManager 56 | { 57 | private string rootPath; 58 | private FileStream packageStream; 59 | private Dictionary> packagedFile = new Dictionary>(); 60 | private Dictionary activeConfigs = new Dictionary(); 61 | private ConfigManager.ManageConfigSaveMethod manageConfigSave; 62 | public ResourceManager(string rootPath, ConfigManager.ManageConfigSaveMethod manageConfigSave) 63 | { 64 | this.rootPath = rootPath; 65 | this.manageConfigSave = manageConfigSave; 66 | if (Directory.Exists(rootPath) == false) 67 | { 68 | throw new ArgumentException("Cannot found specified path.", nameof(rootPath)); 69 | } 70 | if (File.Exists(Path.Combine(rootPath, "resources.akdres"))) 71 | { 72 | packageStream = File.OpenRead(Path.Combine(rootPath, "resources.akdres")); 73 | ReadFileList(); 74 | } 75 | } 76 | 77 | private bool CheckInDir(string realPath) 78 | { 79 | return true; 80 | } 81 | 82 | public Stream OpenRead(string filename, bool packagedFirst = false) 83 | { 84 | if (filename.StartsWith("/") || filename.StartsWith("\\")) 85 | filename = filename.Substring(1); 86 | bool packaged = false; 87 | if (packagedFile.ContainsKey(filename)) 88 | { 89 | packaged = true; 90 | if (packagedFirst) 91 | throw new NotImplementedException("Lazy..."); 92 | } 93 | string realPath = Path.Combine(rootPath, "resources", filename); 94 | if (CheckInDir(realPath) == false) 95 | { 96 | return new MemoryStream(); 97 | } 98 | if (File.Exists(realPath)) 99 | { 100 | return File.OpenRead(realPath); 101 | } 102 | else if (packaged) 103 | { 104 | throw new NotImplementedException("Lazy..."); 105 | } 106 | return new MemoryStream(); 107 | } 108 | 109 | public Stream OpenWrite(string filename) 110 | { 111 | string realPath = Path.Combine(rootPath, filename); 112 | if (CheckInDir(realPath) == false) 113 | { 114 | return new MemoryStream(); 115 | } 116 | throw new NotImplementedException(); 117 | } 118 | 119 | private void ReadFileList() 120 | { 121 | throw new NotImplementedException("Lazy..."); 122 | } 123 | 124 | public XElement GetConfig(string moduleName) 125 | { 126 | string realPath = Path.Combine(rootPath, "config", moduleName + ".xml"); 127 | if (CheckInDir(realPath) == false || File.Exists(realPath) == false) 128 | { 129 | var v = XDocument.Parse(""); 130 | v.Save(realPath); 131 | } 132 | if (activeConfigs.ContainsKey(moduleName) == false) 133 | { 134 | activeConfigs[moduleName] = XDocument.Parse(File.ReadAllText(realPath)); 135 | manageConfigSave?.Invoke(realPath, activeConfigs[moduleName]); 136 | } 137 | return activeConfigs[moduleName].Root; 138 | } 139 | 140 | public void SaveConfig(string moduleName) 141 | { 142 | if (activeConfigs.ContainsKey(moduleName) == false) 143 | { 144 | return; 145 | } 146 | string realPath = Path.Combine(rootPath, "config", moduleName + ".xml"); 147 | activeConfigs[moduleName].Save(realPath); 148 | } 149 | } 150 | 151 | public class PluginModuleInfo 152 | { 153 | public readonly string pluginName; 154 | public readonly string moduleName; 155 | public readonly Guid moduleGuid; 156 | public readonly Assembly assembly; 157 | public readonly string fullName; 158 | public readonly string description; 159 | public readonly int version; 160 | public PluginModuleInfo(string pluginName, IArkDesktopPluginModule module) 161 | { 162 | this.pluginName = pluginName; 163 | moduleName = module.Name; 164 | moduleGuid = module.Guid; 165 | assembly = module.GetType().Assembly; 166 | fullName = module.GetType().FullName; 167 | description = module.Description; 168 | version = module.Version; 169 | } 170 | public static List ReadFromDll(string filename) 171 | { 172 | Assembly assembly; 173 | using (var fs = File.OpenRead(filename)) 174 | { 175 | byte[] vs = new byte[fs.Length]; 176 | int read = 0, toRead = unchecked((int)fs.Length); 177 | while (toRead != 0) 178 | { 179 | int readed = fs.Read(vs, read, toRead); 180 | read += readed; 181 | toRead -= readed; 182 | } 183 | assembly = Assembly.Load(vs); 184 | } 185 | var found = from e in assembly.GetTypes() 186 | where typeof(IArkDesktopPluginModule).IsAssignableFrom(e) 187 | select e; 188 | var ret = new List(); 189 | foreach (Type i in found) 190 | { 191 | IArkDesktopPluginModule module = (IArkDesktopPluginModule)i.Assembly.CreateInstance(i.FullName); 192 | ret.Add(new PluginModuleInfo(Path.GetFileName(filename), module)); 193 | } 194 | return ret; 195 | } 196 | } 197 | 198 | public class ConfigInfo 199 | { 200 | public bool disableSave = true; 201 | /// 202 | /// Change before launch! 203 | /// 204 | public string ConfigName { get => configName; set { configName = value; Save(); } } 205 | public Guid ConfigGuid { get; } 206 | public string Description { get => description; set { description = value; Save(); } } 207 | public PluginModuleInfo LaunchModule 208 | { 209 | get => launchModule; 210 | set 211 | { 212 | launchModule = value; 213 | LaunchModuleName = value.moduleName; 214 | LaunchModuleGuid = value.moduleGuid; 215 | Save(); 216 | } 217 | } 218 | public string LaunchModuleName { get; private set; } 219 | public Guid LaunchModuleGuid { get; private set; } 220 | public string rootPath; 221 | private string configName; 222 | private string description; 223 | private PluginModuleInfo launchModule; 224 | private ConfigManager.ManageConfigSaveMethod manageConfigSave; 225 | 226 | private void Save() 227 | { 228 | if (disableSave) return; 229 | XDocument document = new XDocument( 230 | new XElement("ArkDesktop", 231 | new XElement("Version", 1), 232 | new XElement("Guid", ConfigGuid.ToString()), 233 | new XElement("Description", description), 234 | new XElement("LaunchModule", 235 | new XElement("Name", LaunchModuleName), 236 | new XElement("Guid", LaunchModuleGuid)))); 237 | document.Save(Path.Combine(rootPath, "config.xml")); 238 | if (Path.GetFileName(rootPath) != configName) 239 | { 240 | Directory.Move(rootPath, Path.Combine(Path.GetDirectoryName(rootPath), configName)); 241 | rootPath = Path.Combine(Path.GetDirectoryName(rootPath), configName); 242 | } 243 | } 244 | public void LoadPluginModule(PluginModuleInfo module) 245 | { 246 | launchModule = module; 247 | } 248 | 249 | private ConfigInfo(XElement config, string dir, IEnumerable modules, ConfigManager.ManageConfigSaveMethod manageConfigSave) 250 | { 251 | rootPath = dir; 252 | this.manageConfigSave = manageConfigSave; 253 | ConfigName = Path.GetFileName(dir); 254 | ConfigGuid = new Guid(config.Element("Guid").Value); 255 | Description = config.Element("Description")?.Value; 256 | LaunchModuleName = config.Element("LaunchModule").Element("Name").Value; 257 | LaunchModuleGuid = new Guid(config.Element("LaunchModule").Element("Guid").Value); 258 | var found = from r in modules where r.moduleGuid == LaunchModuleGuid select r; 259 | if (found.Any()) LoadPluginModule(found.First()); 260 | disableSave = false; 261 | } 262 | 263 | public static ConfigInfo ReadConfigFromDisk(string dir, IEnumerable modules, ConfigManager.ManageConfigSaveMethod manageConfigSave) 264 | { 265 | if (File.Exists(Path.Combine(dir, "config.xml")) == false) 266 | { 267 | throw new ArgumentException("Invalid config directory.", nameof(dir)); 268 | } 269 | XDocument document = XDocument.Load(Path.Combine(dir, "config.xml")); 270 | if (document.Root.Name != "ArkDesktop") 271 | { 272 | throw new Exception("Invalid config file."); 273 | } 274 | string[] requirement = new string[] { "Version", "Guid", "LaunchModule" }; 275 | foreach (string s in requirement) 276 | { 277 | if (document.Root.Element(s) == null) 278 | { 279 | throw new Exception("Cannot find \"" + s + "\" in config.xml."); 280 | } 281 | } 282 | if (int.Parse(document.Root.Element("Version").Value) != 1) 283 | { 284 | throw new Exception("Invalid version \"" + document.Root.Element("Version").Value + "\" in config.xml."); 285 | } 286 | XElement element = document.Root.Element("LaunchModule"); 287 | if (element.Element("Name") == null || element.Element("Guid") == null) 288 | { 289 | throw new Exception("Invalid launch info in config.xml."); 290 | } 291 | return new ConfigInfo(document.Root, dir, modules, manageConfigSave); 292 | } 293 | 294 | public ResourceManager ResourceManager => new ResourceManager(rootPath, manageConfigSave); 295 | } 296 | 297 | public class ConfigManager 298 | { 299 | public string rootPath; 300 | public List Modules { get; private set; } = new List(); 301 | public List Configs { get; private set; } = new List(); 302 | public List> managedConfigSave = new List>(); 303 | private HashSet loadedConfigs = new HashSet(); 304 | private HashSet loadedModules = new HashSet(); 305 | 306 | public ConfigManager(string root) 307 | { 308 | rootPath = root; 309 | } 310 | public void LoadDll(string filename) 311 | { 312 | foreach (var i in PluginModuleInfo.ReadFromDll(Path.Combine(Path.Combine(rootPath, "/plugins/"), filename))) 313 | { 314 | if (loadedModules.Contains(i.moduleGuid) == false) 315 | { 316 | loadedModules.Add(i.moduleGuid); 317 | Modules.Add(i); 318 | foreach (var j in from e in Configs where e.LaunchModule == null && e.LaunchModuleGuid == i.moduleGuid select e) 319 | j.LoadPluginModule(i); 320 | } 321 | } 322 | } 323 | public void LoadConfig(string dir) 324 | { 325 | var get = ConfigInfo.ReadConfigFromDisk(Path.Combine(rootPath, dir), Modules, ManageConfigSave); 326 | if (loadedConfigs.Contains(get.ConfigGuid) == false) 327 | { 328 | loadedConfigs.Add(get.ConfigGuid); 329 | Configs.Add(get); 330 | } 331 | } 332 | 333 | public void ScanPlugins(string dir) 334 | { 335 | var list = Directory.EnumerateFiles(dir); 336 | foreach (var i in list) 337 | { 338 | if (i.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)) 339 | { 340 | try 341 | { 342 | LoadDll(i); 343 | } 344 | catch (Exception) 345 | { 346 | } 347 | } 348 | } 349 | } 350 | public void ScanPlugins() => ScanPlugins(Path.Combine(rootPath, "plugins")); 351 | 352 | public void ScanConfigs(string dir) 353 | { 354 | if (Directory.Exists(dir) == false) Directory.CreateDirectory(dir); 355 | foreach (var i in Directory.EnumerateDirectories(dir, "*", SearchOption.TopDirectoryOnly)) 356 | { 357 | if (i.StartsWith("__shared") == false) 358 | { 359 | try 360 | { 361 | LoadConfig(i); 362 | } 363 | catch (Exception) 364 | { 365 | } 366 | } 367 | } 368 | } 369 | public void ScanConfigs() => ScanConfigs(Path.Combine(rootPath, "configs")); 370 | 371 | public void SaveAllConfigs() 372 | { 373 | foreach (var i in managedConfigSave) i.Item2.Save(i.Item1); 374 | } 375 | 376 | public delegate void ManageConfigSaveMethod(string path, XDocument document); 377 | public void ManageConfigSave(string path, XDocument document) 378 | { 379 | managedConfigSave.Add(new Tuple(path, document)); 380 | } 381 | } 382 | } 383 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/IArkDesktopPluginModule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ArkDesktop.CoreKit 8 | { 9 | public interface IArkDesktopPluginModule//V3 10 | { 11 | string Name { get; } 12 | Guid Guid { get; } 13 | bool Disposed { get; } 14 | string Description { get; } 15 | int Version { get; } 16 | bool CheckFeature(string featureName); 17 | void MainThread(ResourceManager resources, InstanceHelper instanceHelper); 18 | void RequestDispose(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/InstanceManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | 9 | namespace ArkDesktop.CoreKit 10 | { 11 | public class InstanceHelper 12 | { 13 | private readonly string extraName; 14 | 15 | public PluginGuiContainer PluginGuiContainer { get; private set; } 16 | public InstanceHelper(PluginGuiContainer container, string extraName) 17 | { 18 | PluginGuiContainer = container; 19 | this.extraName = extraName; 20 | } 21 | 22 | public void AddControl(string controlName, Control control) 23 | { 24 | if (PluginGuiContainer.tabControl.InvokeRequired) 25 | { 26 | PluginGuiContainer.tabControl.Invoke((MethodInvoker)(() => AddControl(controlName, control))); 27 | return; 28 | } 29 | controlName = string.Format("[{0}]{1}", extraName, controlName); 30 | if (PluginGuiContainer.tabControl.TabPages.ContainsKey(controlName)) 31 | { 32 | throw new Exception("Control name exists."); 33 | } 34 | TabPage tabPage = new TabPage(controlName); 35 | tabPage.Controls.Add(control); 36 | PluginGuiContainer.tabControl.TabPages.Add(tabPage); 37 | } 38 | 39 | public void RemoveControl(string controlName) 40 | { 41 | if (PluginGuiContainer.tabControl.InvokeRequired) 42 | { 43 | PluginGuiContainer.tabControl.Invoke((MethodInvoker)(() => RemoveControl(controlName))); 44 | } 45 | controlName = string.Format("[{0}]{1}", extraName, controlName); 46 | if (PluginGuiContainer.tabControl.TabPages.ContainsKey(controlName)) 47 | { 48 | PluginGuiContainer.tabControl.TabPages.Remove(PluginGuiContainer.tabControl.TabPages[PluginGuiContainer.tabControl.TabPages.IndexOfKey(controlName)]); 49 | } 50 | } 51 | } 52 | 53 | public class InstanceManager 54 | { 55 | public PluginGuiContainer pluginGuiContainer; 56 | public ManualResetEvent Ready; 57 | public Thread thread; 58 | 59 | public InstanceManager(PluginGuiContainer pluginGuiContainer) 60 | { 61 | this.pluginGuiContainer = pluginGuiContainer; 62 | Ready = pluginGuiContainer.Ready; 63 | thread = new Thread(new ThreadStart(() => 64 | { 65 | Application.EnableVisualStyles(); 66 | Application.Run(pluginGuiContainer); 67 | })); 68 | thread.SetApartmentState(ApartmentState.STA); 69 | thread.IsBackground = true; 70 | thread.Start(); 71 | } 72 | 73 | public void LaunchModule(ConfigInfo info) 74 | { 75 | IArkDesktopPluginModule module = info.LaunchModule.assembly.CreateInstance(info.LaunchModule.fullName) as IArkDesktopPluginModule; 76 | pluginGuiContainer.RequestClose += module.RequestDispose; 77 | Ready.WaitOne(); 78 | module.MainThread(info.ResourceManager, new InstanceHelper(pluginGuiContainer, info.ConfigName)); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/LayeredWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Windows.Forms; 8 | using Timer = System.Windows.Forms.Timer; 9 | 10 | namespace ArkDesktop.CoreKit 11 | { 12 | public class LayeredWindow : Form 13 | { 14 | public Timer timer = new Timer(); 15 | private IntPtr screenDC, memDC; 16 | public ManualResetEvent Ready { get; private set; } = new ManualResetEvent(false); 17 | 18 | public LayeredWindow() 19 | { 20 | Load += LayeredWindow_Load; 21 | Disposed += LayeredWindow_Disposed; 22 | } 23 | 24 | private void LayeredWindow_Disposed(object sender, EventArgs e) 25 | { 26 | Win32.ReleaseDC(IntPtr.Zero, screenDC); 27 | Win32.DeleteDC(memDC); 28 | } 29 | 30 | private void LayeredWindow_Load(object sender, EventArgs e) 31 | { 32 | FormBorderStyle = FormBorderStyle.None; 33 | screenDC = Win32.GetDC(IntPtr.Zero); 34 | memDC = Win32.CreateCompatibleDC(screenDC); 35 | FormBorderStyle = FormBorderStyle.None; 36 | Ready.Set(); 37 | } 38 | 39 | protected override CreateParams CreateParams 40 | { 41 | get 42 | { 43 | CreateParams cp = base.CreateParams; 44 | cp.ExStyle |= 0x00080000; 45 | return cp; 46 | } 47 | } 48 | 49 | public void SetBits(Bitmap bitmap, byte transparency = 255)//调用UpdateLayeredWindow()方法。this.BackgroundImage为你事先准备的带透明图片。 50 | { 51 | if (InvokeRequired) 52 | { 53 | Invoke((MethodInvoker)(() => SetBits(bitmap))); 54 | return; 55 | } 56 | 57 | if (IsDisposed) 58 | { 59 | return; 60 | } 61 | 62 | if (!Image.IsCanonicalPixelFormat(bitmap.PixelFormat) || !Image.IsAlphaPixelFormat(bitmap.PixelFormat)) 63 | { 64 | throw new ArgumentException("Not a 32-bit argb bitmap", nameof(bitmap)); 65 | } 66 | 67 | IntPtr oldBits = IntPtr.Zero; 68 | IntPtr hBitmap = IntPtr.Zero; 69 | 70 | try 71 | { 72 | Win32.Point topLoc = new Win32.Point(Left, Top); 73 | Win32.Size bitMapSize = new Win32.Size(bitmap.Width, bitmap.Height); 74 | Win32.BLENDFUNCTION blendFunc = new Win32.BLENDFUNCTION(); 75 | Win32.Point srcLoc = new Win32.Point(0, 0); 76 | 77 | hBitmap = bitmap.GetHbitmap(Color.FromArgb(0)); 78 | oldBits = Win32.SelectObject(memDC, hBitmap); 79 | 80 | blendFunc.BlendOp = Win32.AC_SRC_OVER; 81 | blendFunc.SourceConstantAlpha = transparency; 82 | blendFunc.AlphaFormat = Win32.AC_SRC_ALPHA; 83 | blendFunc.BlendFlags = 0; 84 | 85 | Win32.UpdateLayeredWindow(Handle, screenDC, ref topLoc, ref bitMapSize, memDC, ref srcLoc, 0, ref blendFunc, Win32.ULW_ALPHA); 86 | } 87 | finally 88 | { 89 | if (hBitmap != IntPtr.Zero) 90 | { 91 | Win32.SelectObject(memDC, oldBits); 92 | Win32.DeleteObject(hBitmap); 93 | } 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/LayeredWindowManager.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ArkDesktop.CoreKit 2 | { 3 | partial class LayeredWindowManager 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 false。 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region 组件设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要修改 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.button_Pos = new System.Windows.Forms.Button(); 32 | this.linkLabel_Zoom = new System.Windows.Forms.LinkLabel(); 33 | this.label1 = new System.Windows.Forms.Label(); 34 | this.linkLabel_ZoomQuality = new System.Windows.Forms.LinkLabel(); 35 | this.linkLabel1 = new System.Windows.Forms.LinkLabel(); 36 | this.checkBox_HideTaskbarIcon = new System.Windows.Forms.CheckBox(); 37 | this.checkBox_TopMost = new System.Windows.Forms.CheckBox(); 38 | this.TransparentEventsCheckBox = new System.Windows.Forms.CheckBox(); 39 | this.TransparentImageLinkLabel = new System.Windows.Forms.LinkLabel(); 40 | this.SuspendLayout(); 41 | // 42 | // button_Pos 43 | // 44 | this.button_Pos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 45 | | System.Windows.Forms.AnchorStyles.Right))); 46 | this.button_Pos.Location = new System.Drawing.Point(3, 3); 47 | this.button_Pos.Name = "button_Pos"; 48 | this.button_Pos.Size = new System.Drawing.Size(101, 23); 49 | this.button_Pos.TabIndex = 0; 50 | this.button_Pos.Text = "窗口位置"; 51 | this.button_Pos.UseVisualStyleBackColor = true; 52 | this.button_Pos.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Button_MouseDown); 53 | this.button_Pos.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Button_Pos_MouseMove); 54 | this.button_Pos.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Button_MouseUp); 55 | // 56 | // linkLabel_Zoom 57 | // 58 | this.linkLabel_Zoom.AutoSize = true; 59 | this.linkLabel_Zoom.Location = new System.Drawing.Point(44, 29); 60 | this.linkLabel_Zoom.Name = "linkLabel_Zoom"; 61 | this.linkLabel_Zoom.Size = new System.Drawing.Size(29, 12); 62 | this.linkLabel_Zoom.TabIndex = 3; 63 | this.linkLabel_Zoom.TabStop = true; 64 | this.linkLabel_Zoom.Text = "x1.0"; 65 | this.linkLabel_Zoom.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabel_Zoom_LinkClicked); 66 | // 67 | // label1 68 | // 69 | this.label1.AutoSize = true; 70 | this.label1.Location = new System.Drawing.Point(3, 29); 71 | this.label1.Name = "label1"; 72 | this.label1.Size = new System.Drawing.Size(35, 12); 73 | this.label1.TabIndex = 4; 74 | this.label1.Text = "缩放:"; 75 | // 76 | // linkLabel_ZoomQuality 77 | // 78 | this.linkLabel_ZoomQuality.AutoSize = true; 79 | this.linkLabel_ZoomQuality.Location = new System.Drawing.Point(79, 29); 80 | this.linkLabel_ZoomQuality.Name = "linkLabel_ZoomQuality"; 81 | this.linkLabel_ZoomQuality.Size = new System.Drawing.Size(41, 12); 82 | this.linkLabel_ZoomQuality.TabIndex = 5; 83 | this.linkLabel_ZoomQuality.TabStop = true; 84 | this.linkLabel_ZoomQuality.Text = "高品质"; 85 | this.linkLabel_ZoomQuality.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabel_ZoomQuality_LinkClicked); 86 | // 87 | // linkLabel1 88 | // 89 | this.linkLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 90 | this.linkLabel1.AutoSize = true; 91 | this.linkLabel1.Location = new System.Drawing.Point(110, 8); 92 | this.linkLabel1.Name = "linkLabel1"; 93 | this.linkLabel1.Size = new System.Drawing.Size(11, 12); 94 | this.linkLabel1.TabIndex = 7; 95 | this.linkLabel1.TabStop = true; 96 | this.linkLabel1.Text = "?"; 97 | this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabel1_LinkClicked); 98 | // 99 | // checkBox_HideTaskbarIcon 100 | // 101 | this.checkBox_HideTaskbarIcon.AutoSize = true; 102 | this.checkBox_HideTaskbarIcon.Location = new System.Drawing.Point(3, 66); 103 | this.checkBox_HideTaskbarIcon.Name = "checkBox_HideTaskbarIcon"; 104 | this.checkBox_HideTaskbarIcon.Size = new System.Drawing.Size(96, 16); 105 | this.checkBox_HideTaskbarIcon.TabIndex = 8; 106 | this.checkBox_HideTaskbarIcon.Text = "不显示任务栏"; 107 | this.checkBox_HideTaskbarIcon.UseVisualStyleBackColor = true; 108 | this.checkBox_HideTaskbarIcon.CheckedChanged += new System.EventHandler(this.CheckBox_ShowTaskbarIcon_CheckedChanged); 109 | // 110 | // checkBox_TopMost 111 | // 112 | this.checkBox_TopMost.AutoSize = true; 113 | this.checkBox_TopMost.Location = new System.Drawing.Point(3, 44); 114 | this.checkBox_TopMost.Name = "checkBox_TopMost"; 115 | this.checkBox_TopMost.Size = new System.Drawing.Size(72, 16); 116 | this.checkBox_TopMost.TabIndex = 11; 117 | this.checkBox_TopMost.Text = "窗口置顶"; 118 | this.checkBox_TopMost.UseVisualStyleBackColor = true; 119 | this.checkBox_TopMost.CheckedChanged += new System.EventHandler(this.checkBox_TopMost_CheckedChanged); 120 | // 121 | // TransparentEventsCheckBox 122 | // 123 | this.TransparentEventsCheckBox.AutoSize = true; 124 | this.TransparentEventsCheckBox.Location = new System.Drawing.Point(3, 88); 125 | this.TransparentEventsCheckBox.Name = "TransparentEventsCheckBox"; 126 | this.TransparentEventsCheckBox.Size = new System.Drawing.Size(72, 16); 127 | this.TransparentEventsCheckBox.TabIndex = 12; 128 | this.TransparentEventsCheckBox.Text = "鼠标穿透"; 129 | this.TransparentEventsCheckBox.UseVisualStyleBackColor = true; 130 | this.TransparentEventsCheckBox.CheckedChanged += new System.EventHandler(this.TransparentEventsCheckBox_CheckedChanged); 131 | // 132 | // TransparentImageLinkLabel 133 | // 134 | this.TransparentImageLinkLabel.AutoSize = true; 135 | this.TransparentImageLinkLabel.Location = new System.Drawing.Point(3, 107); 136 | this.TransparentImageLinkLabel.Name = "TransparentImageLinkLabel"; 137 | this.TransparentImageLinkLabel.Size = new System.Drawing.Size(95, 12); 138 | this.TransparentImageLinkLabel.TabIndex = 14; 139 | this.TransparentImageLinkLabel.TabStop = true; 140 | this.TransparentImageLinkLabel.Text = "透明度:255/255"; 141 | this.TransparentImageLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TransparentImageLinkLabel_LinkClicked); 142 | // 143 | // LayeredWindowManager 144 | // 145 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 146 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 147 | this.Controls.Add(this.TransparentImageLinkLabel); 148 | this.Controls.Add(this.TransparentEventsCheckBox); 149 | this.Controls.Add(this.checkBox_TopMost); 150 | this.Controls.Add(this.checkBox_HideTaskbarIcon); 151 | this.Controls.Add(this.linkLabel1); 152 | this.Controls.Add(this.linkLabel_ZoomQuality); 153 | this.Controls.Add(this.label1); 154 | this.Controls.Add(this.linkLabel_Zoom); 155 | this.Controls.Add(this.button_Pos); 156 | this.Name = "LayeredWindowManager"; 157 | this.Size = new System.Drawing.Size(124, 129); 158 | this.Load += new System.EventHandler(this.LayeredWindowManager_Load); 159 | this.ResumeLayout(false); 160 | this.PerformLayout(); 161 | 162 | } 163 | 164 | #endregion 165 | 166 | private System.Windows.Forms.Button button_Pos; 167 | private System.Windows.Forms.LinkLabel linkLabel_Zoom; 168 | private System.Windows.Forms.Label label1; 169 | private System.Windows.Forms.LinkLabel linkLabel_ZoomQuality; 170 | private System.Windows.Forms.LinkLabel linkLabel1; 171 | private System.Windows.Forms.CheckBox checkBox_HideTaskbarIcon; 172 | private System.Windows.Forms.CheckBox checkBox_TopMost; 173 | private System.Windows.Forms.CheckBox TransparentEventsCheckBox; 174 | private System.Windows.Forms.LinkLabel TransparentImageLinkLabel; 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/LayeredWindowManager.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/PackageManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ArkDesktop.CoreKit 9 | { 10 | public static class PackageManager 11 | { 12 | public class PackageInfo 13 | { 14 | public byte version; 15 | } 16 | public class PackagedConfigInfo 17 | { 18 | public Guid configGuid; 19 | public string defaultConfigName; 20 | public int fileCount; 21 | public long firstFilePosition; 22 | } 23 | 24 | public static string ToNiceRelativePath(string path) => path[0] == '/' || path[0] == '\\' ? path.Substring(1) : path; 25 | 26 | public static void EnsureDirectoryExists(string path) 27 | { 28 | path = Path.GetDirectoryName(path); 29 | if (Directory.Exists(path) == false) Directory.CreateDirectory(path); 30 | } 31 | 32 | public static void ExtractFiles(string rootPath, Stream stream) 33 | { 34 | int fileCount = ReadInt32(stream); 35 | while (fileCount-- != 0) 36 | { 37 | string fileName = ReadString(stream); 38 | int fileLength = ReadInt32(stream); 39 | var path = Path.Combine(rootPath, ToNiceRelativePath(fileName)); 40 | EnsureDirectoryExists(path); 41 | using (var fs = File.OpenWrite(path)) 42 | { 43 | while (fileLength != 0) 44 | { 45 | var buf = new byte[8196]; 46 | int readLength = fileLength > 8196 ? 8196 : fileLength; 47 | stream.Read(buf, 0, readLength); 48 | fs.Write(buf, 0, readLength); 49 | fileLength -= readLength; 50 | } 51 | } 52 | } 53 | } 54 | 55 | public static (PackageInfo, List) ReadPackageInfo(Stream stream) 56 | { 57 | byte[] magic = ReadBytes(stream, 4); 58 | if ("AKDP" != Encoding.ASCII.GetString(magic)) return (new PackageInfo { version = 255 }, null); 59 | if (stream.ReadByte() != 2) return (new PackageInfo { version = 254 }, null); 60 | int configCount = ReadInt32(stream); 61 | var retList = new List(); 62 | while (configCount-- != 0) 63 | { 64 | var single = new PackagedConfigInfo(); 65 | single.configGuid = new Guid(ReadBytes(stream, 16)); 66 | single.defaultConfigName = ReadString(stream); 67 | single.firstFilePosition = stream.Position; 68 | single.fileCount = ReadInt32(stream); 69 | retList.Add(single); 70 | for (int i = 0; i != single.fileCount; ++i) 71 | { 72 | _ = ReadString(stream); 73 | int fileLength = ReadInt32(stream); 74 | stream.Position += fileLength; 75 | } 76 | } 77 | return (new PackageInfo { version = 2 }, retList); 78 | } 79 | 80 | public static void PackConfigs(List configsInfos, string path) 81 | { 82 | using (var fs = File.OpenWrite(path)) 83 | { 84 | WriteBytes(fs, Encoding.ASCII.GetBytes("AKDP"));//固定 85 | fs.WriteByte(2);//guding 86 | WriteInt32(fs, configsInfos.Count);//数量 87 | foreach (var configInfo in configsInfos) 88 | { 89 | WriteBytes(fs, configInfo.ConfigGuid.ToByteArray()); 90 | WriteString(fs, configInfo.ConfigName); 91 | var vs = EnumDirectory(configInfo.rootPath); 92 | WriteInt32(fs, vs.Count); 93 | foreach (var p in vs) 94 | { 95 | WriteString(fs, p.Substring(configInfo.rootPath.Length)); 96 | WriteInt32(fs, GetFileSize(p)); 97 | using (FileStream fs1 = File.OpenRead(p)) fs1.CopyTo(fs); 98 | } 99 | } 100 | } 101 | } 102 | 103 | private static int GetFileSize(string path)//获取文件长度 104 | { 105 | FileInfo fileInfo = new FileInfo(path); 106 | return Convert.ToInt32(fileInfo.Length); 107 | } 108 | 109 | private static List EnumDirectory(string dir) 110 | { 111 | var vs = new List(); 112 | DirectoryInfo d = new DirectoryInfo(dir); 113 | FileSystemInfo[] fileSystemInfos = d.GetFileSystemInfos(); 114 | foreach (var str in fileSystemInfos) 115 | { 116 | if (str is DirectoryInfo) vs.AddRange(EnumDirectory(str.FullName)); 117 | else vs.Add(str.FullName); 118 | } 119 | return vs; 120 | } 121 | public static int ReadInt32(Stream stream) 122 | { 123 | var arry = ReadBytes(stream, 4); 124 | int ret = 0; 125 | for (int i = 0; i != 4; ++i) 126 | ret |= (arry[i]) << (8 * i); 127 | return ret; 128 | } 129 | static bool ConvertIntToByteArray(Int32 m, ref byte[] arry) 130 | { 131 | if (arry == null) return false; 132 | if (arry.Length < 4) return false; 133 | 134 | arry[0] = (byte)(m & 0xFF); 135 | arry[1] = (byte)((m & 0xFF00) >> 8); 136 | arry[2] = (byte)((m & 0xFF0000) >> 16); 137 | arry[3] = (byte)((m >> 24) & 0xFF); 138 | 139 | return true; 140 | } 141 | public static void WriteInt32(Stream stream, int s) 142 | { 143 | byte[] cov = new byte[4]; 144 | ConvertIntToByteArray(s, ref cov); 145 | stream.Write(cov, 0, 4); 146 | } 147 | public static byte[] ReadBytes(Stream stream, int count) 148 | { 149 | byte[] ret = new byte[count]; 150 | stream.Read(ret, 0, count); 151 | return ret; 152 | } 153 | public static void WriteBytes(Stream stream, byte[] s) 154 | { 155 | stream.Write(s, 0, s.Length); 156 | } 157 | public static string ReadString(Stream stream) 158 | { 159 | var vs = new List(); 160 | while (true) 161 | { 162 | int read = stream.ReadByte(); 163 | if (read > 0) vs.Add(unchecked((byte)read)); 164 | else break; 165 | } 166 | return Encoding.UTF8.GetString(Convert.FromBase64String(Encoding.ASCII.GetString(vs.ToArray()))); 167 | } 168 | public static void WriteString(Stream stream, string s) 169 | { 170 | WriteBytes(stream, Encoding.ASCII.GetBytes(Convert.ToBase64String(Encoding.UTF8.GetBytes(s)))); 171 | stream.WriteByte(0); 172 | } 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/PluginGuiContainer.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ArkDesktop.CoreKit 2 | { 3 | partial class PluginGuiContainer 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PluginGuiContainer)); 33 | this.tabControl = new System.Windows.Forms.TabControl(); 34 | this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); 35 | this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 36 | this.button1 = new System.Windows.Forms.Button(); 37 | this.tableLayoutPanel1.SuspendLayout(); 38 | this.SuspendLayout(); 39 | // 40 | // tabControl 41 | // 42 | this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 43 | | System.Windows.Forms.AnchorStyles.Left) 44 | | System.Windows.Forms.AnchorStyles.Right))); 45 | this.tabControl.Location = new System.Drawing.Point(3, 3); 46 | this.tabControl.Name = "tabControl"; 47 | this.tabControl.SelectedIndex = 0; 48 | this.tabControl.Size = new System.Drawing.Size(340, 158); 49 | this.tabControl.TabIndex = 0; 50 | // 51 | // notifyIcon 52 | // 53 | this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon"))); 54 | this.notifyIcon.Text = "ArkDesktop"; 55 | this.notifyIcon.DoubleClick += new System.EventHandler(this.NotifyIcon_DoubleClick); 56 | // 57 | // tableLayoutPanel1 58 | // 59 | this.tableLayoutPanel1.ColumnCount = 1; 60 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 61 | this.tableLayoutPanel1.Controls.Add(this.tabControl, 0, 0); 62 | this.tableLayoutPanel1.Controls.Add(this.button1, 0, 1); 63 | this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; 64 | this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); 65 | this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 66 | this.tableLayoutPanel1.RowCount = 2; 67 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 68 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F)); 69 | this.tableLayoutPanel1.Size = new System.Drawing.Size(346, 193); 70 | this.tableLayoutPanel1.TabIndex = 1; 71 | // 72 | // button1 73 | // 74 | this.button1.Dock = System.Windows.Forms.DockStyle.Fill; 75 | this.button1.Location = new System.Drawing.Point(3, 167); 76 | this.button1.Name = "button1"; 77 | this.button1.Size = new System.Drawing.Size(340, 23); 78 | this.button1.TabIndex = 1; 79 | this.button1.Text = "关闭程序"; 80 | this.button1.UseVisualStyleBackColor = true; 81 | this.button1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Button1_MouseClick); 82 | // 83 | // PluginGuiContainer 84 | // 85 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 86 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 87 | this.ClientSize = new System.Drawing.Size(346, 193); 88 | this.Controls.Add(this.tableLayoutPanel1); 89 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 90 | this.Name = "PluginGuiContainer"; 91 | this.Text = "PluginGuiContainer"; 92 | this.TopMost = true; 93 | this.Load += new System.EventHandler(this.PluginGuiContainer_Load); 94 | this.Resize += new System.EventHandler(this.PluginGuiContainer_Resize); 95 | this.tableLayoutPanel1.ResumeLayout(false); 96 | this.ResumeLayout(false); 97 | 98 | } 99 | 100 | #endregion 101 | private System.Windows.Forms.NotifyIcon notifyIcon; 102 | public System.Windows.Forms.TabControl tabControl; 103 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 104 | private System.Windows.Forms.Button button1; 105 | } 106 | } -------------------------------------------------------------------------------- /ArkDesktopCoreKit/PluginGuiContainer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using ArkDesktop.CoreKit; 12 | 13 | namespace ArkDesktop.CoreKit 14 | { 15 | public partial class PluginGuiContainer : Form 16 | { 17 | private ConfigManager configManager; 18 | protected override CreateParams CreateParams 19 | { 20 | get 21 | { 22 | CreateParams createParams = base.CreateParams; 23 | createParams.ClassStyle |= 0x200; 24 | return createParams; 25 | } 26 | } 27 | public event MethodInvoker RequestClose; 28 | public ManualResetEvent Ready { get; private set; } = new ManualResetEvent(false); 29 | public PluginGuiContainer(ConfigManager configManager) 30 | { 31 | InitializeComponent(); 32 | this.configManager = configManager; 33 | } 34 | public void BroadcastNotice(string notice) 35 | { 36 | notifyIcon.ShowBalloonTip(3000, "ArkDesktop", notice, ToolTipIcon.Info); 37 | } 38 | 39 | private void PluginGuiContainer_Load(object sender, EventArgs e) 40 | { 41 | Ready.Set(); 42 | WindowState = FormWindowState.Minimized; 43 | } 44 | 45 | private void PluginGuiContainer_Resize(object sender, EventArgs e) 46 | { 47 | if (WindowState == FormWindowState.Minimized) 48 | { 49 | ShowInTaskbar = false; 50 | notifyIcon.Visible = true; 51 | notifyIcon.ShowBalloonTip(3000, "ArkDesktop", "最小化到托盘", ToolTipIcon.Info); 52 | } 53 | else 54 | { 55 | ShowInTaskbar = true; 56 | notifyIcon.Visible = false; 57 | } 58 | } 59 | 60 | private void NotifyIcon_DoubleClick(object sender, EventArgs e) 61 | { 62 | WindowState = FormWindowState.Normal; 63 | } 64 | 65 | private void Button1_MouseClick(object sender, MouseEventArgs e) 66 | { 67 | if (e.Button == MouseButtons.Left) 68 | { 69 | configManager.SaveAllConfigs(); 70 | } 71 | RequestClose?.Invoke(); 72 | Dispose(); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("ArkDesktopCoreKit")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ArkDesktopCoreKit")] 13 | [assembly: AssemblyCopyright("Copyleft 2020 By huix-oldcat MPL v2 License")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("ed7282fd-04a9-400d-abc4-540724fa8a44")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("3.0.2.7")] 36 | [assembly: AssemblyFileVersion("3.0.2.7")] 37 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/UpdateChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Net; 7 | using System.IO; 8 | 9 | namespace ArkDesktop.CoreKit 10 | { 11 | public static class UpdateChecker 12 | { 13 | public static (string, string) GetUpdateInfo(List modules = null, int helperVersion = 0) 14 | { 15 | var additionalParams = new StringBuilder(); 16 | void AddParam(string guid, int version) 17 | { 18 | additionalParams.Append("&modules[]="); 19 | additionalParams.Append(guid); 20 | additionalParams.Append('|'); 21 | additionalParams.Append(version); 22 | } 23 | if (modules != null) 24 | foreach (PluginModuleInfo i in modules) 25 | AddParam(i.moduleGuid.ToString(), i.version); 26 | AddParam("00000000-0000-0000-0000-000000000000", helperVersion); 27 | 28 | WebClient client = new WebClient(); 29 | try 30 | { 31 | var st = client.OpenRead("https://akd.huix.cc/api/GetUpdate.php?current=" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + additionalParams.ToString()); 32 | string s; 33 | using (StreamReader sr = new StreamReader(st)) s = sr.ReadToEnd(); 34 | if (s == "Latest") return ("Latest", null); 35 | var a = s.Split('|'); 36 | if (a.Length < 2) return ("", null); 37 | if (a.Length > 2) 38 | { 39 | string a1 = ""; 40 | for (int i = 1; i != a.Length; ++i) a1 += a[i] + '|'; 41 | a1 = a1.Substring(0, a1.Length - 1); 42 | } 43 | return (a[0], a[1]); 44 | } 45 | catch (Exception) 46 | { 47 | return ("", null); 48 | } 49 | } 50 | public static string CoreVersion { get => System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); } 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ArkDesktopCoreKit/Win32Api.cs: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ 4 | using System; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | 8 | namespace ArkDesktop.CoreKit 9 | { 10 | public class Win32 11 | { 12 | public enum Bool 13 | { 14 | False = 0, 15 | True 16 | }; 17 | 18 | [StructLayout(LayoutKind.Sequential)] 19 | public struct Point 20 | { 21 | public int x; 22 | public int y; 23 | 24 | public Point(int x, int y) 25 | { this.x = x; this.y = y; } 26 | } 27 | 28 | [StructLayout(LayoutKind.Sequential)] 29 | public struct Size 30 | { 31 | public int cx; 32 | public int cy; 33 | 34 | public Size(int cx, int cy) 35 | { this.cx = cx; this.cy = cy; } 36 | } 37 | 38 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 39 | struct ARGB 40 | { 41 | public byte Blue; 42 | public byte Green; 43 | public byte Red; 44 | public byte Alpha; 45 | } 46 | 47 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 48 | public struct BLENDFUNCTION 49 | { 50 | public byte BlendOp; 51 | public byte BlendFlags; 52 | public byte SourceConstantAlpha; 53 | public byte AlphaFormat; 54 | } 55 | 56 | public const int ULW_COLORKEY = 0x00000001; 57 | public const int ULW_ALPHA = 0x00000002; 58 | public const int ULW_OPAQUE = 0x00000004; 59 | 60 | public const byte AC_SRC_OVER = 0x00; 61 | public const byte AC_SRC_ALPHA = 0x01; 62 | 63 | [DllImport("user32.dll ", ExactSpelling = true, SetLastError = true)] 64 | public static extern Bool UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref Point pptDst, ref Size psize, IntPtr hdcSrc, ref Point pprSrc, int crKey, ref BLENDFUNCTION pblend, int dwFlags); 65 | 66 | [DllImport("user32.dll ", ExactSpelling = true, SetLastError = true, EntryPoint = "GetDC")] 67 | public static extern IntPtr GetDC(IntPtr hWnd); 68 | 69 | [DllImport("user32.dll ", ExactSpelling = true)] 70 | public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC); 71 | 72 | [DllImport("gdi32.dll ", ExactSpelling = true, SetLastError = true)] 73 | public static extern IntPtr CreateCompatibleDC(IntPtr hDC); 74 | 75 | [DllImport("gdi32.dll ", ExactSpelling = true, SetLastError = true)] 76 | public static extern Bool DeleteDC(IntPtr hdc); 77 | 78 | [DllImport("gdi32.dll ", ExactSpelling = true)] 79 | public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject); 80 | 81 | [DllImport("gdi32.dll ", ExactSpelling = true, SetLastError = true)] 82 | public static extern Bool DeleteObject(IntPtr hObject); 83 | 84 | [DllImport("gdi32.dll")] 85 | public static extern bool BitBlt( 86 | IntPtr hdcDest,//目标设备的句柄 87 | int nXDest,//目标对象的左上角x坐标 88 | int nYDest,//目标对象的左上角Y坐标 89 | int nWidth,//目标对象的矩形宽度 90 | int nHeight,//目标对象的矩形长度 91 | IntPtr hdcSrc,//源设备的句柄 92 | int nXSrc,//源对象的左上角x坐标 93 | int nYSrc,//源对象的左上角y坐标 94 | int dwRop//光栅的操作值 95 | ); 96 | 97 | public enum TernaryRasterOperations : uint 98 | { 99 | SRCCOPY = 0x00CC0020, 100 | SRCPAINT = 0x00EE0086, 101 | SRCAND = 0x008800C6, 102 | SRCINVERT = 0x00660046, 103 | SRCERASE = 0x00440328, 104 | NOTSRCCOPY = 0x00330008, 105 | NOTSRCERASE = 0x001100A6, 106 | MERGECOPY = 0x00C000CA, 107 | MERGEPAINT = 0x00BB0226, 108 | PATCOPY = 0x00F00021, 109 | PATPAINT = 0x00FB0A09, 110 | PATINVERT = 0x005A0049, 111 | DSTINVERT = 0x00550009, 112 | BLACKNESS = 0x00000042, 113 | WHITENESS = 0x00FF0062, 114 | CAPTUREBLT = 0x40000000 //only if WinVer >= 5.0.0 (see wingdi.h) 115 | }//https://docs.microsoft.com/zh-cn/windows/win32/api/wingdi/nf-wingdi-bitblt 116 | [DllImport("user32.dll ", EntryPoint = " SendMessage ")] 117 | public static extern int SendMessage(int hWnd, int wMsg, int wParam, int lParam); 118 | 119 | [DllImport("user32.dll ", EntryPoint = " ReleaseCapture ")] 120 | public static extern int ReleaseCapture(); 121 | 122 | public const int WM_SysCommand = 0x0112; 123 | public const int SC_MOVE = 0xF012; 124 | 125 | public const int SC_MAXIMIZE = 61488; 126 | public const int SC_MINIMIZE = 61472; 127 | 128 | 129 | [DllImport("User32.dll", EntryPoint = "FindWindow")] 130 | public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); 131 | 132 | 133 | [DllImport("kernel32.dll")] 134 | public static extern int GetPrivateProfileInt(string lpAppName, string lpKeyName, int nDefault, string lpFileName); 135 | 136 | [DllImport("kernel32.dll")] 137 | public static extern int GetPrivateProfileString(string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName); 138 | 139 | [DllImport("kernel32.dll")] 140 | public static extern int WritePrivateProfileString(string lpAppName, string lpKeyName, string lpString, string lpFileName); 141 | 142 | 143 | [DllImport("user32.dll", EntryPoint = "GetWindow")] 144 | public static extern IntPtr GetWindow(IntPtr hWnd, int uCmd); 145 | 146 | [DllImport("user32.dll")] 147 | public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); 148 | 149 | public const int GWL_EXSTYLE = -20; 150 | public const int WS_EX_TRANSPARENT = 32; 151 | 152 | [DllImport("user32.dll")] 153 | public static extern int SetWindowLong(IntPtr hWnd, int nIndex, uint dwNewLong); 154 | 155 | [DllImport("user32.dll")] 156 | public static extern int GetWindowLong(IntPtr hWnd, int nIndex); 157 | 158 | public delegate bool EnumWindowsProc(IntPtr hWnd, int lParam); 159 | [DllImport("user32.dll")] 160 | public static extern int EnumWindows(EnumWindowsProc ewp, int lParam); 161 | 162 | [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] 163 | public static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount); 164 | 165 | [DllImport("user32.dll")] 166 | public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); 167 | 168 | /* 169 | * HWND_TOP = 0; {在前面} 170 | HWND_BOTTOM = 1; {在后面} 171 | HWND_TOPMOST = HWND(-1); {在前面, 位于任何顶部窗口的前面} 172 | HWND_NOTOPMOST = HWND(-2); {在前面, 位于其他顶部窗口的后面} 173 | //uFlags 参数可选值: 174 | SWP_NOSIZE = 1; {忽略 cx、cy, 保持大小} 175 | SWP_NOMOVE = 2; {忽略 X、Y, 不改变位置} 176 | SWP_NOZORDER = 4; {忽略 hWndInsertAfter, 保持 Z 顺序} 177 | SWP_NOREDRAW = 8; {不重绘} 178 | SWP_NOACTIVATE = $10; {不激活} 179 | SWP_FRAMECHANGED = $20; {强制发送 WM_NCCALCSIZE 消息, 一般只是在改变大小时才发送此消息} 180 | SWP_SHOWWINDOW = $40; {显示窗口} 181 | SWP_HIDEWINDOW = $80; {隐藏窗口} 182 | SWP_NOCOPYBITS = $100; {丢弃客户区} 183 | SWP_NOOWNERZORDER = $200; {忽略 hWndInsertAfter, 不改变 Z 序列的所有者} 184 | SWP_NOSENDCHANGING = $400; {不发出 WM_WINDOWPOSCHANGING 消息} 185 | SWP_DRAWFRAME = SWP_FRAMECHANGED; {画边框} 186 | SWP_NOREPOSITION = SWP_NOOWNERZORDER;{} 187 | SWP_DEFERERASE = $2000; {防止产生 WM_SYNCPAINT 消息} 188 | SWP_ASYNCWINDOWPOS = $4000; {若调用进程不拥有窗口, 系统会向拥有窗口的线程发出需求} 189 | */ 190 | [DllImport("user32.dll")] 191 | public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndlnsertAfter, int X, int Y, int cx, int cy, uint Flags); 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/!!!!!!操作必看.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huix-oldcat/ArkDesktop/ca0b382bbf1016a5f33354a96f2015a2c7b76630/ArkDesktopHelperWPF/!!!!!!操作必看.txt -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/!!!!!!界面介绍.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huix-oldcat/ArkDesktop/ca0b382bbf1016a5f33354a96f2015a2c7b76630/ArkDesktopHelperWPF/!!!!!!界面介绍.png -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/About.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 本图标不包含于本开源项目中,亦不适用MPLv2许可证 16 | 图标来源:https://www.pixiv.net/artworks/75931413 17 | 画师:溪涧殇 https://www.pixiv.net/users/8703481 18 | 画师微博:@溪涧殇 19 | 20 | 21 | 22 | 29 | 36 | 37 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/About.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace ArkDesktopHelperWPF 17 | { 18 | /// 19 | /// About.xaml 的交互逻辑 20 | /// 21 | public partial class AboutInfo : UserControl 22 | { 23 | public AboutInfo() 24 | { 25 | InitializeComponent(); 26 | HelperVersionTextBlock.Text = "Helper version:" + GetType().Assembly.GetName().Version.ToString(); 27 | CoreVersionTextBlock.Text = "Core Version:" + ArkDesktop.CoreKit.UpdateChecker.CoreVersion; 28 | } 29 | 30 | private void GoWildButton_Click(object sender, RoutedEventArgs e) 31 | { 32 | if (sender.Equals(GitHubButton)) System.Diagnostics.Process.Start("https://www.github.com/huix-oldcat/ArkDesktop"); 33 | else if(sender.Equals(WebsiteButton)) System.Diagnostics.Process.Start("https://akd.huix.cc/"); 34 | else if(sender.Equals(QQGroupButton)) System.Diagnostics.Process.Start("https://jq.qq.com/?_wv=1027&k=5j3ooR8"); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace ArkDesktopHelperWPF 10 | { 11 | /// 12 | /// App.xaml 的交互逻辑 13 | /// 14 | public partial class App : Application 15 | { 16 | public const int version = 2; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/ArkDesktopHelperWPF.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {B98F0DA4-B7D5-48DD-A5DD-9474A2FC79EB} 8 | WinExe 9 | ArkDesktopHelperWPF 10 | ArkDesktopHelperWPF 11 | v4.7.2 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | true 17 | 18 | 19 | 20 | 21 | AnyCPU 22 | true 23 | full 24 | false 25 | ..\Build\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | 30 | 31 | AnyCPU 32 | none 33 | true 34 | ..\Build\Release\ 35 | TRACE 36 | prompt 37 | 4 38 | 39 | 40 | GlobalIcon.ico 41 | 42 | 43 | 44 | ..\packages\MaterialDesignColors.1.2.1\lib\net45\MaterialDesignColors.dll 45 | 46 | 47 | ..\packages\MaterialDesignThemes.3.0.0\lib\net45\MaterialDesignThemes.Wpf.dll 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 4.0 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | MSBuild:Compile 68 | Designer 69 | 70 | 71 | About.xaml 72 | 73 | 74 | ConfigCard.xaml 75 | 76 | 77 | ConfigSelect.xaml 78 | 79 | 80 | Designer 81 | MSBuild:Compile 82 | 83 | 84 | Designer 85 | MSBuild:Compile 86 | 87 | 88 | Designer 89 | MSBuild:Compile 90 | 91 | 92 | Designer 93 | MSBuild:Compile 94 | 95 | 96 | MSBuild:Compile 97 | Designer 98 | 99 | 100 | App.xaml 101 | Code 102 | 103 | 104 | Dialog.xaml 105 | 106 | 107 | GlobalSetting.xaml 108 | 109 | 110 | MainWindow.xaml 111 | Code 112 | 113 | 114 | Designer 115 | MSBuild:Compile 116 | 117 | 118 | 119 | 120 | Code 121 | 122 | 123 | True 124 | True 125 | Resources.resx 126 | 127 | 128 | True 129 | Settings.settings 130 | True 131 | 132 | 133 | ResXFileCodeGenerator 134 | Resources.Designer.cs 135 | 136 | 137 | 138 | SettingsSingleFileGenerator 139 | Settings.Designer.cs 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | {ed7282fd-04a9-400d-abc4-540724fa8a44} 151 | ArkDesktopCoreKit 152 | False 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | PreserveNewest 164 | 165 | 166 | 167 | 168 | PreserveNewest 169 | 170 | 171 | 172 | 173 | 174 | 175 | 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/ConfigCard.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 标题标题标题标题 24 | 25 | 26 | 描述描述描述没什么事没什么没什么事没什么是没什么事 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/ConfigCard.xaml.cs: -------------------------------------------------------------------------------- 1 | using ArkDesktop.CoreKit; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Documents; 12 | using System.Windows.Input; 13 | using System.Windows.Media; 14 | using System.Windows.Media.Imaging; 15 | using System.Windows.Navigation; 16 | using System.Windows.Shapes; 17 | 18 | namespace ArkDesktopHelperWPF 19 | { 20 | /// 21 | /// ConfigCard.xaml 的交互逻辑 22 | /// 23 | public partial class ConfigCard : UserControl 24 | { 25 | public readonly ConfigInfo info; 26 | public bool isChecked = false; 27 | 28 | public ConfigCard(ConfigInfo info) 29 | { 30 | InitializeComponent(); 31 | this.info = info; 32 | name.Text = info.ConfigName; 33 | description.Text = info.Description == "" ? "暂无描述" : info.Description; 34 | if (info.LaunchModule == null) errorTag.ToolTip = "一个或多个插件未加载"; 35 | else errorTag.Visibility = Visibility.Hidden; 36 | if (File.Exists(System.IO.Path.Combine(info.rootPath, "preview.png"))) 37 | previewImage.Source = new BitmapImage(new Uri(System.IO.Path.Combine(info.rootPath, "preview.png"), UriKind.Absolute)); 38 | } 39 | 40 | private void Image_MouseEnter(object sender, MouseEventArgs e) 41 | { 42 | runMask.Visibility = Visibility.Visible; 43 | } 44 | 45 | private void RunMask_MouseLeave(object sender, MouseEventArgs e) 46 | { 47 | if (isChecked == false) runMask.Visibility = Visibility.Hidden; 48 | } 49 | 50 | private void RunMask_MouseDown(object sender, MouseButtonEventArgs e) 51 | { 52 | rect.Fill = new SolidColorBrush(Color.FromArgb(175, 100, 100, 100)); 53 | } 54 | 55 | private void RunMask_MouseUp(object sender, MouseButtonEventArgs e) 56 | { 57 | rect.Fill = new SolidColorBrush(Color.FromArgb(175, 255, 255, 255)); 58 | isChecked = !isChecked; 59 | checkedIcon.Kind = isChecked ? MaterialDesignThemes.Wpf.PackIconKind.RadioboxMarked : MaterialDesignThemes.Wpf.PackIconKind.RadioboxBlank; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/ConfigSelect.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/ConfigSelect.xaml.cs: -------------------------------------------------------------------------------- 1 | using ArkDesktop.CoreKit; 2 | using MaterialDesignThemes.Wpf; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | 9 | namespace ArkDesktopHelperWPF 10 | { 11 | /// 12 | /// UserControl1.xaml 的交互逻辑 13 | /// 14 | public partial class ConfigSelect : UserControl 15 | { 16 | private readonly ConfigManager manager; 17 | private readonly MainWindow.RequestStart requestStart; 18 | private readonly MainWindow.RequestBroadcast requestBrocast; 19 | 20 | public ConfigSelect(ConfigManager manager, MainWindow.RequestStart requestStart, MainWindow.RequestBroadcast requestBrocast) 21 | { 22 | InitializeComponent(); 23 | this.manager = manager; 24 | this.requestStart = requestStart; 25 | this.requestBrocast = requestBrocast; 26 | LoadConfigs(); 27 | } 28 | //MaterialDesign形式的 messagebox 29 | public async void MsgBox(String msg,object sender, RoutedEventArgs e) 30 | { 31 | Dialog dialog = new Dialog 32 | { 33 | Message = { Text = msg } 34 | }; 35 | await DialogHost.Show(dialog, "RootDialog"); 36 | } 37 | public async void MsgBox(String msg,String c, object sender, RoutedEventArgs e) 38 | { 39 | Dialog dialog = new Dialog 40 | { 41 | Message = { Text = msg } 42 | }; 43 | dialog.settingConfigPath(c); 44 | await DialogHost.Show(dialog, "RootDialog"); 45 | } 46 | private void Button_Click(object sender, RoutedEventArgs e) 47 | { 48 | Button button = sender as Button; 49 | switch (button.Name) 50 | { 51 | case "runButton": 52 | requestStart?.Invoke(GetSelectedConfigs()); 53 | break; 54 | case "ExportButton": 55 | string path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Guid.NewGuid().ToString() + ".akdpkg"); 56 | requestBrocast("开始导出..."); 57 | var list = GetSelectedConfigs(); 58 | PackageManager.PackConfigs(list, path); 59 | App.Current.Dispatcher.Invoke((Action)(() => 60 | { 61 | MsgBox("已导出至\n" + path + "\n是否使用文件管理器打开?", path, sender, e); 62 | })); 63 | break; 64 | 65 | } 66 | } 67 | 68 | private List GetSelectedConfigs() 69 | { 70 | List configInfos = new List(); 71 | foreach (ConfigCard i in configList.Children) 72 | if (i.isChecked) 73 | configInfos.Add(i.info); 74 | return configInfos; 75 | } 76 | 77 | public MainWindow.RequestConfigList RequestDelegate => GetSelectedConfigs; 78 | 79 | public void LoadConfigs() 80 | { 81 | configList.Children.Clear(); 82 | manager.ScanConfigs(); 83 | foreach (var i in manager.Configs) configList.Children.Add(new ConfigCard(i)); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/Dialog.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/Dialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Windows; 3 | using System.Windows.Controls; 4 | 5 | namespace ArkDesktopHelperWPF 6 | { 7 | /// 8 | /// Dialog.xaml 的交互逻辑 9 | /// 10 | public partial class Dialog :UserControl 11 | { 12 | private static string configPath = ""; 13 | public void settingConfigPath(string s) 14 | { 15 | configPath = s; 16 | } 17 | public Dialog() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | private static void ExplorerFile(string path) 23 | { 24 | using (Process proc = new Process()) 25 | { 26 | proc.StartInfo.FileName = "explorer"; 27 | proc.StartInfo.Arguments = "/select," + path; 28 | proc.Start(); 29 | }; 30 | } 31 | 32 | //否 33 | private void Button_Click(object sender, RoutedEventArgs e) 34 | { 35 | //TODO ,always todo 36 | } 37 | 38 | //是 39 | private void Button_Click_1(object sender, RoutedEventArgs e) 40 | { 41 | if (configPath != "") 42 | { 43 | ExplorerFile(configPath); 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/GlobalIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huix-oldcat/ArkDesktop/ca0b382bbf1016a5f33354a96f2015a2c7b76630/ArkDesktopHelperWPF/GlobalIcon.ico -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/GlobalIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huix-oldcat/ArkDesktop/ca0b382bbf1016a5f33354a96f2015a2c7b76630/ArkDesktopHelperWPF/GlobalIcon.png -------------------------------------------------------------------------------- /ArkDesktopHelperWPF/GlobalSetting.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 开机自启动(重新勾选以将主界面选中的配置更新为默认配置) 13 | 14 | 23 | 很讨厌ky的人呢......为什么看气氛就那么难呢 24 | 25 | 26 | 27 | 28 | 35 | 42 | 46 | 47 |