mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 17:06:12 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae2bee3125 | ||
|
|
3d48777224 | ||
|
|
0a3b4060de | ||
|
|
b2dfec2ed3 | ||
|
|
d1c598505e | ||
|
|
441a8b00cc | ||
|
|
7a8503ea9f | ||
|
|
de80a58b54 | ||
|
|
f62ea316a1 | ||
|
|
668c393a1b | ||
|
|
ed84fe37ed | ||
|
|
24dac76057 | ||
|
|
5e3642e539 | ||
|
|
2f6662caea | ||
|
|
aeb31af2f9 | ||
|
|
8f650ac35a | ||
|
|
b69bba68bb | ||
|
|
d75aef7460 | ||
|
|
9dd40c7ae8 | ||
|
|
921d6dfc20 | ||
|
|
520f145eb0 | ||
|
|
77a1383e7b | ||
|
|
4e5502977d | ||
|
|
7761f505b1 | ||
|
|
05271e5f51 | ||
|
|
3d7caf2011 | ||
|
|
c25c270bd9 | ||
|
|
c29d70ef0d | ||
|
|
528d1161fe | ||
|
|
0b0f208098 | ||
|
|
ac49916308 | ||
|
|
83f5b28d5c | ||
|
|
d8a895b240 | ||
|
|
ef27ace78b | ||
|
|
0f6e8437fd | ||
|
|
5bc35cf92b | ||
|
|
2df2ef3b11 | ||
|
|
603a78935b | ||
|
|
40d1232e33 | ||
|
|
1cde9442ef | ||
|
|
90ee56be94 | ||
|
|
aed4b7de64 | ||
|
|
101b516ca8 | ||
|
|
c551dafeed | ||
|
|
7d2f68a66a | ||
|
|
efd75b0a42 | ||
|
|
74bff47ce3 | ||
|
|
6e4757adea | ||
|
|
e00c873bd5 | ||
|
|
d70e6229cc | ||
|
|
f94f24297e | ||
|
|
36e09acd0e | ||
|
|
24ca987ab0 | ||
|
|
535062e8c4 | ||
|
|
69774b86a3 | ||
|
|
e9cf43d968 | ||
|
|
8df53ef190 | ||
|
|
ae490367ee | ||
|
|
3268a66d64 | ||
|
|
24437371ec | ||
|
|
8e31735032 | ||
|
|
c38ea293d1 | ||
|
|
ea0b79573a | ||
|
|
2b4583ce5d | ||
|
|
870b84a631 | ||
|
|
b23571c0f7 | ||
|
|
d4c4b4e1ed | ||
|
|
41e4e03d2f | ||
|
|
9db60da702 | ||
|
|
86f07f4bf3 |
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: enhancement
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
+1
-1
@@ -3,7 +3,6 @@
|
|||||||
##
|
##
|
||||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||||
|
|
||||||
src/
|
|
||||||
bin/
|
bin/
|
||||||
obj/
|
obj/
|
||||||
|
|
||||||
@@ -13,6 +12,7 @@ obj/
|
|||||||
*.user
|
*.user
|
||||||
*.userosscache
|
*.userosscache
|
||||||
*.sln.docstates
|
*.sln.docstates
|
||||||
|
*GPUCache/
|
||||||
|
|
||||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
*.userprefs
|
*.userprefs
|
||||||
|
|||||||
@@ -4,14 +4,17 @@
|
|||||||
> You can add useful elements to your desktop like a clock, a audio visualizer or even your own plugins!
|
> You can add useful elements to your desktop like a clock, a audio visualizer or even your own plugins!
|
||||||
|
|
||||||
- [Releases](https://github.com/Stone-Red-Code/DesktopMagic/releases)
|
- [Releases](https://github.com/Stone-Red-Code/DesktopMagic/releases)
|
||||||
|
- [Download Plugins](https://github.com/Stone-Red-Code/DesktopMagic-Plugins)
|
||||||
- [Plugin Documentation](https://github.com/Stone-Red-Code/DesktopMagic/wiki)
|
- [Plugin Documentation](https://github.com/Stone-Red-Code/DesktopMagic/wiki)
|
||||||
- [Licence](https://github.com/Stone-Red-Code/DesktopMagic/blob/main/LICENSE)
|
- [Licence](https://github.com/Stone-Red-Code/DesktopMagic/blob/main/LICENSE)
|
||||||
|
|
||||||
## Usage
|
## Setup
|
||||||
|
|
||||||
1. Download one of the [releases](https://github.com/Stone-Red-Code/DesktopMagic/releases)
|
1. Download one of the [releases](https://github.com/Stone-Red-Code/DesktopMagic/releases).
|
||||||
2. Execute the `DesktopMagic-Installer.exe` file
|
1. Follow one of the steps below.
|
||||||
3. (Optional) Put a shortcut to the `DesktopMagic.exe` file in the install directory into the `shell:startup` directory
|
1. Execute the `DesktopMagic-Installer.exe` file.
|
||||||
|
1. Unzip the `DesktopMagic-Standalone.zip` file and execute the `DesktopMagic.exe` file.
|
||||||
|
1. (Optional) Put a shortcut to the `DesktopMagic.exe` file in the install directory into the `shell:startup` directory.
|
||||||
|
|
||||||
## Preview
|
## Preview
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,14 +2,14 @@
|
|||||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
#define MyAppName "DesktopMagic"
|
#define MyAppName "DesktopMagic"
|
||||||
#define MyAppVersion "0.0.2.1"
|
#define MyAppVersion "0.0.3.2"
|
||||||
#define MyAppPublisher "Stone_Red"
|
#define MyAppPublisher "Stone_Red"
|
||||||
#define MyAppExeName "DesktopMagic.exe"
|
#define MyAppExeName "DesktopMagic.exe"
|
||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
|
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
|
||||||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
||||||
AppId={{61FE5CE9-47C3-4255-A1F4-5BCF4ACA0876}
|
AppId={{61FE5CE9-47C3-4255-A1F4-5BCF4ACA0879}
|
||||||
AppName={#MyAppName}
|
AppName={#MyAppName}
|
||||||
AppVersion={#MyAppVersion}
|
AppVersion={#MyAppVersion}
|
||||||
;AppVerName={#MyAppName} {#MyAppVersion}
|
;AppVerName={#MyAppName} {#MyAppVersion}
|
||||||
@@ -36,40 +36,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
|
|||||||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode
|
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.exe"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\DesktopMagic\bin\Release\net6.0-windows\publish\*"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Stone_Red-C-Sharp-Utilities.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.deps.json"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.exe"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.pdb"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.runtimeconfig.dev.json"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.runtimeconfig.json"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagicPluginAPI.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagicPluginAPI.pdb"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Auth.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Auth.PlatformServices.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Calendar.v3.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Hardcodet.NotifyIcon.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\MaterialDesignColors.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\MaterialDesignThemes.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Asio.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Midi.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Wasapi.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.WinForms.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.WinMM.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\System.Drawing.Common.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\System.Management.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.Themes.Aero.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.Themes.Metro.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.Themes.VS2010.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.Toolkit.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\runtimes\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETCoreApp,Version=v5.0",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETCoreApp,Version=v5.0": {
|
|
||||||
"DesktopMagic.Installer/1.0.0": {
|
|
||||||
"runtime": {
|
|
||||||
"DesktopMagic.Installer.dll": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"DesktopMagic.Installer/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,82 +0,0 @@
|
|||||||
; Script generated by the Inno Setup Script Wizard.
|
|
||||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
|
||||||
|
|
||||||
#define MyAppName "DesktopMagic"
|
|
||||||
#define MyAppVersion "0.0.2.0"
|
|
||||||
#define MyAppPublisher "Stone_Red"
|
|
||||||
#define MyAppExeName "DesktopMagic.exe"
|
|
||||||
|
|
||||||
[Setup]
|
|
||||||
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
|
|
||||||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
|
||||||
AppId={{61FE5CE9-47C3-4255-A1F4-5BCF4ACA0876}
|
|
||||||
AppName={#MyAppName}
|
|
||||||
AppVersion={#MyAppVersion}
|
|
||||||
;AppVerName={#MyAppName} {#MyAppVersion}
|
|
||||||
AppPublisher={#MyAppPublisher}
|
|
||||||
DefaultDirName={autopf}\{#MyAppName}
|
|
||||||
DisableProgramGroupPage=yes
|
|
||||||
; The [Icons] "quicklaunchicon" entry uses {userappdata} but its [Tasks] entry has a proper IsAdminInstallMode Check.
|
|
||||||
UsedUserAreasWarning=no
|
|
||||||
; Remove the following line to run in administrative install mode (install for all users.)
|
|
||||||
PrivilegesRequired=lowest
|
|
||||||
PrivilegesRequiredOverridesAllowed=dialog
|
|
||||||
OutputBaseFilename=DesktopMagic-Installer
|
|
||||||
OutputDir=.
|
|
||||||
Compression=lzma
|
|
||||||
SolidCompression=yes
|
|
||||||
WizardStyle=modern
|
|
||||||
|
|
||||||
[Languages]
|
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
|
||||||
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
|
|
||||||
|
|
||||||
[Tasks]
|
|
||||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
|
||||||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode
|
|
||||||
|
|
||||||
[Files]
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.exe"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Stone_Red-C-Sharp-Utilities.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.deps.json"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.exe"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.pdb"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.runtimeconfig.dev.json"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.runtimeconfig.json"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagicPluginAPI.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagicPluginAPI.pdb"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Auth.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Auth.PlatformServices.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Calendar.v3.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Hardcodet.NotifyIcon.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\MaterialDesignColors.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\MaterialDesignThemes.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Asio.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Midi.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Wasapi.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.WinForms.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.WinMM.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\System.Drawing.Common.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\System.Management.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.Themes.Aero.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.Themes.Metro.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.Themes.VS2010.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.Toolkit.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\runtimes\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
|
||||||
|
|
||||||
[Icons]
|
|
||||||
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
|
||||||
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
|
||||||
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
|
|
||||||
|
|
||||||
[Run]
|
|
||||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
|
||||||
|
|
||||||
Binary file not shown.
@@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETCoreApp,Version=v5.0",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETCoreApp,Version=v5.0": {
|
|
||||||
"DesktopMagic.Installer/1.0.0": {
|
|
||||||
"runtime": {
|
|
||||||
"DesktopMagic.Installer.dll": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"DesktopMagic.Installer/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,82 +0,0 @@
|
|||||||
; Script generated by the Inno Setup Script Wizard.
|
|
||||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
|
||||||
|
|
||||||
#define MyAppName "DesktopMagic"
|
|
||||||
#define MyAppVersion "0.0.2.1"
|
|
||||||
#define MyAppPublisher "Stone_Red"
|
|
||||||
#define MyAppExeName "DesktopMagic.exe"
|
|
||||||
|
|
||||||
[Setup]
|
|
||||||
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
|
|
||||||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
|
||||||
AppId={{61FE5CE9-47C3-4255-A1F4-5BCF4ACA0876}
|
|
||||||
AppName={#MyAppName}
|
|
||||||
AppVersion={#MyAppVersion}
|
|
||||||
;AppVerName={#MyAppName} {#MyAppVersion}
|
|
||||||
AppPublisher={#MyAppPublisher}
|
|
||||||
DefaultDirName={autopf}\{#MyAppName}
|
|
||||||
DisableProgramGroupPage=yes
|
|
||||||
; The [Icons] "quicklaunchicon" entry uses {userappdata} but its [Tasks] entry has a proper IsAdminInstallMode Check.
|
|
||||||
UsedUserAreasWarning=no
|
|
||||||
; Remove the following line to run in administrative install mode (install for all users.)
|
|
||||||
PrivilegesRequired=lowest
|
|
||||||
PrivilegesRequiredOverridesAllowed=dialog
|
|
||||||
OutputBaseFilename=DesktopMagic-Installer
|
|
||||||
OutputDir=.
|
|
||||||
Compression=lzma
|
|
||||||
SolidCompression=yes
|
|
||||||
WizardStyle=modern
|
|
||||||
|
|
||||||
[Languages]
|
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
|
||||||
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
|
|
||||||
|
|
||||||
[Tasks]
|
|
||||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
|
||||||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode
|
|
||||||
|
|
||||||
[Files]
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.exe"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Stone_Red-C-Sharp-Utilities.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.deps.json"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.exe"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.pdb"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.runtimeconfig.dev.json"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagic.runtimeconfig.json"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagicPluginAPI.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\DesktopMagicPluginAPI.pdb"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Auth.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Auth.PlatformServices.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Calendar.v3.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Google.Apis.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Hardcodet.NotifyIcon.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\MaterialDesignColors.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\MaterialDesignThemes.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Asio.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Midi.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.Wasapi.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.WinForms.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\NAudio.WinMM.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\System.Drawing.Common.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\System.Management.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.Themes.Aero.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.Themes.Metro.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.AvalonDock.Themes.VS2010.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\Xceed.Wpf.Toolkit.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\runtimes\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
|
||||||
|
|
||||||
[Icons]
|
|
||||||
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
|
||||||
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
|
||||||
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
|
|
||||||
|
|
||||||
[Run]
|
|
||||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
|
||||||
|
|
||||||
Binary file not shown.
@@ -1,67 +0,0 @@
|
|||||||
{
|
|
||||||
"format": 1,
|
|
||||||
"restore": {
|
|
||||||
"C:\\Users\\David\\Programmieren\\DesktopMagic\\src\\DesktopMagic.Installer\\DesktopMagic.Installer.csproj": {}
|
|
||||||
},
|
|
||||||
"projects": {
|
|
||||||
"C:\\Users\\David\\Programmieren\\DesktopMagic\\src\\DesktopMagic.Installer\\DesktopMagic.Installer.csproj": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"restore": {
|
|
||||||
"projectUniqueName": "C:\\Users\\David\\Programmieren\\DesktopMagic\\src\\DesktopMagic.Installer\\DesktopMagic.Installer.csproj",
|
|
||||||
"projectName": "DesktopMagic.Installer",
|
|
||||||
"projectPath": "C:\\Users\\David\\Programmieren\\DesktopMagic\\src\\DesktopMagic.Installer\\DesktopMagic.Installer.csproj",
|
|
||||||
"packagesPath": "C:\\Users\\David\\.nuget\\packages\\",
|
|
||||||
"outputPath": "C:\\Users\\David\\Programmieren\\DesktopMagic\\src\\DesktopMagic.Installer\\obj\\",
|
|
||||||
"projectStyle": "PackageReference",
|
|
||||||
"fallbackFolders": [
|
|
||||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
|
||||||
],
|
|
||||||
"configFilePaths": [
|
|
||||||
"C:\\Users\\David\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
|
||||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
|
||||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
|
||||||
],
|
|
||||||
"originalTargetFrameworks": [
|
|
||||||
"net5.0"
|
|
||||||
],
|
|
||||||
"sources": {
|
|
||||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
|
||||||
"C:\\Users\\David\\AppData\\Roaming\\Cosmos User Kit\\packages\\": {},
|
|
||||||
"https://api.nuget.org/v3/index.json": {}
|
|
||||||
},
|
|
||||||
"frameworks": {
|
|
||||||
"net5.0": {
|
|
||||||
"targetAlias": "net5.0",
|
|
||||||
"projectReferences": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"warningProperties": {
|
|
||||||
"warnAsError": [
|
|
||||||
"NU1605"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"frameworks": {
|
|
||||||
"net5.0": {
|
|
||||||
"targetAlias": "net5.0",
|
|
||||||
"imports": [
|
|
||||||
"net461",
|
|
||||||
"net462",
|
|
||||||
"net47",
|
|
||||||
"net471",
|
|
||||||
"net472",
|
|
||||||
"net48"
|
|
||||||
],
|
|
||||||
"assetTargetFallback": true,
|
|
||||||
"warn": true,
|
|
||||||
"frameworkReferences": {
|
|
||||||
"Microsoft.NETCore.App": {
|
|
||||||
"privateAssets": "all"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.400\\RuntimeIdentifierGraph.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
|
||||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
|
||||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
|
||||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
|
||||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
|
||||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
|
||||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\David\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
|
||||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
|
||||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.11.0</NuGetToolVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
|
||||||
<SourceRoot Include="C:\Users\David\.nuget\packages\" />
|
|
||||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
|
||||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// Dieser Code wurde von einem Tool generiert.
|
|
||||||
// Laufzeitversion:4.0.30319.42000
|
|
||||||
//
|
|
||||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
|
||||||
// der Code erneut generiert wird.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("DesktopMagic.Installer")]
|
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("DesktopMagic.Installer")]
|
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("DesktopMagic.Installer")]
|
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
|
||||||
|
|
||||||
// Von der MSBuild WriteCodeFragment-Klasse generiert.
|
|
||||||
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
cd6667c25d7a4534637b1fde3b018e93109dbcda
|
|
||||||
-10
@@ -1,10 +0,0 @@
|
|||||||
is_global = true
|
|
||||||
build_property.TargetFramework = net5.0
|
|
||||||
build_property.TargetPlatformMinVersion =
|
|
||||||
build_property.UsingMicrosoftNETSdkWeb =
|
|
||||||
build_property.ProjectTypeGuids =
|
|
||||||
build_property.PublishSingleFile =
|
|
||||||
build_property.IncludeAllContentForSelfExtract =
|
|
||||||
build_property._SupportedPlatformList = Android,iOS,Linux,macOS,Windows
|
|
||||||
build_property.RootNamespace = DesktopMagic.Installer
|
|
||||||
build_property.ProjectDir = C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\
|
|
||||||
Binary file not shown.
-1
@@ -1 +0,0 @@
|
|||||||
3de46dc0a7a50425c2c2e0f6ae9305c5c446a680
|
|
||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\bin\Release\net5.0\Installer.iss
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\bin\Release\net5.0\DesktopMagic.Installer.deps.json
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\bin\Release\net5.0\DesktopMagic.Installer.dll
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\bin\Release\net5.0\ref\DesktopMagic.Installer.dll
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\bin\Release\net5.0\DesktopMagic.Installer.pdb
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\obj\Release\net5.0\DesktopMagic.Installer.GeneratedMSBuildEditorConfig.editorconfig
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\obj\Release\net5.0\DesktopMagic.Installer.AssemblyInfoInputs.cache
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\obj\Release\net5.0\DesktopMagic.Installer.AssemblyInfo.cs
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\obj\Release\net5.0\DesktopMagic.Installer.csproj.CoreCompileInputs.cache
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\obj\Release\net5.0\DesktopMagic.Installer.dll
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\obj\Release\net5.0\ref\DesktopMagic.Installer.dll
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\obj\Release\net5.0\DesktopMagic.Installer.pdb
|
|
||||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic.Installer\obj\Release\net5.0\DesktopMagic.Installer.csproj.AssemblyReference.cache
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,73 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"targets": {
|
|
||||||
"net5.0": {}
|
|
||||||
},
|
|
||||||
"libraries": {},
|
|
||||||
"projectFileDependencyGroups": {
|
|
||||||
"net5.0": []
|
|
||||||
},
|
|
||||||
"packageFolders": {
|
|
||||||
"C:\\Users\\David\\.nuget\\packages\\": {},
|
|
||||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
|
|
||||||
},
|
|
||||||
"project": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"restore": {
|
|
||||||
"projectUniqueName": "C:\\Users\\David\\Programmieren\\DesktopMagic\\src\\DesktopMagic.Installer\\DesktopMagic.Installer.csproj",
|
|
||||||
"projectName": "DesktopMagic.Installer",
|
|
||||||
"projectPath": "C:\\Users\\David\\Programmieren\\DesktopMagic\\src\\DesktopMagic.Installer\\DesktopMagic.Installer.csproj",
|
|
||||||
"packagesPath": "C:\\Users\\David\\.nuget\\packages\\",
|
|
||||||
"outputPath": "C:\\Users\\David\\Programmieren\\DesktopMagic\\src\\DesktopMagic.Installer\\obj\\",
|
|
||||||
"projectStyle": "PackageReference",
|
|
||||||
"fallbackFolders": [
|
|
||||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
|
||||||
],
|
|
||||||
"configFilePaths": [
|
|
||||||
"C:\\Users\\David\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
|
||||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
|
||||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
|
||||||
],
|
|
||||||
"originalTargetFrameworks": [
|
|
||||||
"net5.0"
|
|
||||||
],
|
|
||||||
"sources": {
|
|
||||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
|
||||||
"C:\\Users\\David\\AppData\\Roaming\\Cosmos User Kit\\packages\\": {},
|
|
||||||
"https://api.nuget.org/v3/index.json": {}
|
|
||||||
},
|
|
||||||
"frameworks": {
|
|
||||||
"net5.0": {
|
|
||||||
"targetAlias": "net5.0",
|
|
||||||
"projectReferences": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"warningProperties": {
|
|
||||||
"warnAsError": [
|
|
||||||
"NU1605"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"frameworks": {
|
|
||||||
"net5.0": {
|
|
||||||
"targetAlias": "net5.0",
|
|
||||||
"imports": [
|
|
||||||
"net461",
|
|
||||||
"net462",
|
|
||||||
"net47",
|
|
||||||
"net471",
|
|
||||||
"net472",
|
|
||||||
"net48"
|
|
||||||
],
|
|
||||||
"assetTargetFallback": true,
|
|
||||||
"warn": true,
|
|
||||||
"frameworkReferences": {
|
|
||||||
"Microsoft.NETCore.App": {
|
|
||||||
"privateAssets": "all"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.400\\RuntimeIdentifierGraph.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 2,
|
|
||||||
"dgSpecHash": "S2SSTiH9oDfmVBwTIyHj2/TbaJJ3f/T7hIDEaZd4bVbTBDEHTye5g0XRPRjrJt4DCgBJQJi4G11CGKAOt1g8ag==",
|
|
||||||
"success": true,
|
|
||||||
"projectFilePath": "C:\\Users\\David\\Programmieren\\DesktopMagic\\src\\DesktopMagic.Installer\\DesktopMagic.Installer.csproj",
|
|
||||||
"expectedPackageFiles": [],
|
|
||||||
"logs": []
|
|
||||||
}
|
|
||||||
@@ -4,9 +4,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
VisualStudioVersion = 16.0.31205.134
|
VisualStudioVersion = 16.0.31205.134
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopMagic", "DesktopMagic\DesktopMagic.csproj", "{B56B4CCC-CF92-4C05-9DEA-57666D81889A}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopMagic", "DesktopMagic\DesktopMagic.csproj", "{B56B4CCC-CF92-4C05-9DEA-57666D81889A}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{A06BD685-7F92-4799-846B-3EC38345108E} = {A06BD685-7F92-4799-846B-3EC38345108E}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopMagicPluginAPI", "DesktopMagicPluginAPI\DesktopMagicPluginAPI.csproj", "{9D193A10-3E8E-447F-89F1-4B316C2EE37D}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopMagicPluginAPI", "DesktopMagicPluginAPI\DesktopMagicPluginAPI.csproj", "{9D193A10-3E8E-447F-89F1-4B316C2EE37D}"
|
||||||
EndProject
|
EndProject
|
||||||
@@ -14,11 +11,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopMagicPlugin.Test", "
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopMagic.Installer", "DesktopMagic.Installer\DesktopMagic.Installer.csproj", "{A06BD685-7F92-4799-846B-3EC38345108E}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopMagic.Installer", "DesktopMagic.Installer\DesktopMagic.Installer.csproj", "{A06BD685-7F92-4799-846B-3EC38345108E}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{10A138D6-41F0-4DBB-BC39-D93467B4D982}"
|
|
||||||
ProjectSection(SolutionItems) = preProject
|
|
||||||
.editorconfig = .editorconfig
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
|||||||
@@ -1,11 +1,151 @@
|
|||||||
using System.Windows;
|
global using Stone_Red_Utilities.Logging;
|
||||||
|
|
||||||
namespace DesktopMagic
|
using AlwaysUpToDate;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace DesktopMagic;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for App.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
/// <summary>
|
private readonly string logFilePath;
|
||||||
/// Interaction logic for App.xaml
|
private readonly Mutex _mutex;
|
||||||
/// </summary>
|
#if DEBUG
|
||||||
public partial class App : Application
|
private readonly Updater updater = new Updater(TimeSpan.FromDays(1), "https://raw.githubusercontent.com/Stone-Red-Code/DesktopMagic/develop/update/updateInfo.json");
|
||||||
|
#else
|
||||||
|
private readonly Updater updater = new Updater(TimeSpan.FromDays(1), "https://raw.githubusercontent.com/Stone-Red-Code/DesktopMagic/main/update/updateInfo.json");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public const string AppName = "Desktop Magic";
|
||||||
|
public static string ApplicationDataPath { get; } = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + AppName;
|
||||||
|
|
||||||
|
public static Logger Logger { get; } = new Logger();
|
||||||
|
|
||||||
|
public App()
|
||||||
{
|
{
|
||||||
|
logFilePath = ApplicationDataPath + "\\Log.log";
|
||||||
|
|
||||||
|
// Try to grab mutex
|
||||||
|
_mutex = new Mutex(true, $"Stone_Red{AppName}", out bool createdNew);
|
||||||
|
|
||||||
|
//check if creating new was successful
|
||||||
|
if (!createdNew)
|
||||||
|
{
|
||||||
|
Setup(false);
|
||||||
|
Logger.Log("Shutting down because other instance already running.", "Setup");
|
||||||
|
//Shutdown Application
|
||||||
|
Current.Shutdown();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Setup(true);
|
||||||
|
Exit += CloseMutexHandler;
|
||||||
|
|
||||||
|
updater.ProgressChanged += Updater_ProgressChanged;
|
||||||
|
updater.OnException += Updater_OnException;
|
||||||
|
updater.NoUpdateAvailible += Updater_NoUpdateAvailible;
|
||||||
|
updater.UpdateAvailible += Updater_UpdateAvailible;
|
||||||
|
updater.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Updater_UpdateAvailible(string version, string additionalInformation)
|
||||||
|
{
|
||||||
|
updater.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Updater_NoUpdateAvailible()
|
||||||
|
{
|
||||||
|
Logger.Log("No update available", "Updater");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Updater_OnException(Exception exception)
|
||||||
|
{
|
||||||
|
Logger.Log(exception.ToString(), "Updater");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Updater_ProgressChanged(long? totalFileSize, long totalBytesDownloaded, double? progressPercentage)
|
||||||
|
{
|
||||||
|
Logger.Log($"Downloading: {progressPercentage}% {totalBytesDownloaded}/{totalFileSize}", "Updater");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void CloseMutexHandler(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_mutex?.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Setup(bool clearLogFile)
|
||||||
|
{
|
||||||
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||||
|
|
||||||
|
Logger.Config = new LogConfig()
|
||||||
|
{
|
||||||
|
FatalConfig = new OutputConfig()
|
||||||
|
{
|
||||||
|
Color = ConsoleColor.DarkRed,
|
||||||
|
LogTarget = LogTarget.DebugConsole | LogTarget.File,
|
||||||
|
FilePath = logFilePath
|
||||||
|
},
|
||||||
|
ErrorConfig = new OutputConfig()
|
||||||
|
{
|
||||||
|
Color = ConsoleColor.Red,
|
||||||
|
LogTarget = LogTarget.DebugConsole | LogTarget.File,
|
||||||
|
FilePath = logFilePath
|
||||||
|
},
|
||||||
|
WarnConfig = new OutputConfig()
|
||||||
|
{
|
||||||
|
Color = ConsoleColor.Yellow,
|
||||||
|
LogTarget = LogTarget.DebugConsole | LogTarget.File,
|
||||||
|
FilePath = logFilePath
|
||||||
|
},
|
||||||
|
InfoConfig = new OutputConfig()
|
||||||
|
{
|
||||||
|
Color = ConsoleColor.White,
|
||||||
|
LogTarget = LogTarget.DebugConsole | LogTarget.File,
|
||||||
|
FilePath = logFilePath
|
||||||
|
},
|
||||||
|
DebugConfig = new OutputConfig()
|
||||||
|
{
|
||||||
|
Color = ConsoleColor.Gray,
|
||||||
|
LogTarget = LogTarget.DebugConsole,
|
||||||
|
},
|
||||||
|
FormatConfig = new FormatConfig()
|
||||||
|
{
|
||||||
|
DebugConsoleFormat = $"> {{{LogFormatType.DateTime}:hh:mm:ss}} | {{{LogFormatType.LogSeverity},-5}} | {{{LogFormatType.Message}}}\nat {{{LogFormatType.LineNumber}}} | {{{LogFormatType.FilePath}}}"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(ApplicationDataPath))
|
||||||
|
{
|
||||||
|
_ = Directory.CreateDirectory(ApplicationDataPath);
|
||||||
|
}
|
||||||
|
Logger.Log("Created ApplicationData Folder", "Main");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_ = MessageBox.Show(ex.ToString());
|
||||||
|
Logger.Log(ex.Message, "Setup", LogSeverity.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (clearLogFile)
|
||||||
|
{
|
||||||
|
Logger.ClearLogFile(LogSeverity.Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Log("Log setup complete", "Setup");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
Exception exception = (Exception)e.ExceptionObject;
|
||||||
|
Logger.Log(exception + (e.IsTerminating ? "\t Process terminating!" : ""), exception.Source, LogSeverity.Fatal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+9
-2
@@ -14,8 +14,15 @@
|
|||||||
x:Name="window">
|
x:Name="window">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Rectangle x:Name="panel" Fill="#4CBAFFEF" Stroke="White" Margin="0,0,0,0" Visibility="Collapsed" />
|
<Rectangle x:Name="panel" Fill="#4CBAFFEF" Stroke="White" Margin="0,0,0,0" Visibility="Collapsed" />
|
||||||
<Viewbox StretchDirection="DownOnly" Stretch="Uniform">
|
<Border x:Name="border"/>
|
||||||
<TextBlock x:Name="textBlock" FontSize="999" Foreground="White" Text="CPU: 000%" IsHitTestVisible="False" />
|
<Viewbox x:Name="viewBox" StretchDirection="Both" Stretch="Uniform">
|
||||||
|
<Viewbox.Clip>
|
||||||
|
<RectangleGeometry x:Name="rectangleGeometry" RadiusX="{Binding ElementName=border, Path=CornerRadius.TopLeft}" RadiusY="{Binding ElementName=border, Path=CornerRadius.TopLeft}" Rect="{Binding ElementName=border}"/>
|
||||||
|
</Viewbox.Clip>
|
||||||
|
<DockPanel x:Name="dockPanel">
|
||||||
|
<TextBlock x:Name="textBlock" Foreground="White" FontSize="100" Text="CPU: " IsHitTestVisible="False" />
|
||||||
|
<TextBlock x:Name="valueTextBlock" TextAlignment="Right" FontSize="100" Foreground="White" Text="000%" IsHitTestVisible="False" />
|
||||||
|
</DockPanel>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Grid>
|
</Grid>
|
||||||
<WindowChrome.WindowChrome>
|
<WindowChrome.WindowChrome>
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
using DesktopMagic.Helpers;
|
||||||
|
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Timers;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Interop;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
|
||||||
|
namespace DesktopMagic
|
||||||
|
{
|
||||||
|
public partial class CpuUsageWindow : Window
|
||||||
|
{
|
||||||
|
private RegistryKey key;
|
||||||
|
private PerformanceCounter cpuCounter = new PerformanceCounter();
|
||||||
|
|
||||||
|
public CpuUsageWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
Window w = new()
|
||||||
|
{
|
||||||
|
Top = -100,
|
||||||
|
Left = -100,
|
||||||
|
Width = 0,
|
||||||
|
Height = 0,
|
||||||
|
|
||||||
|
WindowStyle = WindowStyle.ToolWindow,
|
||||||
|
ShowInTaskbar = false
|
||||||
|
};
|
||||||
|
w.Show();
|
||||||
|
Owner = w;
|
||||||
|
w.Hide();
|
||||||
|
|
||||||
|
cpuCounter.CategoryName = "Processor";
|
||||||
|
cpuCounter.CounterName = "% Processor Time";
|
||||||
|
cpuCounter.InstanceName = "_Total";
|
||||||
|
|
||||||
|
Timer t = new Timer();
|
||||||
|
t.Interval = 100;
|
||||||
|
t.Elapsed += UpdateTimer_Elapsed;
|
||||||
|
t.Start();
|
||||||
|
|
||||||
|
Timer valueTimer = new Timer();
|
||||||
|
valueTimer.Interval = 1000;
|
||||||
|
valueTimer.Elapsed += ValueTimer_Elapsed;
|
||||||
|
;
|
||||||
|
valueTimer.Start();
|
||||||
|
|
||||||
|
key = Registry.CurrentUser.CreateSubKey(@"Software\" + App.AppName);
|
||||||
|
Top = double.Parse(key.GetValue("CpuUsageWindowTop", 100).ToString());
|
||||||
|
Left = double.Parse(key.GetValue("CpuUsageWindowLeft", 100).ToString());
|
||||||
|
Height = double.Parse(key.GetValue("CpuUsageWindowHeight", 200).ToString());
|
||||||
|
Width = double.Parse(key.GetValue("CpuUsageWindowWidth", 500).ToString());
|
||||||
|
IsEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnSourceInitialized(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnSourceInitialized(e);
|
||||||
|
|
||||||
|
//Set the window style to noactivate.
|
||||||
|
WindowInteropHelper helper = new WindowInteropHelper(this);
|
||||||
|
WindowPos.SetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE,
|
||||||
|
WindowPos.GetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE) | WindowPos.WS_EX_NOACTIVATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
if (MainWindow.EditMode)
|
||||||
|
{
|
||||||
|
panel.Visibility = Visibility.Visible;
|
||||||
|
tileBar.CaptionHeight = tileBar.CaptionHeight = ActualHeight - 10 < 0 ? 0 : ActualHeight - 10;
|
||||||
|
WindowPos.SetIsLocked(this, false);
|
||||||
|
ResizeMode = ResizeMode.CanResize;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
panel.Visibility = Visibility.Collapsed;
|
||||||
|
tileBar.CaptionHeight = 0;
|
||||||
|
WindowPos.SetIsLocked(this, true);
|
||||||
|
ResizeMode = ResizeMode.NoResize;
|
||||||
|
}
|
||||||
|
|
||||||
|
rectangleGeometry.Rect = new Rect(0, 0, border.ActualWidth, border.ActualHeight);
|
||||||
|
border.Background = MainWindow.Theme.BackgroundBrush;
|
||||||
|
border.CornerRadius = new CornerRadius(MainWindow.Theme.CornerRadius);
|
||||||
|
viewBox.Margin = new Thickness(MainWindow.Theme.Margin);
|
||||||
|
border.Width = viewBox.ActualWidth + MainWindow.Theme.Margin * 2;
|
||||||
|
border.Height = viewBox.ActualHeight + MainWindow.Theme.Margin * 2;
|
||||||
|
textBlock.FontFamily = new FontFamily(MainWindow.Theme.Font);
|
||||||
|
textBlock.Foreground = MainWindow.Theme.PrimaryBrush;
|
||||||
|
valueTextBlock.FontFamily = new FontFamily(MainWindow.Theme.Font);
|
||||||
|
valueTextBlock.Foreground = MainWindow.Theme.PrimaryBrush;
|
||||||
|
|
||||||
|
ClculateWidth();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ValueTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
string cpuUsage = GetCpuUsage();
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
valueTextBlock.Text = cpuUsage;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClculateWidth()
|
||||||
|
{
|
||||||
|
string template = "CPU: ###%";
|
||||||
|
double lenght = 0;
|
||||||
|
for (int i = 0; i < 9; i++)
|
||||||
|
{
|
||||||
|
lenght = Math.Max(StringUtilities.MeasureString(template.Replace('#', i.ToString()[0]), textBlock).Width, lenght);
|
||||||
|
}
|
||||||
|
dockPanel.Width = lenght;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetCpuUsage()
|
||||||
|
{
|
||||||
|
return $"{(int)cpuCounter.NextValue()}%";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
key.SetValue("CpuUsageWindowTop", Top);
|
||||||
|
key.SetValue("CpuUsageWindowLeft", Left);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
|
{
|
||||||
|
key.SetValue("CpuUsageWindowHeight", Height);
|
||||||
|
key.SetValue("CpuUsageWindowWidth", Width);
|
||||||
|
tileBar.CaptionHeight = ActualHeight - 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using DesktopMagicPluginAPI;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Text;
|
||||||
|
|
||||||
|
namespace DesktopMagic.BuiltInWindowElements
|
||||||
|
{
|
||||||
|
internal class DatePlugin : Plugin
|
||||||
|
{
|
||||||
|
public override int UpdateInterval => 1000;
|
||||||
|
|
||||||
|
private DateTime oldDateTime = new DateTime();
|
||||||
|
private Color oldColor = Color.White;
|
||||||
|
private string oldFont;
|
||||||
|
|
||||||
|
public override Bitmap Main()
|
||||||
|
{
|
||||||
|
if (oldDateTime.Date == DateTime.Now.Date && oldColor == Application.Theme.PrimaryColor && oldFont == Application.Theme.Font)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
oldDateTime = DateTime.Now;
|
||||||
|
oldColor = Application.Theme.PrimaryColor;
|
||||||
|
oldFont = Application.Theme.Font;
|
||||||
|
|
||||||
|
string date = DateTime.Now.ToLongDateString();
|
||||||
|
|
||||||
|
Font font = new Font(Application.Theme.Font, 200);
|
||||||
|
|
||||||
|
Bitmap bmp = new Bitmap(1, 1);
|
||||||
|
bmp.SetResolution(100, 100);
|
||||||
|
using Graphics tmpGr = Graphics.FromImage(bmp);
|
||||||
|
tmpGr.TextRenderingHint = TextRenderingHint.AntiAlias;
|
||||||
|
|
||||||
|
SizeF size = tmpGr.MeasureString(date, font);
|
||||||
|
|
||||||
|
bmp = new Bitmap((int)size.Width, (int)size.Height);
|
||||||
|
bmp.SetResolution(100, 100);
|
||||||
|
|
||||||
|
using Graphics gr = Graphics.FromImage(bmp);
|
||||||
|
|
||||||
|
gr.TextRenderingHint = TextRenderingHint.AntiAlias;
|
||||||
|
gr.DrawString(date, font, new SolidBrush(Application.Theme.PrimaryColor), 0, 0);
|
||||||
|
|
||||||
|
return bmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+53
-143
@@ -1,109 +1,33 @@
|
|||||||
using Microsoft.Win32;
|
using DesktopMagicPluginAPI;
|
||||||
|
|
||||||
using NAudio.Wave;
|
using NAudio.Wave;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Timers;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Interop;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
|
|
||||||
namespace DesktopMagic
|
namespace DesktopMagic.BuiltInWindowElements
|
||||||
{
|
{
|
||||||
public partial class MusicVisualizerWindow : Window
|
internal class MusicVisualizerPlugin : Plugin
|
||||||
{
|
{
|
||||||
[DllImport("user32.dll")]
|
private IWaveIn waveIn;
|
||||||
private static extern void SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
|
|
||||||
|
|
||||||
private readonly RegistryKey key;
|
|
||||||
private readonly IWaveIn waveIn;
|
|
||||||
private const int fftLength = 1024; // NAudio fft wants powers of two!
|
private const int fftLength = 1024; // NAudio fft wants powers of two!
|
||||||
private readonly SampleAggregator sampleAggregator = new SampleAggregator(fftLength);
|
private readonly SampleAggregator sampleAggregator = new SampleAggregator(fftLength);
|
||||||
private volatile bool calculate = true;
|
private volatile bool calculate = true;
|
||||||
|
private Bitmap output = new Bitmap(880, 300);
|
||||||
|
|
||||||
public MusicVisualizerWindow()
|
public override int UpdateInterval => 0;
|
||||||
|
|
||||||
|
public override void Start()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
sampleAggregator.FftCalculated += FftCalculated;
|
||||||
|
|
||||||
Window w = new()
|
|
||||||
{
|
|
||||||
Top = -100,
|
|
||||||
Left = -100,
|
|
||||||
Width = 0,
|
|
||||||
Height = 0,
|
|
||||||
WindowStyle = WindowStyle.ToolWindow,
|
|
||||||
ShowInTaskbar = false
|
|
||||||
};
|
|
||||||
|
|
||||||
w.Show();
|
|
||||||
this.Owner = w;
|
|
||||||
w.Hide();
|
|
||||||
|
|
||||||
sampleAggregator.FftCalculated += new EventHandler<FftEventArgs>(FftCalculated);
|
|
||||||
sampleAggregator.PerformFFT = true;
|
sampleAggregator.PerformFFT = true;
|
||||||
|
|
||||||
waveIn = new WasapiLoopbackCapture();
|
waveIn = new WasapiLoopbackCapture();
|
||||||
|
|
||||||
waveIn.DataAvailable += OnDataAvailable;
|
waveIn.DataAvailable += OnDataAvailable;
|
||||||
waveIn.StartRecording();
|
waveIn.StartRecording();
|
||||||
|
|
||||||
Timer t = new Timer();
|
|
||||||
t.Interval = 100;
|
|
||||||
t.Elapsed += T_Elapsed;
|
|
||||||
t.Start();
|
|
||||||
|
|
||||||
key = Registry.CurrentUser.CreateSubKey(@"Software\" + MainWindow.AppName);
|
|
||||||
|
|
||||||
this.Top = double.Parse(key.GetValue("MusicVisualizerWindowTop", 100).ToString());
|
|
||||||
|
|
||||||
this.Left = double.Parse(key.GetValue("MusicVisualizerWindowLeft", 100).ToString());
|
|
||||||
|
|
||||||
this.Height = double.Parse(key.GetValue("MusicVisualizerWindowHeight", 200).ToString());
|
|
||||||
|
|
||||||
this.Width = double.Parse(key.GetValue("MusicVisualizerWindowWidth", 500).ToString());
|
|
||||||
|
|
||||||
this.IsEnabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnSourceInitialized(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnSourceInitialized(e);
|
|
||||||
|
|
||||||
//Set the window style to noactivate.
|
|
||||||
var helper = new WindowInteropHelper(this);
|
|
||||||
WindowPos.SetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE,
|
|
||||||
WindowPos.GetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE) | WindowPos.WS_EX_NOACTIVATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void T_Elapsed(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
if (MainWindow.EditMode)
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Visible;
|
|
||||||
new WindowPos().SetIsLocked(this, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Collapsed;
|
|
||||||
new WindowPos().SetIsLocked(this, true);
|
|
||||||
}
|
|
||||||
if (!this.IsLoaded)
|
|
||||||
{
|
|
||||||
calculate = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
calculate = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDataAvailable(object sender, WaveInEventArgs e)
|
private void OnDataAvailable(object sender, WaveInEventArgs e)
|
||||||
@@ -126,10 +50,13 @@ namespace DesktopMagic
|
|||||||
|
|
||||||
private void FftCalculated(object sender, FftEventArgs e)
|
private void FftCalculated(object sender, FftEventArgs e)
|
||||||
{
|
{
|
||||||
if (!calculate) return;
|
if (!calculate)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<double> fft = new List<double>();
|
List<double> fft = new List<double>();
|
||||||
for (int i = 0; i < e.Result.Length / 2 - 70; i++)
|
for (int i = 0; i < (e.Result.Length / 2) - 70; i++)
|
||||||
{
|
{
|
||||||
int v = i;
|
int v = i;
|
||||||
if (v < 20)
|
if (v < 20)
|
||||||
@@ -137,7 +64,7 @@ namespace DesktopMagic
|
|||||||
v = 20;
|
v = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiplier = 100 - MainWindow.AmplifierLevel * 2;
|
int multiplier = 100 - (MainWindow.AmplifierLevel * 2);
|
||||||
multiplier = multiplier == 0 ? 1 : multiplier;
|
multiplier = multiplier == 0 ? 1 : multiplier;
|
||||||
fft.Add(Math.Abs(e.Result[i].Y * v / multiplier));
|
fft.Add(Math.Abs(e.Result[i].Y * v / multiplier));
|
||||||
}
|
}
|
||||||
@@ -168,7 +95,7 @@ namespace DesktopMagic
|
|||||||
{
|
{
|
||||||
double temp = 0;
|
double temp = 0;
|
||||||
int j;
|
int j;
|
||||||
for (j = i * count; j < count + i * count; j++)
|
for (j = i * count; j < count + (i * count); j++)
|
||||||
{
|
{
|
||||||
temp += fft[j];
|
temp += fft[j];
|
||||||
}
|
}
|
||||||
@@ -193,7 +120,9 @@ namespace DesktopMagic
|
|||||||
for (int j = 0; j < flattenValue; j++)
|
for (int j = 0; j < flattenValue; j++)
|
||||||
{
|
{
|
||||||
if (i + j < scaledFft.Count)
|
if (i + j < scaledFft.Count)
|
||||||
|
{
|
||||||
temp += scaledFft[i + j];
|
temp += scaledFft[i + j];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
scaledFft[i] = temp / flattenValue;
|
scaledFft[i] = temp / flattenValue;
|
||||||
}
|
}
|
||||||
@@ -207,7 +136,9 @@ namespace DesktopMagic
|
|||||||
for (int j = 0; j < flattenValue; j++)
|
for (int j = 0; j < flattenValue; j++)
|
||||||
{
|
{
|
||||||
if (i - j >= 0)
|
if (i - j >= 0)
|
||||||
|
{
|
||||||
temp += scaledFft[i - j];
|
temp += scaledFft[i - j];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
scaledFft[i] = temp / flattenValue;
|
scaledFft[i] = temp / flattenValue;
|
||||||
}
|
}
|
||||||
@@ -218,20 +149,21 @@ namespace DesktopMagic
|
|||||||
lastFft = fft;
|
lastFft = fft;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Stopwatch sw = new Stopwatch();
|
|
||||||
sw.Start();
|
|
||||||
Bitmap bm = new Bitmap(885, 300);
|
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
if (!MainWindow.MirrorMode && MainWindow.SpectrumMode != 1)
|
if (!MainWindow.MirrorMode && MainWindow.SpectrumMode != 1)
|
||||||
|
{
|
||||||
scaledFft.Insert(0, 0);
|
scaledFft.Insert(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (!MainWindow.LineMode)
|
if (!MainWindow.LineMode)
|
||||||
offset = 1;
|
|
||||||
|
|
||||||
using (Graphics gr = Graphics.FromImage(bm))
|
|
||||||
{
|
{
|
||||||
gr.SmoothingMode = SmoothingMode.None;
|
offset = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (Graphics gr = Graphics.FromImage(output))
|
||||||
|
{
|
||||||
|
gr.Clear(Color.Transparent);
|
||||||
PointF[] points = new PointF[scaledFft.Count + 2];
|
PointF[] points = new PointF[scaledFft.Count + 2];
|
||||||
|
|
||||||
int fftIndex = 0;
|
int fftIndex = 0;
|
||||||
@@ -251,13 +183,18 @@ namespace DesktopMagic
|
|||||||
|
|
||||||
if (!fftIndexReverse)
|
if (!fftIndexReverse)
|
||||||
{
|
{
|
||||||
points[pointIndex + 1] = new PointF(bm.Width - 4 * pointIndex, bm.Height / 2 + value);
|
points[pointIndex + 1] = new PointF(output.Width - (4 * pointIndex), (output.Height / 2) + value);
|
||||||
points[points.Length / 2 + pointIndex + 1] = new PointF(bm.Width - 4 * pointIndex, bm.Height / 2 - value);
|
points[(points.Length / 2) + pointIndex + 1] = new PointF(output.Width - (4 * pointIndex), (output.Height / 2) - value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: points[pointIndex + 1] = new PointF(2 * pointIndex, value); break;
|
case 2:
|
||||||
default: points[pointIndex + 1] = new PointF(2 * pointIndex, bm.Height - value - 1 + offset); break;
|
points[pointIndex + 1] = new PointF(2 * pointIndex, value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
points[pointIndex + 1] = new PointF(2 * pointIndex, output.Height - value - 1 + offset);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MainWindow.MirrorMode || MainWindow.SpectrumMode == 1)
|
if (MainWindow.MirrorMode || MainWindow.SpectrumMode == 1)
|
||||||
@@ -278,17 +215,11 @@ namespace DesktopMagic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetPoints(points, bm.Width, bm.Height, offset);
|
SetPoints(points, output.Width, output.Height, offset);
|
||||||
|
|
||||||
Brush brush;
|
Brush brush = MainWindow.MusicVisualzerColor.HasValue
|
||||||
if (MainWindow.MusicVisualzerColor == null)
|
? new SolidBrush(MainWindow.MusicVisualzerColor.Value)
|
||||||
{
|
: new SolidBrush(MainWindow.Theme.PrimaryColor);
|
||||||
brush = MainWindow.GlobalSystemColor;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
brush = MainWindow.MusicVisualzerColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MainWindow.LineMode)
|
if (MainWindow.LineMode)
|
||||||
{
|
{
|
||||||
@@ -308,10 +239,7 @@ namespace DesktopMagic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Dispatcher.BeginInvoke((Action)delegate
|
Application.UpdateWindow();
|
||||||
{
|
|
||||||
image.Source = BitmapToImageSource(bm);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
@@ -322,51 +250,33 @@ namespace DesktopMagic
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
points[0] = new PointF(width, height / 2);
|
points[0] = new PointF(width, height / 2);
|
||||||
points[points.Length - 1] = new PointF(0, height / 2);
|
points[^1] = new PointF(0, height / 2);
|
||||||
|
|
||||||
points[points.Length / 2] = new PointF(width, height / 2);
|
points[points.Length / 2] = new PointF(width, height / 2);
|
||||||
points[points.Length / 2 - 1] = new PointF(0, height / 2);
|
points[(points.Length / 2) - 1] = new PointF(0, height / 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
points[0] = new PointF(0, 0 - offset);
|
points[0] = new PointF(0, 0 - offset);
|
||||||
points[points.Length - 1] = new PointF(points[points.Length - 2].X, 0 - offset);
|
points[^1] = new PointF(points[^2].X, 0 - offset);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
points[0] = new PointF(0, height);
|
points[0] = new PointF(0, height);
|
||||||
points[points.Length - 1] = new PointF(points[points.Length - 2].X, height);
|
points[^1] = new PointF(points[^2].X, height);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private BitmapSource BitmapToImageSource(Bitmap bitmap)
|
public override Bitmap Main()
|
||||||
{
|
{
|
||||||
BitmapData bitmapData = bitmap.LockBits(
|
return output;
|
||||||
new Rectangle(0, 0, bitmap.Width, bitmap.Height),
|
|
||||||
ImageLockMode.ReadOnly, bitmap.PixelFormat);
|
|
||||||
|
|
||||||
BitmapSource bitmapSource = BitmapSource.Create(
|
|
||||||
bitmapData.Width, bitmapData.Height,
|
|
||||||
bitmap.HorizontalResolution, bitmap.VerticalResolution,
|
|
||||||
System.Windows.Media.PixelFormats.Bgra32, null,
|
|
||||||
bitmapData.Scan0, bitmapData.Stride * bitmapData.Height, bitmapData.Stride);
|
|
||||||
|
|
||||||
bitmap.UnlockBits(bitmapData);
|
|
||||||
return bitmapSource;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
public override void Stop()
|
||||||
{
|
{
|
||||||
key.SetValue("MusicVisualizerWindowTop", this.Top);
|
calculate = false;
|
||||||
key.SetValue("MusicVisualizerWindowLeft", this.Left);
|
waveIn?.StopRecording();
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue("MusicVisualizerWindowHeight", this.Height);
|
|
||||||
key.SetValue("MusicVisualizerWindowWidth", this.Width);
|
|
||||||
tileBar.CaptionHeight = this.ActualHeight - 10;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
using DesktopMagicPluginAPI;
|
||||||
|
using DesktopMagicPluginAPI.Drawing;
|
||||||
|
using DesktopMagicPluginAPI.Inputs;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Text;
|
||||||
|
|
||||||
|
namespace DesktopMagic.BuiltInWindowElements
|
||||||
|
{
|
||||||
|
internal class TimePlugin : Plugin
|
||||||
|
{
|
||||||
|
[Element("Display Seconds:")]
|
||||||
|
private CheckBox checkBox = new CheckBox(true);
|
||||||
|
|
||||||
|
public override int UpdateInterval => 1000;
|
||||||
|
|
||||||
|
public override Bitmap Main()
|
||||||
|
{
|
||||||
|
string time = checkBox.Value ? DateTime.Now.ToLongTimeString() : DateTime.Now.ToShortTimeString();
|
||||||
|
|
||||||
|
Font font = new Font(Application.Theme.Font, 200);
|
||||||
|
|
||||||
|
Bitmap bmp = new Bitmap(1, 1);
|
||||||
|
using Graphics tmpGr = Graphics.FromImage(bmp);
|
||||||
|
tmpGr.TextRenderingHint = TextRenderingHint.AntiAlias;
|
||||||
|
|
||||||
|
SizeF size = CalculateSize(tmpGr, font);
|
||||||
|
|
||||||
|
bmp = new Bitmap((int)size.Width, (int)size.Height);
|
||||||
|
bmp.SetResolution(100, 100);
|
||||||
|
|
||||||
|
using Graphics gr = Graphics.FromImage(bmp);
|
||||||
|
|
||||||
|
gr.TextRenderingHint = TextRenderingHint.AntiAlias;
|
||||||
|
gr.DrawStringNoLeftPadding(time, font, new SolidBrush(Application.Theme.PrimaryColor), 0, 0);
|
||||||
|
|
||||||
|
return bmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private SizeF CalculateSize(Graphics graphics, Font font)
|
||||||
|
{
|
||||||
|
string template = checkBox.Value ? "##:##:##" : "##:##";
|
||||||
|
SizeF size = new SizeF();
|
||||||
|
for (int i = 0; i < 9; i++)
|
||||||
|
{
|
||||||
|
SizeF newSize = graphics.MeasureStringNoLeftPadding(template.Replace("#", i.ToString()), font);
|
||||||
|
|
||||||
|
size.Width = Math.Max(size.Width, newSize.Width);
|
||||||
|
size.Height = Math.Max(size.Height, newSize.Height);
|
||||||
|
}
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
using Google.Apis.Auth.OAuth2;
|
|
||||||
using Google.Apis.Calendar.v3;
|
|
||||||
using Google.Apis.Calendar.v3.Data;
|
|
||||||
using Google.Apis.Services;
|
|
||||||
using Google.Apis.Util.Store;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Threading;
|
|
||||||
|
|
||||||
namespace DesktopMagic
|
|
||||||
{
|
|
||||||
internal class CalendarManagment
|
|
||||||
{
|
|
||||||
private static string[] Scopes = { CalendarService.Scope.CalendarReadonly };
|
|
||||||
|
|
||||||
private static string ApplicationName = "Google Calendar API .NET " + MainWindow.AppName;
|
|
||||||
|
|
||||||
public (List<string>, List<string>) GetEvents()
|
|
||||||
{
|
|
||||||
List<string> upcomingEventNames = new List<string>();
|
|
||||||
List<string> upcomingEventTimes = new List<string>();
|
|
||||||
UserCredential credential;
|
|
||||||
Console.WriteLine("1");
|
|
||||||
|
|
||||||
if (!File.Exists("credentials.json"))
|
|
||||||
return (new(), new());
|
|
||||||
using (var stream =
|
|
||||||
new FileStream("credentials.json", FileMode.Open, FileAccess.Read))
|
|
||||||
{
|
|
||||||
Console.WriteLine("2");
|
|
||||||
// The file token.json stores the user's access and refresh tokens, and is created
|
|
||||||
// automatically when the authorization flow completes for the first time.
|
|
||||||
string credPath = "token.json";
|
|
||||||
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
|
|
||||||
GoogleClientSecrets.Load(stream).Secrets,
|
|
||||||
Scopes,
|
|
||||||
"user",
|
|
||||||
CancellationToken.None,
|
|
||||||
new FileDataStore(credPath, true)).Result;
|
|
||||||
Console.WriteLine("Credential file saved to: " + credPath);
|
|
||||||
}
|
|
||||||
Console.WriteLine("3");
|
|
||||||
|
|
||||||
// Create Google Calendar API service.
|
|
||||||
var service = new CalendarService(new BaseClientService.Initializer()
|
|
||||||
{
|
|
||||||
HttpClientInitializer = credential,
|
|
||||||
ApplicationName = ApplicationName,
|
|
||||||
});
|
|
||||||
|
|
||||||
Console.WriteLine("4");
|
|
||||||
|
|
||||||
// Define parameters of request.
|
|
||||||
EventsResource.ListRequest request = service.Events.List("primary");
|
|
||||||
request.TimeMin = DateTime.Now;
|
|
||||||
request.ShowDeleted = false;
|
|
||||||
request.SingleEvents = true;
|
|
||||||
request.MaxResults = 10;
|
|
||||||
request.OrderBy = EventsResource.ListRequest.OrderByEnum.StartTime;
|
|
||||||
|
|
||||||
Console.WriteLine("5");
|
|
||||||
// List events.
|
|
||||||
Events events = request.Execute();
|
|
||||||
Console.WriteLine("6");
|
|
||||||
Console.WriteLine("Upcoming events:");
|
|
||||||
if (events.Items != null && events.Items.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (var eventItem in events.Items)
|
|
||||||
{
|
|
||||||
if (upcomingEventNames.Count < 10)
|
|
||||||
{
|
|
||||||
string when = eventItem.Start.DateTime.ToString();
|
|
||||||
if (string.IsNullOrEmpty(when))
|
|
||||||
{
|
|
||||||
when = eventItem.Start.Date;
|
|
||||||
}
|
|
||||||
upcomingEventNames.Add(eventItem.Summary);
|
|
||||||
upcomingEventTimes.Add(when);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Console.WriteLine("7");
|
|
||||||
return (upcomingEventNames, upcomingEventTimes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class CalendarItems
|
|
||||||
{
|
|
||||||
public string eventname { get; set; }
|
|
||||||
public string dateTime { get; set; }
|
|
||||||
public string font { get; set; }
|
|
||||||
public string color { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<Window x:Class="DesktopMagic.CalendarWindow"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="CalendarWindow" Height="450" Width="800"
|
|
||||||
Background="Transparent"
|
|
||||||
WindowStyle="None"
|
|
||||||
AllowsTransparency="True"
|
|
||||||
LocationChanged="Window_LocationChanged"
|
|
||||||
SizeChanged="Window_SizeChanged"
|
|
||||||
x:Name="window">
|
|
||||||
<Grid>
|
|
||||||
<Rectangle x:Name="panel" Fill="#4CBAFFEF" Stroke="White" Margin="0,0,0,0" Visibility="Collapsed" />
|
|
||||||
<Viewbox StretchDirection="Both" Stretch="Uniform">
|
|
||||||
<ListView x:Name="listBox" Height="Auto" Width="Auto" Background="Transparent" BorderBrush="Transparent" FontSize="999" Foreground="White">
|
|
||||||
<ListView.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition />
|
|
||||||
<ColumnDefinition />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{Binding eventname}" FontSize="10" FontFamily="{Binding font}" Foreground="{Binding color}" Margin="0,0" />
|
|
||||||
<TextBlock Text="{Binding dateTime}" FontSize="7" FontFamily="{Binding font}" Foreground="Gray" Margin="0,-3" />
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</ListView.ItemTemplate>
|
|
||||||
</ListView>
|
|
||||||
</Viewbox>
|
|
||||||
</Grid>
|
|
||||||
<WindowChrome.WindowChrome>
|
|
||||||
<WindowChrome x:Name="tileBar" CaptionHeight="3000" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
|
|
||||||
</WindowChrome.WindowChrome>
|
|
||||||
</Window>
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Timers;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Interop;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace DesktopMagic
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaktionslogik für TimeWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class CalendarWindow : Window
|
|
||||||
{
|
|
||||||
private RegistryKey key;
|
|
||||||
private string oldFont = "";
|
|
||||||
private Brush oldColor;
|
|
||||||
private List<string> upcomingEventNames = new List<string>();
|
|
||||||
private List<string> upcomingEventTimes = new List<string>();
|
|
||||||
|
|
||||||
public CalendarWindow()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
Window w = new Window();
|
|
||||||
w.Top = -100;
|
|
||||||
w.Left = -100;
|
|
||||||
w.Width = 0;
|
|
||||||
w.Height = 0;
|
|
||||||
|
|
||||||
w.WindowStyle = WindowStyle.ToolWindow;
|
|
||||||
w.ShowInTaskbar = false;
|
|
||||||
w.Show();
|
|
||||||
this.Owner = w;
|
|
||||||
w.Hide();
|
|
||||||
|
|
||||||
Timer t = new Timer();
|
|
||||||
t.Interval = 100;
|
|
||||||
t.Elapsed += T_Elapsed;
|
|
||||||
t.Start();
|
|
||||||
|
|
||||||
Timer valueTimer = new Timer();
|
|
||||||
valueTimer.Interval = 600000;
|
|
||||||
valueTimer.Elapsed += ValueTimer_Elapsed; ;
|
|
||||||
valueTimer.Start();
|
|
||||||
|
|
||||||
key = Registry.CurrentUser.CreateSubKey(@"Software\" + MainWindow.AppName);
|
|
||||||
this.Top = double.Parse(key.GetValue("CalendarWindowTop", 100).ToString());
|
|
||||||
this.Left = double.Parse(key.GetValue("CalendarWindowLeft", 100).ToString());
|
|
||||||
this.Height = double.Parse(key.GetValue("CalendarWindowHeight", 200).ToString());
|
|
||||||
this.Width = double.Parse(key.GetValue("CalendarWindowWidth", 500).ToString());
|
|
||||||
//this.IsEnabled = false;
|
|
||||||
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
(upcomingEventNames, upcomingEventTimes) = new CalendarManagment().GetEvents();
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
LoadEvents();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnSourceInitialized(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnSourceInitialized(e);
|
|
||||||
|
|
||||||
//Set the window style to noactivate.
|
|
||||||
var helper = new WindowInteropHelper(this);
|
|
||||||
WindowPos.SetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE,
|
|
||||||
WindowPos.GetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE) | WindowPos.WS_EX_NOACTIVATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ValueTimer_Elapsed(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
(upcomingEventNames, upcomingEventTimes) = new CalendarManagment().GetEvents();
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
LoadEvents();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void T_Elapsed(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
if (MainWindow.EditMode)
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Visible;
|
|
||||||
new WindowPos().SetIsLocked(this, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Collapsed;
|
|
||||||
new WindowPos().SetIsLocked(this, true);
|
|
||||||
}
|
|
||||||
if (MainWindow.GlobalFont != oldFont || MainWindow.GlobalColor != oldColor)
|
|
||||||
{
|
|
||||||
oldColor = MainWindow.GlobalColor;
|
|
||||||
oldFont = MainWindow.GlobalFont;
|
|
||||||
LoadEvents();
|
|
||||||
}
|
|
||||||
listBox.SelectedIndex = -1;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadEvents()
|
|
||||||
{
|
|
||||||
listBox.Items.Clear();
|
|
||||||
CalendarItems calendarItem = new CalendarItems();
|
|
||||||
calendarItem.eventname = "Termine: ";
|
|
||||||
calendarItem.font = MainWindow.GlobalFont;
|
|
||||||
calendarItem.color = MainWindow.GlobalColor.ToString();
|
|
||||||
listBox.Items.Add(calendarItem);
|
|
||||||
|
|
||||||
for (int i = 0; i < upcomingEventNames.Count; i++)
|
|
||||||
{
|
|
||||||
DateTime dateTime = DateTime.Now;
|
|
||||||
DateTime.TryParse(upcomingEventTimes[i], out dateTime);
|
|
||||||
|
|
||||||
calendarItem = new CalendarItems();
|
|
||||||
calendarItem.eventname = upcomingEventNames[i];
|
|
||||||
calendarItem.dateTime = dateTime.ToString("dd-MM-yyyy");
|
|
||||||
calendarItem.font = MainWindow.GlobalFont;
|
|
||||||
calendarItem.color = MainWindow.GlobalColor.ToString();
|
|
||||||
|
|
||||||
if (dateTime < DateTime.Today.AddMonths(12) || upcomingEventTimes[i] == "-")
|
|
||||||
{
|
|
||||||
listBox.Items.Add(calendarItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (listBox.Items.Count < 10)
|
|
||||||
{
|
|
||||||
listBox.Items.Add("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue("CalendarWindowTop", this.Top);
|
|
||||||
key.SetValue("CalendarWindowLeft", this.Left);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue("CalendarWindowHeight", this.Height);
|
|
||||||
key.SetValue("CalendarWindowWidth", this.Width);
|
|
||||||
tileBar.CaptionHeight = this.ActualHeight - 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Timers;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Interop;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace DesktopMagic
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaktionslogik für TimeWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class CpuUsageWindow : Window
|
|
||||||
{
|
|
||||||
private RegistryKey key;
|
|
||||||
private PerformanceCounter cpuCounter = new PerformanceCounter();
|
|
||||||
|
|
||||||
public CpuUsageWindow()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
Window w = new()
|
|
||||||
{
|
|
||||||
Top = -100,
|
|
||||||
Left = -100,
|
|
||||||
Width = 0,
|
|
||||||
Height = 0,
|
|
||||||
|
|
||||||
WindowStyle = WindowStyle.ToolWindow,
|
|
||||||
ShowInTaskbar = false
|
|
||||||
};
|
|
||||||
w.Show();
|
|
||||||
this.Owner = w;
|
|
||||||
w.Hide();
|
|
||||||
|
|
||||||
cpuCounter.CategoryName = "Processor";
|
|
||||||
cpuCounter.CounterName = "% Processor Time";
|
|
||||||
cpuCounter.InstanceName = "_Total";
|
|
||||||
|
|
||||||
Timer t = new Timer();
|
|
||||||
t.Interval = 100;
|
|
||||||
t.Elapsed += T_Elapsed;
|
|
||||||
t.Start();
|
|
||||||
|
|
||||||
Timer valueTimer = new Timer();
|
|
||||||
valueTimer.Interval = 1000;
|
|
||||||
valueTimer.Elapsed += ValueTimer_Elapsed; ;
|
|
||||||
valueTimer.Start();
|
|
||||||
|
|
||||||
key = Registry.CurrentUser.CreateSubKey(@"Software\" + MainWindow.AppName);
|
|
||||||
this.Top = double.Parse(key.GetValue("CpuUsageWindowTop", 100).ToString());
|
|
||||||
this.Left = double.Parse(key.GetValue("CpuUsageWindowLeft", 100).ToString());
|
|
||||||
this.Height = double.Parse(key.GetValue("CpuUsageWindowHeight", 200).ToString());
|
|
||||||
this.Width = double.Parse(key.GetValue("CpuUsageWindowWidth", 500).ToString());
|
|
||||||
this.IsEnabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnSourceInitialized(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnSourceInitialized(e);
|
|
||||||
|
|
||||||
//Set the window style to noactivate.
|
|
||||||
var helper = new WindowInteropHelper(this);
|
|
||||||
WindowPos.SetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE,
|
|
||||||
WindowPos.GetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE) | WindowPos.WS_EX_NOACTIVATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void T_Elapsed(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
if (MainWindow.EditMode)
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Visible;
|
|
||||||
new WindowPos().SetIsLocked(this, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Collapsed;
|
|
||||||
new WindowPos().SetIsLocked(this, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
textBlock.FontFamily = new FontFamily(MainWindow.GlobalFont);
|
|
||||||
textBlock.Foreground = MainWindow.GlobalColor;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ValueTimer_Elapsed(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
textBlock.Text = GetCpuUsage();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetCpuUsage()
|
|
||||||
{
|
|
||||||
return "CPU: " + ((int)cpuCounter.NextValue()).ToString().PadLeft(3, '0') + "%";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue("CpuUsageWindowTop", this.Top);
|
|
||||||
key.SetValue("CpuUsageWindowLeft", this.Left);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue("CpuUsageWindowHeight", this.Height);
|
|
||||||
key.SetValue("CpuUsageWindowWidth", this.Width);
|
|
||||||
tileBar.CaptionHeight = this.ActualHeight - 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<Window x:Class="DesktopMagic.DateWindow"
|
|
||||||
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"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="DateWindow" Height="450" Width="800"
|
|
||||||
Background="Transparent"
|
|
||||||
WindowStyle="None"
|
|
||||||
AllowsTransparency="True"
|
|
||||||
LocationChanged="Window_LocationChanged"
|
|
||||||
SizeChanged="Window_SizeChanged"
|
|
||||||
x:Name="window">
|
|
||||||
<Grid>
|
|
||||||
<Rectangle x:Name="panel" Fill="#4CBAFFEF" Stroke="White" Margin="0,0,0,0" Visibility="Collapsed" />
|
|
||||||
<Viewbox StretchDirection="DownOnly" Stretch="Uniform">
|
|
||||||
<TextBlock x:Name="textBlock" FontSize="999" Foreground="White" Text=" " IsHitTestVisible="False" />
|
|
||||||
</Viewbox>
|
|
||||||
</Grid>
|
|
||||||
<WindowChrome.WindowChrome>
|
|
||||||
<WindowChrome x:Name="tileBar" CaptionHeight="3000" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
|
|
||||||
</WindowChrome.WindowChrome>
|
|
||||||
</Window>
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
using System.Timers;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Interop;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace DesktopMagic
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaktionslogik für TimeWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class DateWindow : Window
|
|
||||||
{
|
|
||||||
private RegistryKey key;
|
|
||||||
|
|
||||||
public DateWindow()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
Window w = new Window();
|
|
||||||
w.Top = -100;
|
|
||||||
w.Left = -100;
|
|
||||||
w.Width = 0;
|
|
||||||
w.Height = 0;
|
|
||||||
|
|
||||||
w.WindowStyle = WindowStyle.ToolWindow;
|
|
||||||
w.ShowInTaskbar = false;
|
|
||||||
w.Show();
|
|
||||||
this.Owner = w;
|
|
||||||
w.Hide();
|
|
||||||
|
|
||||||
Timer t = new Timer();
|
|
||||||
t.Interval = 100;
|
|
||||||
t.Elapsed += T_Elapsed;
|
|
||||||
t.Start();
|
|
||||||
|
|
||||||
key = Registry.CurrentUser.CreateSubKey(@"Software\" + MainWindow.AppName);
|
|
||||||
this.Top = double.Parse(key.GetValue("DateWindowTop", 100).ToString());
|
|
||||||
this.Left = double.Parse(key.GetValue("DateWindowLeft", 100).ToString());
|
|
||||||
this.Height = double.Parse(key.GetValue("DateWindowHeight", 200).ToString());
|
|
||||||
this.Width = double.Parse(key.GetValue("DateWindowWidth", 500).ToString());
|
|
||||||
this.IsEnabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnSourceInitialized(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnSourceInitialized(e);
|
|
||||||
|
|
||||||
//Set the window style to noactivate.
|
|
||||||
var helper = new WindowInteropHelper(this);
|
|
||||||
WindowPos.SetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE,
|
|
||||||
WindowPos.GetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE) | WindowPos.WS_EX_NOACTIVATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void T_Elapsed(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
if (MainWindow.EditMode)
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Visible;
|
|
||||||
new WindowPos().SetIsLocked(this, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Collapsed;
|
|
||||||
new WindowPos().SetIsLocked(this, true);
|
|
||||||
}
|
|
||||||
textBlock.FontFamily = new FontFamily(MainWindow.GlobalFont);
|
|
||||||
textBlock.Foreground = MainWindow.GlobalColor;
|
|
||||||
textBlock.Text = DateTime.Now.ToString("D");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue("DateWindowTop", this.Top);
|
|
||||||
key.SetValue("DateWindowLeft", this.Left);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue("DateWindowHeight", this.Height);
|
|
||||||
key.SetValue("DateWindowWidth", this.Width);
|
|
||||||
tileBar.CaptionHeight = this.ActualHeight - 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,25 +2,36 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net5.0-windows</TargetFramework>
|
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<RootNamespace>DesktopMagic</RootNamespace>
|
<RootNamespace>DesktopMagic</RootNamespace>
|
||||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||||
|
<Authors>Stone_Red</Authors>
|
||||||
|
<Version>0.0.3.2</Version>
|
||||||
|
<PackageProjectUrl>https://github.com/Stone-Red-Code/DesktopMagic</PackageProjectUrl>
|
||||||
|
<RepositoryUrl>https://github.com/Stone-Red-Code/DesktopMagic</RepositoryUrl>
|
||||||
|
<AssemblyVersion>0.0.3.2</AssemblyVersion>
|
||||||
|
<FileVersion>0.0.3.2</FileVersion>
|
||||||
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="icon.ico" />
|
<None Remove="icon.ico" />
|
||||||
<None Remove="icons8_volunteering_26_85L_icon.ico" />
|
<None Remove="icons8_volunteering_26_85L_icon.ico" />
|
||||||
|
<None Remove="icon_Dark.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AlwaysUpToDate" Version="1.0.0.4" />
|
||||||
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.1.0" />
|
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.1.0" />
|
||||||
<PackageReference Include="Google.Apis.Calendar.v3" Version="1.51.0.2312" />
|
<PackageReference Include="Google.Apis.Calendar.v3" Version="1.55.0.2410" />
|
||||||
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" />
|
|
||||||
<PackageReference Include="MaterialDesignThemes" Version="4.0.0" />
|
<PackageReference Include="MaterialDesignThemes" Version="4.0.0" />
|
||||||
<PackageReference Include="NAudio" Version="2.0.0" />
|
<PackageReference Include="NAudio" Version="2.0.1" />
|
||||||
<PackageReference Include="Stone_Red-C-Sharp-Utilities" Version="1.0.2.1" />
|
<PackageReference Include="Stone_Red-C-Sharp-Utilities" Version="1.0.3.1" />
|
||||||
<PackageReference Include="System.Management" Version="5.0.0" />
|
<PackageReference Include="System.Management" Version="5.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
@@ -29,6 +40,11 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="icon.ico" />
|
<Resource Include="icon_Dark.ico">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Resource>
|
||||||
|
<Resource Include="icon.ico">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Resource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<_LastSelectedProfileId>C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagic\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ApplicationDefinition Update="App.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</ApplicationDefinition>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Page Update="CalendarWindow.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="CpuUsageWindow.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="DateWindow.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="InputDialog.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="MainWindow.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Plugin\PluginWindow.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="MusicVisualizerWindow.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Resources\StringResources.de.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Resources\StringResources.en.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="TimeWindow.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<Window x:Class="DesktopMagic.Dialogs.ColorDialog"
|
||||||
|
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
|
xmlns:local="clr-namespace:DesktopMagic.Dialogs"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
ResizeMode="NoResize"
|
||||||
|
Title="ColorDialog"
|
||||||
|
SizeToContent="WidthAndHeight">
|
||||||
|
<Grid>
|
||||||
|
<StackPanel Margin="15">
|
||||||
|
<Label x:Name="label" Content="Label" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||||
|
|
||||||
|
<DockPanel>
|
||||||
|
<Label Content="A:" Width="20" />
|
||||||
|
<Slider x:Name="alphaSlider" VerticalAlignment="Center" Maximum="255" ValueChanged="ColorSliders_ValueChanged" TickFrequency="1" IsSnapToTickEnabled="True" Background="#00030000" />
|
||||||
|
</DockPanel>
|
||||||
|
<DockPanel>
|
||||||
|
<Label Content="R:" Width="20" />
|
||||||
|
<Slider x:Name="redSlider" VerticalAlignment="Center" Maximum="255" ValueChanged="ColorSliders_ValueChanged" TickFrequency="1" IsSnapToTickEnabled="True" Background="#00030000" />
|
||||||
|
</DockPanel>
|
||||||
|
<DockPanel>
|
||||||
|
<Label Content="G:" Width="20" />
|
||||||
|
<Slider x:Name="greenSlider" VerticalAlignment="Center" Maximum="255" ValueChanged="ColorSliders_ValueChanged" TickFrequency="1" IsSnapToTickEnabled="True" Background="#0000FF00" />
|
||||||
|
</DockPanel>
|
||||||
|
<DockPanel>
|
||||||
|
<Label Content="B:" Width="20" />
|
||||||
|
<Slider x:Name="blueSlider" VerticalAlignment="Center" Maximum="255" ValueChanged="ColorSliders_ValueChanged" TickFrequency="1" IsSnapToTickEnabled="True" Background="#000000FF" />
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
||||||
|
<Rectangle x:Name="colorRechtangle" Fill="White" />
|
||||||
|
</Border>
|
||||||
|
<TextBox x:Name="colorHexTextBox" MaxLength="9" CharacterCasing="Upper" Height="23" TextWrapping="Wrap" Width="350" TextChanged="ColorHexTextBox_TextChanged" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center">
|
||||||
|
<materialDesign:TextFieldAssist.CharacterCounterStyle>
|
||||||
|
<Style TargetType="TextBlock" />
|
||||||
|
</materialDesign:TextFieldAssist.CharacterCounterStyle>
|
||||||
|
</TextBox>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
|
||||||
|
<Button x:Name="okButton" Content="{DynamicResource ok }" HorizontalAlignment="Left" Margin="0,0,10,0" VerticalAlignment="Top" Width="100" Click="OkButton_Click" Cursor="Hand"/>
|
||||||
|
<Button x:Name="cancelButton" Content="{DynamicResource cancel }" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Width="100" Click="CancelButton_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
using DesktopMagic.Helpers;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace DesktopMagic.Dialogs
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for ColorDialog.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class ColorDialog : Window
|
||||||
|
{
|
||||||
|
public ColorDialog(string content, System.Drawing.Color defaultColor, string title = "ColorDialog")
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
label.Content = content;
|
||||||
|
Title = title;
|
||||||
|
SetLanguageDictionary();
|
||||||
|
|
||||||
|
alphaSlider.Value = defaultColor.A;
|
||||||
|
redSlider.Value = defaultColor.R;
|
||||||
|
greenSlider.Value = defaultColor.G;
|
||||||
|
blueSlider.Value = defaultColor.B;
|
||||||
|
}
|
||||||
|
|
||||||
|
public System.Drawing.Color ResultColor { get; private set; }
|
||||||
|
|
||||||
|
public Brush ResultBrush { get; private set; }
|
||||||
|
|
||||||
|
private void OkButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
DialogResult = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
DialogResult = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ColorSliders_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||||
|
{
|
||||||
|
colorHexTextBox.Select(colorHexTextBox.Text.Length, 0);
|
||||||
|
SetColorText();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ColorHexTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (colorHexTextBox.Text.Length > 0)
|
||||||
|
{
|
||||||
|
if (colorHexTextBox.Text.ToCharArray()[0] != '#')
|
||||||
|
{
|
||||||
|
colorHexTextBox.Text = "#" + colorHexTextBox.Text.Replace("#", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colorHexTextBox.Text = "#";
|
||||||
|
colorHexTextBox.Select(colorHexTextBox.Text.Length, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (colorHexTextBox.SelectionStart == 0)
|
||||||
|
{
|
||||||
|
if (colorHexTextBox.Text.Length <= 2)
|
||||||
|
{
|
||||||
|
colorHexTextBox.Select(colorHexTextBox.Text.Length, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colorHexTextBox.Select(1, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string hex = colorHexTextBox.Text;
|
||||||
|
|
||||||
|
if (MultiColorConverter.TryConvertToMediaColor(hex, out Color color) && MultiColorConverter.TryConvertToSystemColor(hex, out System.Drawing.Color systemColor))
|
||||||
|
{
|
||||||
|
alphaSlider.Value = color.A;
|
||||||
|
redSlider.Value = color.R;
|
||||||
|
greenSlider.Value = color.G;
|
||||||
|
blueSlider.Value = color.B;
|
||||||
|
|
||||||
|
Brush brush = new SolidColorBrush(color);
|
||||||
|
|
||||||
|
ResultBrush = brush;
|
||||||
|
ResultColor = systemColor;
|
||||||
|
colorRechtangle.Fill = brush;
|
||||||
|
colorHexTextBox.Foreground = Brushes.Black;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colorHexTextBox.Foreground = Brushes.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetColorText()
|
||||||
|
{
|
||||||
|
if (alphaSlider.Value == 255)
|
||||||
|
{
|
||||||
|
colorHexTextBox.Text = "#";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colorHexTextBox.Text = "#" + ((int)alphaSlider.Value).ToString("X2");
|
||||||
|
}
|
||||||
|
|
||||||
|
colorHexTextBox.Text += ((int)redSlider.Value).ToString("X2") + ((int)greenSlider.Value).ToString("X2") + ((int)blueSlider.Value).ToString("X2");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetLanguageDictionary()
|
||||||
|
{
|
||||||
|
ResourceDictionary dict = new ResourceDictionary();
|
||||||
|
string currentCulture = Thread.CurrentThread.CurrentCulture.ToString();
|
||||||
|
|
||||||
|
if (currentCulture.Contains("de"))
|
||||||
|
{
|
||||||
|
dict.Source = new Uri("..\\Resources\\StringResources.de.xaml", UriKind.Relative);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dict.Source = new Uri("..\\Resources\\StringResources.en.xaml", UriKind.Relative);
|
||||||
|
}
|
||||||
|
Resources.MergedDictionaries.Add(dict);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,17 @@
|
|||||||
<Window x:Class="DesktopMagic.InputDialog"
|
<Window x:Class="DesktopMagic.Dialogs.InputDialog"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:DesktopMagic"
|
xmlns:local="clr-namespace:DesktopMagic.Dialogs"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="InputDialog" Height="152.812" Width="322.812"
|
Title="InputDialog"
|
||||||
ResizeMode="NoResize">
|
ResizeMode="NoResize"
|
||||||
|
SizeToContent="WidthAndHeight">
|
||||||
<Grid>
|
<Grid>
|
||||||
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10">
|
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15">
|
||||||
<Label x:Name="label" Content="Label" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
<Label x:Name="label" Content="Label" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||||
<TextBox x:Name="textBox" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" VerticalAlignment="Top" Width="279" VerticalContentAlignment="Center"/>
|
<TextBox x:Name="textBox" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" VerticalAlignment="Top" Width="280" VerticalContentAlignment="Center"/>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
|
||||||
<Button x:Name="okButton" Content="{DynamicResource ok }" HorizontalAlignment="Left" Margin="0,0,10,0" VerticalAlignment="Top" Width="100" Click="OkButton_Click" Cursor="Hand"/>
|
<Button x:Name="okButton" Content="{DynamicResource ok }" HorizontalAlignment="Left" Margin="0,0,10,0" VerticalAlignment="Top" Width="100" Click="OkButton_Click" Cursor="Hand"/>
|
||||||
<Button x:Name="cancelButton" Content="{DynamicResource cancel }" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Width="100" Click="CancelButton_Click"/>
|
<Button x:Name="cancelButton" Content="{DynamicResource cancel }" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Width="100" Click="CancelButton_Click"/>
|
||||||
@@ -2,25 +2,22 @@
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace DesktopMagic
|
namespace DesktopMagic.Dialogs
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Interaktionslogik für InputDialog.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class InputDialog : Window
|
public partial class InputDialog : Window
|
||||||
{
|
{
|
||||||
public InputDialog(string content, string title = "InputDialog")
|
public InputDialog(string content, string title = "InputDialog")
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
label.Content = content;
|
label.Content = content;
|
||||||
this.Title = title;
|
Title = title;
|
||||||
SetLanguageDictionary();
|
SetLanguageDictionary();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ResponseText
|
public string ResponseText
|
||||||
{
|
{
|
||||||
get { return textBox.Text; }
|
get => textBox.Text;
|
||||||
set { textBox.Text = value; }
|
set => textBox.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OkButton_Click(object sender, RoutedEventArgs e)
|
private void OkButton_Click(object sender, RoutedEventArgs e)
|
||||||
@@ -46,7 +43,7 @@ namespace DesktopMagic
|
|||||||
{
|
{
|
||||||
dict.Source = new Uri("..\\Resources\\StringResources.en.xaml", UriKind.Relative);
|
dict.Source = new Uri("..\\Resources\\StringResources.en.xaml", UriKind.Relative);
|
||||||
}
|
}
|
||||||
this.Resources.MergedDictionaries.Add(dict);
|
Resources.MergedDictionaries.Add(dict);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,4 +5,5 @@
|
|||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
[assembly: SuppressMessage("Performance", "CA1822:Member als statisch markieren", Justification = "<Ausstehend>", Scope = "member", Target = "~M:DesktopMagic.PluginWindow.LoadOptions(System.Object)")]
|
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Windows only application")]
|
||||||
|
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "No need to")]
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
using System.Globalization;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace DesktopMagic.Helpers
|
||||||
|
{
|
||||||
|
internal static class MultiColorConverter
|
||||||
|
{
|
||||||
|
public static string ConvertToHex(System.Drawing.Color color)
|
||||||
|
{
|
||||||
|
return $"#{color.A:X2}{color.R:X2}{color.G:X2}{color.B:X2}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ConvertToHex(System.Windows.Media.Color color)
|
||||||
|
{
|
||||||
|
return $"#{color.A:X2}{color.R:X2}{color.G:X2}{color.B:X2}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool TryConvertToSystemColor(string hex, out System.Drawing.Color color)
|
||||||
|
{
|
||||||
|
hex = hex.Replace("#", "");
|
||||||
|
|
||||||
|
if (hex.Length == 8 && Regex.IsMatch(hex, "(?:[0-9a-fA-F]{8})"))
|
||||||
|
{
|
||||||
|
int a = int.Parse(hex.Substring(0, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
int r = int.Parse(hex.Substring(2, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
int g = int.Parse(hex.Substring(4, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
int b = int.Parse(hex.Substring(6, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
color = System.Drawing.Color.FromArgb((byte)a, (byte)r, (byte)g, (byte)b);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (hex.Length == 6 && Regex.IsMatch(hex, "(?:[0-9a-fA-F]{6})"))
|
||||||
|
{
|
||||||
|
int a = 255;
|
||||||
|
int r = int.Parse(hex.Substring(0, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
int g = int.Parse(hex.Substring(2, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
int b = int.Parse(hex.Substring(4, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
color = System.Drawing.Color.FromArgb((byte)a, (byte)r, (byte)g, (byte)b);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
color = System.Drawing.Color.Transparent;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool TryConvertToMediaColor(string hex, out System.Windows.Media.Color color)
|
||||||
|
{
|
||||||
|
hex = hex.Replace("#", "");
|
||||||
|
|
||||||
|
if (hex.Length == 8 && Regex.IsMatch(hex, "(?:[0-9a-fA-F]{8})"))
|
||||||
|
{
|
||||||
|
int a = int.Parse(hex.Substring(0, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
int r = int.Parse(hex.Substring(2, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
int g = int.Parse(hex.Substring(4, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
int b = int.Parse(hex.Substring(6, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
color = System.Windows.Media.Color.FromArgb((byte)a, (byte)r, (byte)g, (byte)b);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (hex.Length == 6 && Regex.IsMatch(hex, "(?:[0-9a-fA-F]{6})"))
|
||||||
|
{
|
||||||
|
int a = 255;
|
||||||
|
int r = int.Parse(hex.Substring(0, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
int g = int.Parse(hex.Substring(2, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
int b = int.Parse(hex.Substring(4, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||||
|
color = System.Windows.Media.Color.FromArgb((byte)a, (byte)r, (byte)g, (byte)b);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
color = System.Windows.Media.Colors.Transparent;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,238 @@
|
|||||||
|
using DesktopMagic.Plugins;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
namespace DesktopMagic.Helpers
|
||||||
|
{
|
||||||
|
internal class SettingElementGenerator
|
||||||
|
{
|
||||||
|
private readonly ComboBox optionsComboBox;
|
||||||
|
|
||||||
|
public SettingElementGenerator(ComboBox optionsComboBox)
|
||||||
|
{
|
||||||
|
this.optionsComboBox = optionsComboBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Generate(SettingElement settingElement, DockPanel dockPanel, TextBlock textBlock)
|
||||||
|
{
|
||||||
|
dockPanel.UpdateLayout();
|
||||||
|
textBlock.UpdateLayout();
|
||||||
|
if (settingElement.Element is DesktopMagicPluginAPI.Inputs.Label eLabel)
|
||||||
|
{
|
||||||
|
textBlock.Text = eLabel.Value;
|
||||||
|
textBlock.Margin = new Thickness(0, 5, 3, 0);
|
||||||
|
textBlock.HorizontalAlignment = HorizontalAlignment.Stretch;
|
||||||
|
textBlock.TextWrapping = TextWrapping.WrapWithOverflow;
|
||||||
|
|
||||||
|
if (eLabel.Bold)
|
||||||
|
{
|
||||||
|
textBlock.FontWeight = FontWeights.Bold;
|
||||||
|
}
|
||||||
|
eLabel.OnValueChanged += () =>
|
||||||
|
{
|
||||||
|
textBlock.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
textBlock.Text = eLabel.Value;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else if (settingElement.Element is DesktopMagicPluginAPI.Inputs.Button eButton)
|
||||||
|
{
|
||||||
|
Button button = new()
|
||||||
|
{
|
||||||
|
Content = eButton.Value,
|
||||||
|
FontSize = 10,
|
||||||
|
Height = 20,
|
||||||
|
Margin = new Thickness(0, 10, 0, 10),
|
||||||
|
Padding = new Thickness(0),
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Stretch
|
||||||
|
};
|
||||||
|
button.Click += (_s, _e) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
eButton.Click();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
DisplayException(ex.Message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
eButton.OnValueChanged += () =>
|
||||||
|
{
|
||||||
|
button.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
button.Content = eButton.Value;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_ = dockPanel.Children.Add(button);
|
||||||
|
}
|
||||||
|
else if (settingElement.Element is DesktopMagicPluginAPI.Inputs.CheckBox eCheckBox)
|
||||||
|
{
|
||||||
|
CheckBox checkBox = new()
|
||||||
|
{
|
||||||
|
IsChecked = eCheckBox.Value,
|
||||||
|
Style = (Style)dockPanel.FindResource("MaterialDesignDarkCheckBox"),
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Stretch
|
||||||
|
};
|
||||||
|
checkBox.Click += (_s, _e) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
eCheckBox.Value = checkBox.IsChecked.GetValueOrDefault();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
DisplayException(ex.Message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
eCheckBox.OnValueChanged += () =>
|
||||||
|
{
|
||||||
|
checkBox.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
checkBox.IsChecked = eCheckBox.Value;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_ = dockPanel.Children.Add(checkBox);
|
||||||
|
}
|
||||||
|
else if (settingElement.Element is DesktopMagicPluginAPI.Inputs.TextBox eTextBox)
|
||||||
|
{
|
||||||
|
TextBox textBox = new()
|
||||||
|
{
|
||||||
|
Text = eTextBox.Value,
|
||||||
|
TextWrapping = TextWrapping.Wrap,
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Stretch
|
||||||
|
};
|
||||||
|
textBox.TextChanged += (_s, _e) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
eTextBox.Value = textBox.Text;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
DisplayException(ex.Message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
eTextBox.OnValueChanged += () =>
|
||||||
|
{
|
||||||
|
textBox.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
textBox.Text = eTextBox.Value;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
_ = dockPanel.Children.Add(textBox);
|
||||||
|
}
|
||||||
|
else if (settingElement.Element is DesktopMagicPluginAPI.Inputs.IntegerUpDown eIntegerUpDown)
|
||||||
|
{
|
||||||
|
Xceed.Wpf.Toolkit.IntegerUpDown integerUpDown = new()
|
||||||
|
{
|
||||||
|
Value = eIntegerUpDown.Value,
|
||||||
|
Minimum = eIntegerUpDown.Minimum,
|
||||||
|
Maximum = eIntegerUpDown.Maximum,
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Stretch
|
||||||
|
};
|
||||||
|
integerUpDown.ValueChanged += (_s, _e) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
eIntegerUpDown.Value = integerUpDown.Value.GetValueOrDefault();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
DisplayException(ex.Message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
eIntegerUpDown.OnValueChanged += () =>
|
||||||
|
{
|
||||||
|
integerUpDown.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
integerUpDown.Value = eIntegerUpDown.Value;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
_ = dockPanel.Children.Add(integerUpDown);
|
||||||
|
}
|
||||||
|
else if (settingElement.Element is DesktopMagicPluginAPI.Inputs.Slider eSlider)
|
||||||
|
{
|
||||||
|
Slider slider = new()
|
||||||
|
{
|
||||||
|
Value = eSlider.Value,
|
||||||
|
Minimum = eSlider.Minimum,
|
||||||
|
Maximum = eSlider.Maximum,
|
||||||
|
TickFrequency = 1,
|
||||||
|
IsSnapToTickEnabled = true,
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Stretch
|
||||||
|
};
|
||||||
|
slider.ValueChanged += (_s, _e) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
eSlider.Value = slider.Value;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
DisplayException(ex.Message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
eSlider.OnValueChanged += () =>
|
||||||
|
{
|
||||||
|
slider.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
slider.Value = eSlider.Value;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_ = dockPanel.Children.Add(slider);
|
||||||
|
}
|
||||||
|
else if (settingElement.Element is DesktopMagicPluginAPI.Inputs.ComboBox eComboBox)
|
||||||
|
{
|
||||||
|
ComboBox comboBox = new()
|
||||||
|
{
|
||||||
|
ItemsSource = eComboBox.Items,
|
||||||
|
IsEditable = false,
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||||
|
SelectedIndex = 0
|
||||||
|
};
|
||||||
|
|
||||||
|
comboBox.SelectionChanged += (_s, _e) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
eComboBox.Value = comboBox.Text;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
DisplayException(ex.Message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
eComboBox.OnValueChanged += () =>
|
||||||
|
{
|
||||||
|
comboBox.SelectedItem = eComboBox.Value;
|
||||||
|
};
|
||||||
|
|
||||||
|
_ = dockPanel.Children.Add(comboBox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DisplayException(string message)
|
||||||
|
{
|
||||||
|
App.Logger.Log(message, "PluginInput");
|
||||||
|
_ = MessageBox.Show("File execution error:\n" + message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
int index = MainWindow.WindowNames.IndexOf(optionsComboBox.SelectedItem.ToString());
|
||||||
|
|
||||||
|
PluginWindow window = MainWindow.Windows[index];
|
||||||
|
window?.Exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using System.Globalization;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace DesktopMagic.Helpers
|
||||||
|
{
|
||||||
|
internal static class StringUtilities
|
||||||
|
{
|
||||||
|
public static Size MeasureString(string input, TextBlock element)
|
||||||
|
{
|
||||||
|
FormattedText formattedText = new FormattedText(
|
||||||
|
input,
|
||||||
|
CultureInfo.CurrentCulture,
|
||||||
|
FlowDirection.LeftToRight,
|
||||||
|
new Typeface(element.FontFamily, element.FontStyle, element.FontWeight, element.FontStretch),
|
||||||
|
element.FontSize,
|
||||||
|
Brushes.Black,
|
||||||
|
new NumberSubstitution(),
|
||||||
|
1);
|
||||||
|
|
||||||
|
return new Size(formattedText.Width, formattedText.Height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -541,7 +541,7 @@ namespace DesktopMagic
|
|||||||
public static extern int GetSystemMetrics(int abc);
|
public static extern int GetSystemMetrics(int abc);
|
||||||
|
|
||||||
[DllImport("user32.dll", EntryPoint = "GetWindowDC")]
|
[DllImport("user32.dll", EntryPoint = "GetWindowDC")]
|
||||||
public static extern IntPtr GetWindowDC(Int32 ptr);
|
public static extern IntPtr GetWindowDC(int ptr);
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
public static extern bool IsWindowVisible(IntPtr hWnd);
|
public static extern bool IsWindowVisible(IntPtr hWnd);
|
||||||
@@ -559,7 +559,7 @@ namespace DesktopMagic
|
|||||||
public static extern IntPtr SelectObject(IntPtr hdc, IntPtr bmp);
|
public static extern IntPtr SelectObject(IntPtr hdc, IntPtr bmp);
|
||||||
|
|
||||||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||||
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, int wParam, IntPtr lParam);
|
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, IntPtr lParam);
|
||||||
|
|
||||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||||
public static extern IntPtr SendMessageTimeout(IntPtr windowHandle, uint Msg, IntPtr wParam, IntPtr lParam, SendMessageTimeoutFlags flags, uint timeout, out IntPtr result);
|
public static extern IntPtr SendMessageTimeout(IntPtr windowHandle, uint Msg, IntPtr wParam, IntPtr lParam, SendMessageTimeoutFlags flags, uint timeout, out IntPtr result);
|
||||||
@@ -590,7 +590,7 @@ namespace DesktopMagic
|
|||||||
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags);
|
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags);
|
||||||
|
|
||||||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||||
public static extern Int32 SystemParametersInfo(UInt32 action, UInt32 uParam, string vParam, UInt32 winIni);
|
public static extern int SystemParametersInfo(uint action, uint uParam, string vParam, uint winIni);
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct BbStruct //Blur Behind Structure
|
public struct BbStruct //Blur Behind Structure
|
||||||
@@ -642,37 +642,37 @@ namespace DesktopMagic
|
|||||||
|
|
||||||
public int X
|
public int X
|
||||||
{
|
{
|
||||||
get { return Left; }
|
get => Left;
|
||||||
set { Right -= (Left - value); Left = value; }
|
set { Right -= (Left - value); Left = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Y
|
public int Y
|
||||||
{
|
{
|
||||||
get { return Top; }
|
get => Top;
|
||||||
set { Bottom -= (Top - value); Top = value; }
|
set { Bottom -= (Top - value); Top = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Height
|
public int Height
|
||||||
{
|
{
|
||||||
get { return Bottom - Top; }
|
get => Bottom - Top;
|
||||||
set { Bottom = value + Top; }
|
set => Bottom = value + Top;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Width
|
public int Width
|
||||||
{
|
{
|
||||||
get { return Right - Left; }
|
get => Right - Left;
|
||||||
set { Right = value + Left; }
|
set => Right = value + Left;
|
||||||
}
|
}
|
||||||
|
|
||||||
public System.Drawing.Point Location
|
public System.Drawing.Point Location
|
||||||
{
|
{
|
||||||
get { return new System.Drawing.Point(Left, Top); }
|
get => new System.Drawing.Point(Left, Top);
|
||||||
set { X = value.X; Y = value.Y; }
|
set { X = value.X; Y = value.Y; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public System.Drawing.Size Size
|
public System.Drawing.Size Size
|
||||||
{
|
{
|
||||||
get { return new System.Drawing.Size(Width, Height); }
|
get => new System.Drawing.Size(Width, Height);
|
||||||
set { Width = value.Width; Height = value.Height; }
|
set { Width = value.Width; Height = value.Height; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -703,10 +703,15 @@ namespace DesktopMagic
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj is RECT)
|
if (obj is RECT rECT)
|
||||||
return Equals((RECT)obj);
|
{
|
||||||
else if (obj is System.Drawing.Rectangle)
|
return Equals(rECT);
|
||||||
return Equals(new RECT((System.Drawing.Rectangle)obj));
|
}
|
||||||
|
else if (obj is System.Drawing.Rectangle rectangle)
|
||||||
|
{
|
||||||
|
return Equals(new RECT(rectangle));
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@ namespace DesktopMagic
|
|||||||
int cy,
|
int cy,
|
||||||
uint uFlags);
|
uint uFlags);
|
||||||
|
|
||||||
private const UInt32 SWP_NOSIZE1 = 0x0001;
|
private const uint SWP_NOSIZE1 = 0x0001;
|
||||||
private const UInt32 SWP_NOMOVE1 = 0x0002;
|
private const uint SWP_NOMOVE1 = 0x0002;
|
||||||
|
|
||||||
private static readonly IntPtr HWND_BOTTOM = new IntPtr(1);
|
private static readonly IntPtr HWND_BOTTOM = new IntPtr(1);
|
||||||
|
|
||||||
@@ -40,9 +40,9 @@ namespace DesktopMagic
|
|||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
private static extern int GetWindowRect(IntPtr hwnd, out Rectangle rect);
|
private static extern int GetWindowRect(IntPtr hwnd, out Rectangle rect);
|
||||||
|
|
||||||
public void SendWpfWindowBack(Window window)
|
public static void SendWpfWindowBack(Window window)
|
||||||
{
|
{
|
||||||
var hWnd = new WindowInteropHelper(window).Handle;
|
IntPtr hWnd = new WindowInteropHelper(window).Handle;
|
||||||
SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE1 | SWP_NOMOVE1);
|
SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE1 | SWP_NOMOVE1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ namespace DesktopMagic
|
|||||||
return (bool)obj.GetValue(IsLockedProperty);
|
return (bool)obj.GetValue(IsLockedProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetIsLocked(DependencyObject obj, bool value)
|
public static void SetIsLocked(DependencyObject obj, bool value)
|
||||||
{
|
{
|
||||||
obj.SetValue(IsLockedProperty, value);
|
obj.SetValue(IsLockedProperty, value);
|
||||||
}
|
}
|
||||||
@@ -62,12 +62,12 @@ namespace DesktopMagic
|
|||||||
|
|
||||||
private static void IsLocked_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
private static void IsLocked_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
var window = (Window)d;
|
Window window = (Window)d;
|
||||||
var isHooked = d.GetValue(IsHookedProperty) != null;
|
bool isHooked = d.GetValue(IsHookedProperty) != null;
|
||||||
|
|
||||||
if (!isHooked)
|
if (!isHooked)
|
||||||
{
|
{
|
||||||
var hook = new WindowLockHook(window);
|
WindowLockHook hook = new WindowLockHook(window);
|
||||||
d.SetValue(IsHookedProperty, hook);
|
d.SetValue(IsHookedProperty, hook);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,10 +82,9 @@ namespace DesktopMagic
|
|||||||
|
|
||||||
public WindowLockHook(Window window)
|
public WindowLockHook(Window window)
|
||||||
{
|
{
|
||||||
this.Window = window;
|
Window = window;
|
||||||
|
|
||||||
var source = PresentationSource.FromVisual(window) as HwndSource;
|
if (PresentationSource.FromVisual(window) is not HwndSource source)
|
||||||
if (source == null)
|
|
||||||
{
|
{
|
||||||
// If there is no hWnd, we need to wait until there is
|
// If there is no hWnd, we need to wait until there is
|
||||||
window.SourceInitialized += Window_SourceInitialized;
|
window.SourceInitialized += Window_SourceInitialized;
|
||||||
@@ -98,7 +97,7 @@ namespace DesktopMagic
|
|||||||
|
|
||||||
private void Window_SourceInitialized(object sender, EventArgs e)
|
private void Window_SourceInitialized(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var source = (HwndSource)PresentationSource.FromVisual(Window);
|
HwndSource source = (HwndSource)PresentationSource.FromVisual(Window);
|
||||||
source.AddHook(WndProc);
|
source.AddHook(WndProc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,7 +105,7 @@ namespace DesktopMagic
|
|||||||
{
|
{
|
||||||
if (msg == WM_WINDOWPOSCHANGING && GetIsLocked(Window))
|
if (msg == WM_WINDOWPOSCHANGING && GetIsLocked(Window))
|
||||||
{
|
{
|
||||||
var wp = Marshal.PtrToStructure<WINDOWPOS>(lParam);
|
WINDOWPOS wp = Marshal.PtrToStructure<WINDOWPOS>(lParam);
|
||||||
wp.flags |= SWP_NOMOVE | SWP_NOSIZE;
|
wp.flags |= SWP_NOMOVE | SWP_NOSIZE;
|
||||||
Marshal.StructureToPtr(wp, lParam, false);
|
Marshal.StructureToPtr(wp, lParam, false);
|
||||||
}
|
}
|
||||||
@@ -9,9 +9,9 @@
|
|||||||
Background="{DynamicResource MaterialDesignPaper}"
|
Background="{DynamicResource MaterialDesignPaper}"
|
||||||
FontFamily="{DynamicResource MaterialDesignFont}"
|
FontFamily="{DynamicResource MaterialDesignFont}"
|
||||||
Height="520"
|
Height="520"
|
||||||
Width="550"
|
Width="570"
|
||||||
MinHeight="520"
|
MinHeight="520"
|
||||||
MinWidth="500"
|
MinWidth="570"
|
||||||
WindowState="Minimized"
|
WindowState="Minimized"
|
||||||
StateChanged="Window_StateChanged"
|
StateChanged="Window_StateChanged"
|
||||||
Loaded="Window_Loaded">
|
Loaded="Window_Loaded">
|
||||||
@@ -38,14 +38,15 @@
|
|||||||
<CheckBox x:Name="TimeCb" Content="{DynamicResource time}" Click="CheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
<CheckBox x:Name="TimeCb" Content="{DynamicResource time}" Click="CheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
||||||
<CheckBox x:Name="DateCb" Content="{DynamicResource date}" Click="CheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
<CheckBox x:Name="DateCb" Content="{DynamicResource date}" Click="CheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
||||||
<CheckBox x:Name="CpuUsageCb" Content="{DynamicResource cpuUsage}" Click="CheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
<CheckBox x:Name="CpuUsageCb" Content="{DynamicResource cpuUsage}" Click="CheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
||||||
<CheckBox x:Name="CalendarCb" Content="{DynamicResource googleCalendar}" Click="CheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
<CheckBox x:Name="CalendarCb" Content="{DynamicResource googleCalendar}" Click="CheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" Visibility="Collapsed"/>
|
||||||
|
<!--Currently disabled because it's not working-->
|
||||||
<CheckBox x:Name="MusicVisualizerCb" Content="{DynamicResource musicVisualizer}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="CheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
<CheckBox x:Name="MusicVisualizerCb" Content="{DynamicResource musicVisualizer}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="CheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
<DockPanel Grid.Column="1" Margin="2.5,0,0,0">
|
<DockPanel Grid.Column="1" Margin="2.5,0,0,0">
|
||||||
<ComboBox x:Name="optionsComboBox" DockPanel.Dock="Top" Height="24" SelectedIndex="0" DisplayMemberPath="Item1" SelectionChanged="OptionsComboBox_SelectionChanged" Background="#FFECECEC" />
|
<ComboBox x:Name="optionsComboBox" DockPanel.Dock="Top" Height="24" SelectedIndex="0" SelectionChanged="OptionsComboBox_SelectionChanged" Background="#FFECECEC" Padding="4" VerticalAlignment="Center"/>
|
||||||
<ScrollViewer Background="#FFBBBBBB">
|
<ScrollViewer Background="#FFBBBBBB">
|
||||||
<Grid>
|
<Grid>
|
||||||
<StackPanel x:Name="optionsPanel" Margin="3,3,3,0" HorizontalAlignment="Stretch" Visibility="Collapsed" >
|
<StackPanel x:Name="optionsPanel" Margin="3,3,3,0" HorizontalAlignment="Stretch" Visibility="Collapsed" >
|
||||||
@@ -57,11 +58,11 @@
|
|||||||
<Style TargetType="TextBlock" />
|
<Style TargetType="TextBlock" />
|
||||||
</materialDesign:TextFieldAssist.CharacterCounterStyle>
|
</materialDesign:TextFieldAssist.CharacterCounterStyle>
|
||||||
</TextBox>
|
</TextBox>
|
||||||
<ComboBox x:Name="spectrumPlugineComboBox" ItemsSource="{DynamicResource musicVisualizerOptionsComboboxItems}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" SelectionChanged="SpectrumPlugineComboBox_SelectionChanged" />
|
<ComboBox x:Name="spectrumModeComboBox" ItemsSource="{DynamicResource musicVisualizerOptionsComboboxItems}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" SelectionChanged="SpectrumModeComboBox_SelectionChanged" />
|
||||||
<CheckBox x:Name="mirrorPlugineCheckBox" Content="{DynamicResource mirrorPlugine}" Click="MirrorPlugineCheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
<CheckBox x:Name="mirrorModeCheckBox" Content="{DynamicResource mirrorMode}" Click="MirrorModeCheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
||||||
<CheckBox x:Name="linePlugineCheckBox" Content="{DynamicResource linePlugine}" Click="LinePlugineCheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
<CheckBox x:Name="lineModeCheckBox" Content="{DynamicResource lineMode}" Click="LineModeCheckBox_Click" Style="{StaticResource MaterialDesignDarkCheckBox}" />
|
||||||
<Label Content="{DynamicResource amplifier}" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="0,1" />
|
<Label Content="{DynamicResource amplifier}" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="0,1" />
|
||||||
<Slider x:Name="amplifierLevelSlider" Margin="-2,0,10,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" ValueChanged="AmplifierLevelSlider_ValueChanged" Maximum="50" Minimum="-50" SmallChange="1" LargeChange="5" Foreground="Gray" />
|
<Slider x:Name="amplifierLevelSlider" HorizontalAlignment="Stretch" VerticalAlignment="Top" ValueChanged="AmplifierLevelSlider_ValueChanged" Maximum="50" Minimum="-50" SmallChange="1" LargeChange="5" Foreground="Gray" />
|
||||||
<Label x:Name="amplifierLevelLabel" Content="Label" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="0,1" />
|
<Label x:Name="amplifierLevelLabel" Content="Label" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="0,1" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -73,46 +74,76 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="110" />
|
<RowDefinition Height="110" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel DockPanel.Dock="Top" Margin="{StaticResource DefaultMargin}">
|
<Grid.ColumnDefinitions>
|
||||||
<ComboBox x:Name="fontComboBox" HorizontalAlignment="Left" VerticalAlignment="Top" Width="181" SelectionChanged="FontComboBox_SelectionChanged" Margin="0,0,0,5" />
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition/>
|
||||||
<DockPanel>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Content="R:" Width="20" />
|
<Grid Grid.Column="0" Margin="{StaticResource DefaultMargin}" HorizontalAlignment="Stretch">
|
||||||
<Slider x:Name="redSlider" Maximum="255" ValueChanged="ColorSliders_ValueChanged" TickFrequency="1" IsSnapToTickEnabled="True" Background="#00030000" />
|
|
||||||
</DockPanel>
|
|
||||||
<DockPanel>
|
|
||||||
<Label Content="G:" Width="20" />
|
|
||||||
<Slider x:Name="greenSlider" Maximum="255" ValueChanged="ColorSliders_ValueChanged" TickFrequency="1" IsSnapToTickEnabled="True" Background="#0000FF00" />
|
|
||||||
</DockPanel>
|
|
||||||
<DockPanel>
|
|
||||||
<Label Content="B:" Width="20" />
|
|
||||||
<Slider x:Name="blueSlider" Maximum="255" ValueChanged="ColorSliders_ValueChanged" TickFrequency="1" IsSnapToTickEnabled="True" Background="#000000FF" />
|
|
||||||
</DockPanel>
|
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
|
||||||
<Rectangle x:Name="colorRechtangle" Fill="White" />
|
|
||||||
</Border>
|
|
||||||
<TextBox x:Name="colorHexTextBox" MaxLength="7" CharacterCasing="Upper" Height="23" TextWrapping="Wrap" Text="colorHexTextBox" Width="120" TextChanged="ColorHexTextBox_TextChanged" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center">
|
|
||||||
<materialDesign:TextFieldAssist.CharacterCounterStyle>
|
|
||||||
<Style TargetType="TextBlock" />
|
|
||||||
</materialDesign:TextFieldAssist.CharacterCounterStyle>
|
|
||||||
</TextBox>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
<Grid Grid.Row="1" VerticalAlignment="Bottom">
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="Display Font: " Grid.Column="0" Grid.Row="0" VerticalAlignment="Center"></TextBlock>
|
||||||
|
<ComboBox x:Name="fontComboBox" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Top" SelectionChanged="FontComboBox_SelectionChanged" Margin="0,0,0,5" />
|
||||||
|
|
||||||
|
<TextBlock Text="Corner Radius: " Grid.Column="0" Grid.Row="1" VerticalAlignment="Center"></TextBlock>
|
||||||
|
<TextBox x:Name="cornerRadiusTextBox" Grid.Column="1" Grid.Row="1" TextChanged="CornerRadiusTextBox_TextChanged" materialDesign:HintAssist.Hint="Enter a number">
|
||||||
|
<materialDesign:TextFieldAssist.CharacterCounterStyle>
|
||||||
|
<Style TargetType="TextBlock" />
|
||||||
|
</materialDesign:TextFieldAssist.CharacterCounterStyle>
|
||||||
|
</TextBox>
|
||||||
|
|
||||||
|
<TextBlock Text="Margin: " Grid.Column="0" Grid.Row="3" VerticalAlignment="Center"></TextBlock>
|
||||||
|
<TextBox x:Name="marginTextBox" Grid.Column="1" Grid.Row="3" TextChanged="MarginTextBox_TextChanged" materialDesign:HintAssist.Hint="Enter a number">
|
||||||
|
<materialDesign:TextFieldAssist.CharacterCounterStyle>
|
||||||
|
<Style TargetType="TextBlock" />
|
||||||
|
</materialDesign:TextFieldAssist.CharacterCounterStyle>
|
||||||
|
</TextBox>
|
||||||
|
</Grid>
|
||||||
|
<StackPanel Grid.Column="1" Margin="{StaticResource DefaultMargin}" HorizontalAlignment="Stretch">
|
||||||
|
<DockPanel Margin="0,0,0,5">
|
||||||
|
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
||||||
|
<Rectangle x:Name="primaryColorRechtangle" Fill="White" />
|
||||||
|
</Border>
|
||||||
|
<Button Content="Change Primary Color" Height="23" FontSize="12" FontWeight="Regular" Click="ChangePrimaryColorButton_Click"/>
|
||||||
|
</DockPanel>
|
||||||
|
<DockPanel Margin="0,0,0,5">
|
||||||
|
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
||||||
|
<Rectangle x:Name="secondaryColorRechtangle" Fill="White" />
|
||||||
|
</Border>
|
||||||
|
<Button Content="Change Secondary Color" Height="23" FontSize="12" FontWeight="Regular" Click="ChangeSecondaryColorButton_Click" />
|
||||||
|
</DockPanel>
|
||||||
|
<DockPanel>
|
||||||
|
<Border CornerRadius="1" BorderThickness="1.5" BorderBrush="Gray" Height="23" Width="23" Margin="0,0,5,0">
|
||||||
|
<Rectangle x:Name="backgroundColorRechtangle" Fill="White" />
|
||||||
|
</Border>
|
||||||
|
<Button Content="Change Background Color" Height="23" FontSize="12" FontWeight="Regular" Click="ChangeBackgroundColorButton_Click" />
|
||||||
|
</DockPanel>
|
||||||
|
</StackPanel>
|
||||||
|
<Grid Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Bottom">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Rectangle Fill="#FFC5C5C5" Stroke="#FFC5C5C5" Grid.ColumnSpan="2" />
|
<Rectangle Fill="#FFC5C5C5" Stroke="#FFC5C5C5" Grid.ColumnSpan="3" />
|
||||||
<StackPanel Margin="{StaticResource DefaultMargin}" VerticalAlignment="Bottom">
|
<StackPanel Margin="{StaticResource DefaultMargin}" VerticalAlignment="Bottom">
|
||||||
<ComboBox x:Name="layoutsComboBox" HorizontalAlignment="Left" Margin="0,0,0,5" Width="170" Height="20" SelectionChanged="LayoutsComboBox_SelectionChanged" />
|
<ComboBox x:Name="layoutsComboBox" HorizontalAlignment="Left" Margin="0,0,0,5" Width="170" Height="20" SelectionChanged="LayoutsComboBox_SelectionChanged" />
|
||||||
<Button x:Name="newLayoutButton" Content="{DynamicResource newLayout}" Margin="0,0,0,5" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="170" Click="NewLayoutButton_Click" FontWeight="Regular" />
|
<Button x:Name="newLayoutButton" Content="{DynamicResource newLayout}" Margin="0,0,0,5" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="170" Click="NewLayoutButton_Click" FontWeight="Regular" />
|
||||||
<Button x:Name="removeLayoutButton" Content="{DynamicResource deleteLayout}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="170" Click="RemoveLayoutButton_Click" FontWeight="Regular" />
|
<Button x:Name="removeLayoutButton" Content="{DynamicResource deleteLayout}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="170" Click="RemoveLayoutButton_Click" FontWeight="Regular" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Grid.Column="1" Margin="{StaticResource DefaultMargin}" VerticalAlignment="Bottom">
|
<StackPanel Grid.Column="1" Margin="{StaticResource DefaultMargin}" VerticalAlignment="Bottom">
|
||||||
|
<Button x:Name="downloadPluginsButton" Content="{DynamicResource downloadPlugins}" Margin="0,0,0,5" HorizontalAlignment="Center" Width="170" Click="DownloadPluginsButton_Click" FontWeight="Regular" Cursor="Hand" />
|
||||||
|
<Button x:Name="githubButton" Content="GitHub" HorizontalAlignment="Center" Width="170" Click="GithubButton_Click" FontWeight="Regular" Cursor="Hand" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Grid.Column="2" Margin="{StaticResource DefaultMargin}" VerticalAlignment="Bottom">
|
||||||
<Button x:Name="updatePluginsButton" Content="{DynamicResource updatePlugins}" Margin="0,0,0,5" HorizontalAlignment="Right" Width="170" Click="UpdatePluginsButton_Click" FontWeight="Regular" />
|
<Button x:Name="updatePluginsButton" Content="{DynamicResource updatePlugins}" Margin="0,0,0,5" HorizontalAlignment="Right" Width="170" Click="UpdatePluginsButton_Click" FontWeight="Regular" />
|
||||||
<Button x:Name="openPluginsFolderButton" Content="{DynamicResource openPluginsFolder}" HorizontalAlignment="Right" Width="170" Click="OpenPluginsFolderButton_Click" FontWeight="Regular" />
|
<Button x:Name="openPluginsFolderButton" Content="{DynamicResource openPluginsFolder}" HorizontalAlignment="Right" Width="170" Click="OpenPluginsFolderButton_Click" FontWeight="Regular" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
+354
-457
File diff suppressed because it is too large
Load Diff
@@ -1,24 +0,0 @@
|
|||||||
<Window
|
|
||||||
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:System="clr-namespace:System;assembly=mscorlib" x:Class="DesktopMagic.MusicVisualizerWindow"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="MusicVisualizerWindow" Height="450" Width="800"
|
|
||||||
Background="Transparent"
|
|
||||||
WindowStyle="None"
|
|
||||||
AllowsTransparency="True"
|
|
||||||
LocationChanged="Window_LocationChanged"
|
|
||||||
SizeChanged="Window_SizeChanged"
|
|
||||||
x:Name="window">
|
|
||||||
<WindowChrome.WindowChrome>
|
|
||||||
<WindowChrome x:Name="tileBar" CaptionHeight="30" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
|
|
||||||
</WindowChrome.WindowChrome>
|
|
||||||
<Grid x:Name="grid">
|
|
||||||
<Rectangle x:Name="panel" Fill="#4CBAFFEF" Stroke="White" Margin="0,0,0,0" Visibility="Collapsed" />
|
|
||||||
<Viewbox StretchDirection="Both" Stretch="Uniform">
|
|
||||||
<Image x:Name="image" HorizontalAlignment="Left" Height="759" Margin="0,0,0,0" VerticalAlignment="Top" Width="1747" RenderTransformOrigin="0.5,0.5" Stretch="Fill" />
|
|
||||||
</Viewbox>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using DesktopMagicPluginAPI;
|
|
||||||
using System.Drawing;
|
|
||||||
|
|
||||||
namespace DesktopMagic
|
|
||||||
{
|
|
||||||
internal class PluginData : IPluginData
|
|
||||||
{
|
|
||||||
private readonly PluginWindow window;
|
|
||||||
|
|
||||||
public PluginData(PluginWindow win)
|
|
||||||
{
|
|
||||||
window = win;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Font => MainWindow.GlobalFont;
|
|
||||||
|
|
||||||
public Color Color => (MainWindow.GlobalSystemColor as SolidBrush).Color;
|
|
||||||
|
|
||||||
public Point WindowSize => new Point((int)window.ActualWidth, (int)window.ActualHeight);
|
|
||||||
|
|
||||||
public Point WindowPosition => new Point((int)window.Left, (int)window.Top);
|
|
||||||
|
|
||||||
public void UpdateWindow()
|
|
||||||
{
|
|
||||||
window.UpdatePluginWindow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,339 +0,0 @@
|
|||||||
using DesktopMagicPluginAPI;
|
|
||||||
using DesktopMagicPluginAPI.Inputs;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Timers;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Interop;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
|
|
||||||
namespace DesktopMagic
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaktionslogik für PluginWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
public partial class PluginWindow : Window
|
|
||||||
{
|
|
||||||
private readonly RegistryKey key;
|
|
||||||
private Thread pluginThread;
|
|
||||||
private System.Timers.Timer valueTimer;
|
|
||||||
|
|
||||||
private Plugin pluginClassInstance;
|
|
||||||
private readonly string pluginName = "";
|
|
||||||
private string pluginFolderPath = "";
|
|
||||||
private bool stop = false;
|
|
||||||
|
|
||||||
public event Action PluginLoaded;
|
|
||||||
|
|
||||||
public event Action OnExit;
|
|
||||||
|
|
||||||
public PluginWindow(string pluginName)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
Window w = new()
|
|
||||||
{
|
|
||||||
Top = -100,
|
|
||||||
Left = -100,
|
|
||||||
Width = 0,
|
|
||||||
Height = 0,
|
|
||||||
|
|
||||||
WindowStyle = WindowStyle.ToolWindow,
|
|
||||||
ShowInTaskbar = false
|
|
||||||
};
|
|
||||||
w.Show();
|
|
||||||
this.Owner = w;
|
|
||||||
w.Hide();
|
|
||||||
|
|
||||||
System.Timers.Timer t = new System.Timers.Timer();
|
|
||||||
t.Interval = 100;
|
|
||||||
t.Elapsed += Elapsed;
|
|
||||||
t.Start();
|
|
||||||
|
|
||||||
this.pluginName = pluginName;
|
|
||||||
|
|
||||||
key = Registry.CurrentUser.CreateSubKey(@"Software\" + MainWindow.AppName);
|
|
||||||
this.Top = double.Parse(key.GetValue(pluginName + "WindowTop", 100).ToString());
|
|
||||||
this.Left = double.Parse(key.GetValue(pluginName + "WindowLeft", 100).ToString());
|
|
||||||
this.Height = double.Parse(key.GetValue(pluginName + "WindowHeight", 200).ToString());
|
|
||||||
this.Width = double.Parse(key.GetValue(pluginName + "WindowWidth", 500).ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnSourceInitialized(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnSourceInitialized(e);
|
|
||||||
|
|
||||||
//Set the window style to noactivate.
|
|
||||||
WindowInteropHelper helper = new(this);
|
|
||||||
WindowPos.SetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE,
|
|
||||||
WindowPos.GetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE) | WindowPos.WS_EX_NOACTIVATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_ContentRendered(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
pluginThread = new Thread(() =>
|
|
||||||
{
|
|
||||||
LoadPlugin();
|
|
||||||
});
|
|
||||||
pluginThread.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdatePluginWindow() => ValueTimer_Elapsed(valueTimer, null);
|
|
||||||
|
|
||||||
private void Elapsed(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
if (MainWindow.EditMode)
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Visible;
|
|
||||||
new WindowPos().SetIsLocked(this, false);
|
|
||||||
tileBar.CaptionHeight = tileBar.CaptionHeight = this.ActualHeight - 10 < 0 ? 0 : this.ActualHeight - 10;
|
|
||||||
this.ResizeMode = ResizeMode.CanResize;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Collapsed;
|
|
||||||
new WindowPos().SetIsLocked(this, true);
|
|
||||||
tileBar.CaptionHeight = 0;
|
|
||||||
this.ResizeMode = ResizeMode.NoResize;
|
|
||||||
}
|
|
||||||
if (stop)
|
|
||||||
{
|
|
||||||
((System.Timers.Timer)sender).Stop();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadPlugin()
|
|
||||||
{
|
|
||||||
string sourceText;
|
|
||||||
string PluginPath;
|
|
||||||
|
|
||||||
pluginFolderPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\{MainWindow.AppName}\\Plugins\\{pluginName}";
|
|
||||||
|
|
||||||
if (File.Exists($"{pluginFolderPath}\\{pluginName}.dll"))
|
|
||||||
{
|
|
||||||
PluginPath = $"{pluginFolderPath}\\{pluginName}.dll";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("File does not exist!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
Exit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
sourceText = File.ReadAllText(PluginPath);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MainWindow.Logger.Log(ex.ToString(), "Plugin");
|
|
||||||
MessageBox.Show("File could not be read:\n" + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
Exit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ExecuteSource(sourceText);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MainWindow.Logger.Log(ex.ToString(), "Plugin");
|
|
||||||
MessageBox.Show("File execution error:\n" + ex, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
Exit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
PluginLoaded?.Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ExecuteSource(string sourceText)
|
|
||||||
{
|
|
||||||
byte[] assemblyBytes = File.ReadAllBytes($"{pluginFolderPath}\\{pluginName}.dll");
|
|
||||||
Assembly dll = Assembly.Load(assemblyBytes);
|
|
||||||
Type instanceType = dll.GetTypes().FirstOrDefault(type => type.GetTypeInfo().BaseType == typeof(Plugin));
|
|
||||||
|
|
||||||
foreach (var item in dll.GetTypes())
|
|
||||||
{
|
|
||||||
Debug.WriteLine(item.Name);
|
|
||||||
Debug.WriteLine(typeof(Plugin).Name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (instanceType is null)
|
|
||||||
{
|
|
||||||
MessageBox.Show($"The \"Plugin\" class could not be found! It has to inherit from \"{typeof(Plugin).FullName}\"", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
Exit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
object instance = Activator.CreateInstance(instanceType);
|
|
||||||
if (instance is Plugin)
|
|
||||||
{
|
|
||||||
pluginClassInstance = instance as Plugin;
|
|
||||||
pluginClassInstance.Application = new PluginData(this);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show($"The \"Plugin\" class has to inherit from \"{typeof(Plugin).FullName}\"", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
Exit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (instanceType.Namespace == nameof(DesktopMagic))
|
|
||||||
{
|
|
||||||
MessageBox.Show("NO!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
Exit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LoadOptions(instance);
|
|
||||||
|
|
||||||
valueTimer = new System.Timers.Timer();
|
|
||||||
valueTimer.Interval = 1000;
|
|
||||||
valueTimer.Elapsed += ValueTimer_Elapsed;
|
|
||||||
|
|
||||||
UpdatePluginWindow();
|
|
||||||
|
|
||||||
if (pluginClassInstance.UpdateInterval > 0)
|
|
||||||
{
|
|
||||||
valueTimer.Interval = pluginClassInstance.UpdateInterval;
|
|
||||||
valueTimer.Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadOptions(object instance)
|
|
||||||
{
|
|
||||||
Debug.WriteLine(instance.GetType().FullName);
|
|
||||||
FieldInfo[] props = instance.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField);
|
|
||||||
|
|
||||||
List<SettingElement> settingElements = new List<SettingElement>();
|
|
||||||
foreach (FieldInfo prop in props)
|
|
||||||
{
|
|
||||||
if (prop.GetValue(instance) is Element element)
|
|
||||||
{
|
|
||||||
object[] attrs = prop.GetCustomAttributes(true);
|
|
||||||
foreach (object attr in attrs)
|
|
||||||
{
|
|
||||||
if (attr is ElementAttribute elementAttribute)
|
|
||||||
{
|
|
||||||
settingElements.Add(new SettingElement(element, elementAttribute.Name, elementAttribute.OrderIndex));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
settingElements = settingElements.OrderBy(x => x.OrderIndex).ToList();
|
|
||||||
if (MainWindow.PluginsSettings.ContainsKey(pluginName))
|
|
||||||
{
|
|
||||||
MainWindow.PluginsSettings[pluginName] = settingElements;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MainWindow.PluginsSettings.Add(pluginName, settingElements);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ValueTimer_Elapsed(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
//Set Arguments
|
|
||||||
SolidBrush newBrush = (SolidBrush)MainWindow.GlobalSystemColor;
|
|
||||||
Color color = newBrush.Color;
|
|
||||||
string font = MainWindow.GlobalFont;
|
|
||||||
|
|
||||||
Bitmap result = pluginClassInstance.Main();
|
|
||||||
|
|
||||||
//Update Image
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
image.Source = BitmapToImageSource(result);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (stop)
|
|
||||||
{
|
|
||||||
valueTimer.Stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private BitmapSource BitmapToImageSource(Bitmap bitmap)
|
|
||||||
{
|
|
||||||
BitmapData bitmapData = bitmap.LockBits(
|
|
||||||
new Rectangle(0, 0, bitmap.Width, bitmap.Height),
|
|
||||||
ImageLockMode.ReadOnly, bitmap.PixelFormat);
|
|
||||||
|
|
||||||
BitmapSource bitmapSource = BitmapSource.Create(
|
|
||||||
bitmapData.Width, bitmapData.Height,
|
|
||||||
bitmap.HorizontalResolution, bitmap.VerticalResolution,
|
|
||||||
System.Windows.Media.PixelFormats.Bgra32, null,
|
|
||||||
bitmapData.Scan0, bitmapData.Stride * bitmapData.Height, bitmapData.Stride);
|
|
||||||
|
|
||||||
bitmap.UnlockBits(bitmapData);
|
|
||||||
return bitmapSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Exit()
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
OnExit?.Invoke();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Window Events
|
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue(pluginName + "WindowTop", this.Top);
|
|
||||||
key.SetValue(pluginName + "WindowLeft", this.Left);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue(pluginName + "WindowHeight", this.Height);
|
|
||||||
key.SetValue(pluginName + "WindowWidth", this.Width);
|
|
||||||
tileBar.CaptionHeight = this.ActualHeight - 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
||||||
{
|
|
||||||
stop = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
Clicked(new System.Drawing.Point((int)e.GetPosition(this).X, (int)e.GetPosition(this).Y));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
|
|
||||||
{
|
|
||||||
Moved(new System.Drawing.Point((int)e.GetPosition(this).X, (int)e.GetPosition(this).Y));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Window Events
|
|
||||||
|
|
||||||
#region Plugin Methods
|
|
||||||
|
|
||||||
private void Clicked(System.Drawing.Point positon)
|
|
||||||
{
|
|
||||||
pluginClassInstance.OnMouseClick(positon);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Moved(System.Drawing.Point positon)
|
|
||||||
{
|
|
||||||
pluginClassInstance.OnMouseMove(positon);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Plugin Methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using DesktopMagicPluginAPI.Inputs;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace DesktopMagic
|
|
||||||
{
|
|
||||||
internal class SettingElement
|
|
||||||
{
|
|
||||||
public Element Element { get; }
|
|
||||||
public string Name { get; }
|
|
||||||
public int OrderIndex { get; }
|
|
||||||
|
|
||||||
public SettingElement(Element element, string name, int orderIndex)
|
|
||||||
{
|
|
||||||
Element = element;
|
|
||||||
Name = name;
|
|
||||||
OrderIndex = orderIndex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using DesktopMagicPluginAPI;
|
||||||
|
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace DesktopMagic.Plugins;
|
||||||
|
|
||||||
|
internal class PluginData : IPluginData
|
||||||
|
{
|
||||||
|
private readonly PluginWindow window;
|
||||||
|
|
||||||
|
public PluginData(PluginWindow window)
|
||||||
|
{
|
||||||
|
this.window = window;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Font => Theme.Font;
|
||||||
|
|
||||||
|
public Color Color => Theme.PrimaryColor;
|
||||||
|
|
||||||
|
public ITheme Theme { get; } = MainWindow.Theme;
|
||||||
|
|
||||||
|
public Size WindowSize => new Size((int)window.ActualWidth, (int)window.ActualHeight);
|
||||||
|
|
||||||
|
public Point WindowPosition => new Point((int)window.Left, (int)window.Top);
|
||||||
|
|
||||||
|
public string PluginName => window.PluginName;
|
||||||
|
|
||||||
|
public string PluginPath => window.PluginFolderPath;
|
||||||
|
|
||||||
|
public void UpdateWindow()
|
||||||
|
{
|
||||||
|
window.UpdatePluginWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
-3
@@ -13,12 +13,16 @@
|
|||||||
SizeChanged="Window_SizeChanged"
|
SizeChanged="Window_SizeChanged"
|
||||||
Closing="Window_Closing"
|
Closing="Window_Closing"
|
||||||
ContentRendered="Window_ContentRendered"
|
ContentRendered="Window_ContentRendered"
|
||||||
|
|
||||||
x:Name="window">
|
x:Name="window">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Rectangle x:Name="panel" Fill="#4CBAFFEF" Stroke="White" Margin="0,0,0,0" Visibility="Collapsed" />
|
<Rectangle x:Name="panel" Fill="#4CBAFFEF" Stroke="White" Margin="0,0,0,0" Visibility="Collapsed" />
|
||||||
<Viewbox StretchDirection="Both" Stretch="Uniform">
|
|
||||||
<Image x:Name="image" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Stretch="Uniform" MouseDown="Window_MouseDown" MouseMove="Window_MouseMove" />
|
<Border x:Name="border"/>
|
||||||
|
<Viewbox x:Name="viewBox" StretchDirection="Both" Stretch="Uniform">
|
||||||
|
<Viewbox.Clip>
|
||||||
|
<RectangleGeometry x:Name="rectangleGeometry" RadiusX="{Binding ElementName=border, Path=CornerRadius.TopLeft}" RadiusY="{Binding ElementName=border, Path=CornerRadius.TopLeft}"/>
|
||||||
|
</Viewbox.Clip>
|
||||||
|
<Image x:Name="image" HorizontalAlignment="Left" RenderOptions.EdgeMode="Aliased" Margin="0,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Stretch="Uniform" MouseDown="Window_MouseDown" MouseMove="Window_MouseMove" MouseWheel="Window_MouseWheel"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Grid>
|
</Grid>
|
||||||
<WindowChrome.WindowChrome>
|
<WindowChrome.WindowChrome>
|
||||||
@@ -0,0 +1,410 @@
|
|||||||
|
using DesktopMagic.Plugins;
|
||||||
|
|
||||||
|
using DesktopMagicPluginAPI;
|
||||||
|
using DesktopMagicPluginAPI.Drawing;
|
||||||
|
using DesktopMagicPluginAPI.Inputs;
|
||||||
|
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Timers;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Interop;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
namespace DesktopMagic;
|
||||||
|
|
||||||
|
public partial class PluginWindow : Window
|
||||||
|
{
|
||||||
|
private readonly RegistryKey key;
|
||||||
|
private Thread pluginThread;
|
||||||
|
private System.Timers.Timer valueTimer;
|
||||||
|
|
||||||
|
private Plugin pluginClassInstance;
|
||||||
|
|
||||||
|
public bool IsRunning { get; private set; } = true;
|
||||||
|
public string PluginName { get; private set; }
|
||||||
|
public string PluginFolderPath { get; private set; }
|
||||||
|
|
||||||
|
public event Action PluginLoaded;
|
||||||
|
|
||||||
|
public event Action OnExit;
|
||||||
|
|
||||||
|
public PluginWindow(string pluginName)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
Window w = new()
|
||||||
|
{
|
||||||
|
Top = -100,
|
||||||
|
Left = -100,
|
||||||
|
Width = 0,
|
||||||
|
Height = 0,
|
||||||
|
|
||||||
|
WindowStyle = WindowStyle.ToolWindow,
|
||||||
|
ShowInTaskbar = false
|
||||||
|
};
|
||||||
|
w.Show();
|
||||||
|
Owner = w;
|
||||||
|
w.Hide();
|
||||||
|
|
||||||
|
System.Timers.Timer t = new System.Timers.Timer
|
||||||
|
{
|
||||||
|
Interval = 100
|
||||||
|
};
|
||||||
|
t.Elapsed += UpdateTimer_Elapsed;
|
||||||
|
t.Start();
|
||||||
|
|
||||||
|
PluginName = pluginName;
|
||||||
|
|
||||||
|
key = Registry.CurrentUser.CreateSubKey(@"Software\" + App.AppName);
|
||||||
|
Top = double.Parse(key.GetValue(pluginName + "WindowTop", 100).ToString());
|
||||||
|
Left = double.Parse(key.GetValue(pluginName + "WindowLeft", 100).ToString());
|
||||||
|
Height = double.Parse(key.GetValue(pluginName + "WindowHeight", 200).ToString());
|
||||||
|
Width = double.Parse(key.GetValue(pluginName + "WindowWidth", 500).ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public PluginWindow(Plugin pluginClassInstance, string pluginName) : this(pluginName)
|
||||||
|
{
|
||||||
|
this.pluginClassInstance = pluginClassInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnSourceInitialized(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnSourceInitialized(e);
|
||||||
|
|
||||||
|
//Set the window style to noactivate.
|
||||||
|
WindowInteropHelper helper = new(this);
|
||||||
|
_ = WindowPos.SetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE,
|
||||||
|
WindowPos.GetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE) | WindowPos.WS_EX_NOACTIVATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_ContentRendered(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
pluginThread = new Thread(() =>
|
||||||
|
{
|
||||||
|
LoadPlugin();
|
||||||
|
});
|
||||||
|
pluginThread.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdatePluginWindow()
|
||||||
|
{
|
||||||
|
ValueTimer_Elapsed(valueTimer, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
if (MainWindow.EditMode)
|
||||||
|
{
|
||||||
|
panel.Visibility = Visibility.Visible;
|
||||||
|
WindowPos.SetIsLocked(this, false);
|
||||||
|
tileBar.CaptionHeight = tileBar.CaptionHeight = ActualHeight - 10 < 0 ? 0 : ActualHeight - 10;
|
||||||
|
ResizeMode = ResizeMode.CanResize;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
panel.Visibility = Visibility.Collapsed;
|
||||||
|
WindowPos.SetIsLocked(this, true);
|
||||||
|
tileBar.CaptionHeight = 0;
|
||||||
|
ResizeMode = ResizeMode.NoResize;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsRunning)
|
||||||
|
{
|
||||||
|
((System.Timers.Timer)sender).Stop();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
viewBox.Margin = new Thickness(MainWindow.Theme.Margin);
|
||||||
|
border.Width = viewBox.ActualWidth + (MainWindow.Theme.Margin * 2);
|
||||||
|
border.Height = viewBox.ActualHeight + (MainWindow.Theme.Margin * 2);
|
||||||
|
rectangleGeometry.Rect = new Rect(-MainWindow.Theme.Margin, -MainWindow.Theme.Margin, border.ActualWidth, border.ActualHeight);
|
||||||
|
border.Background = MainWindow.Theme.BackgroundBrush;
|
||||||
|
border.CornerRadius = new CornerRadius(MainWindow.Theme.CornerRadius);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadPlugin()
|
||||||
|
{
|
||||||
|
if (pluginClassInstance is null)
|
||||||
|
{
|
||||||
|
PluginFolderPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\{App.AppName}\\Plugins\\{PluginName}";
|
||||||
|
|
||||||
|
if (!File.Exists($"{PluginFolderPath}\\{PluginName}.dll"))
|
||||||
|
{
|
||||||
|
_ = MessageBox.Show("File does not exist!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
Exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ExecuteSource();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
App.Logger.Log(ex.ToString(), "Plugin", LogSeverity.Error);
|
||||||
|
_ = MessageBox.Show("File execution error:\n" + ex, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
Exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PluginLoaded?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ExecuteSource()
|
||||||
|
{
|
||||||
|
object instance = pluginClassInstance;
|
||||||
|
if (instance is null)
|
||||||
|
{
|
||||||
|
byte[] assemblyBytes = File.ReadAllBytes($"{PluginFolderPath}\\{PluginName}.dll");
|
||||||
|
Assembly dll = Assembly.Load(assemblyBytes);
|
||||||
|
Type instanceType = dll.GetTypes().FirstOrDefault(type => type.GetTypeInfo().BaseType == typeof(Plugin));
|
||||||
|
|
||||||
|
if (instanceType is null)
|
||||||
|
{
|
||||||
|
_ = MessageBox.Show($"The \"Plugin\" class could not be found! It has to inherit from \"{typeof(Plugin).FullName}\"", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
Exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
instance = Activator.CreateInstance(instanceType);
|
||||||
|
}
|
||||||
|
if (instance is Plugin)
|
||||||
|
{
|
||||||
|
pluginClassInstance = instance as Plugin;
|
||||||
|
pluginClassInstance.Application = new PluginData(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_ = MessageBox.Show($"The \"Plugin\" class has to inherit from \"{typeof(Plugin).FullName}\"", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
Exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LoadOptions(instance);
|
||||||
|
|
||||||
|
valueTimer = new System.Timers.Timer
|
||||||
|
{
|
||||||
|
Interval = 1000
|
||||||
|
};
|
||||||
|
valueTimer.Elapsed += ValueTimer_Elapsed;
|
||||||
|
|
||||||
|
pluginClassInstance.Start();
|
||||||
|
UpdatePluginWindow();
|
||||||
|
|
||||||
|
if (pluginClassInstance.UpdateInterval > 0)
|
||||||
|
{
|
||||||
|
valueTimer.Interval = pluginClassInstance.UpdateInterval;
|
||||||
|
valueTimer.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadOptions(object instance)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FieldInfo[] props = instance.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.GetField);
|
||||||
|
|
||||||
|
List<SettingElement> settingElements = new List<SettingElement>();
|
||||||
|
foreach (FieldInfo prop in props)
|
||||||
|
{
|
||||||
|
if (prop.GetValue(instance) is Element element)
|
||||||
|
{
|
||||||
|
object[] attributes = prop.GetCustomAttributes(true);
|
||||||
|
foreach (object attribute in attributes)
|
||||||
|
{
|
||||||
|
if (attribute is ElementAttribute elementAttribute)
|
||||||
|
{
|
||||||
|
settingElements.Add(new SettingElement(element, elementAttribute.Name, elementAttribute.OrderIndex));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
settingElements = settingElements.OrderBy(x => x.OrderIndex).ToList();
|
||||||
|
if (MainWindow.PluginsSettings.ContainsKey(PluginName))
|
||||||
|
{
|
||||||
|
MainWindow.PluginsSettings[PluginName] = settingElements;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindow.PluginsSettings.Add(PluginName, settingElements);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
IsRunning = false;
|
||||||
|
App.Logger.Log(ex.ToString(), "Plugin", LogSeverity.Error);
|
||||||
|
_ = MessageBox.Show("File execution error:\n" + ex, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
Exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ValueTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (IsRunning)
|
||||||
|
{
|
||||||
|
Bitmap result = pluginClassInstance.Main();
|
||||||
|
|
||||||
|
if (pluginClassInstance.UpdateInterval > 0)
|
||||||
|
{
|
||||||
|
valueTimer.Interval = pluginClassInstance.UpdateInterval;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
valueTimer.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result is not null)
|
||||||
|
{
|
||||||
|
BitmapScalingMode renderOptions = pluginClassInstance.RenderQuality switch
|
||||||
|
{
|
||||||
|
RenderQuality.High => BitmapScalingMode.HighQuality,
|
||||||
|
RenderQuality.Low => BitmapScalingMode.LowQuality,
|
||||||
|
RenderQuality.Performance => BitmapScalingMode.NearestNeighbor,
|
||||||
|
_ => BitmapScalingMode.Unspecified
|
||||||
|
};
|
||||||
|
|
||||||
|
//Update Image
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
RenderOptions.SetBitmapScalingMode(image, renderOptions);
|
||||||
|
image.Source = BitmapToImageSource(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
IsRunning = false;
|
||||||
|
App.Logger.Log(ex.ToString(), "Plugin", LogSeverity.Error);
|
||||||
|
_ = MessageBox.Show("File execution error:\n" + ex, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
Exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsRunning)
|
||||||
|
{
|
||||||
|
valueTimer.Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static BitmapSource BitmapToImageSource(Bitmap bitmap)
|
||||||
|
{
|
||||||
|
BitmapData bitmapData = bitmap.LockBits(
|
||||||
|
new Rectangle(0, 0, bitmap.Width, bitmap.Height),
|
||||||
|
ImageLockMode.ReadOnly, bitmap.PixelFormat);
|
||||||
|
|
||||||
|
BitmapSource bitmapSource = BitmapSource.Create(
|
||||||
|
bitmapData.Width, bitmapData.Height,
|
||||||
|
bitmap.HorizontalResolution, bitmap.VerticalResolution,
|
||||||
|
PixelFormats.Bgra32, null,
|
||||||
|
bitmapData.Scan0, bitmapData.Stride * bitmapData.Height, bitmapData.Stride);
|
||||||
|
|
||||||
|
bitmap.UnlockBits(bitmapData);
|
||||||
|
return bitmapSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Exit()
|
||||||
|
{
|
||||||
|
IsRunning = false;
|
||||||
|
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
OnExit?.Invoke();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
|
{
|
||||||
|
pluginClassInstance?.Stop();
|
||||||
|
IsRunning = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Window Events
|
||||||
|
|
||||||
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
key.SetValue(PluginName + "WindowTop", Top);
|
||||||
|
key.SetValue(PluginName + "WindowLeft", Left);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
|
{
|
||||||
|
key.SetValue(PluginName + "WindowHeight", Height);
|
||||||
|
key.SetValue(PluginName + "WindowWidth", Width);
|
||||||
|
tileBar.CaptionHeight = ActualHeight - 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
ImageSource imageSource = image.Source;
|
||||||
|
BitmapSource bitmapImage = (BitmapSource)imageSource;
|
||||||
|
double pixelMousePositionX = e.GetPosition(image).X * bitmapImage.PixelWidth / image.ActualHeight;
|
||||||
|
double pixelMousePositionY = e.GetPosition(image).Y * bitmapImage.PixelHeight / image.ActualHeight;
|
||||||
|
|
||||||
|
MouseButton mouseButton;
|
||||||
|
|
||||||
|
switch (e.ChangedButton)
|
||||||
|
{
|
||||||
|
case System.Windows.Input.MouseButton.Left:
|
||||||
|
mouseButton = MouseButton.Left;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case System.Windows.Input.MouseButton.Middle:
|
||||||
|
mouseButton = MouseButton.Middle;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case System.Windows.Input.MouseButton.Right:
|
||||||
|
mouseButton = MouseButton.Right;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
System.Drawing.Point point = new System.Drawing.Point((int)pixelMousePositionX, (int)pixelMousePositionY);
|
||||||
|
pluginClassInstance.OnMouseClick(point, mouseButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
|
||||||
|
{
|
||||||
|
ImageSource imageSource = image.Source;
|
||||||
|
BitmapSource bitmapImage = (BitmapSource)imageSource;
|
||||||
|
double pixelMousePositionX = e.GetPosition(image).X * bitmapImage.PixelWidth / image.ActualHeight;
|
||||||
|
double pixelMousePositionY = e.GetPosition(image).Y * bitmapImage.PixelHeight / image.ActualHeight;
|
||||||
|
|
||||||
|
System.Drawing.Point point = new System.Drawing.Point((int)pixelMousePositionX, (int)pixelMousePositionY);
|
||||||
|
pluginClassInstance.OnMouseMove(point);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ImageSource imageSource = image.Source;
|
||||||
|
BitmapSource bitmapImage = (BitmapSource)imageSource;
|
||||||
|
double pixelMousePositionX = e.GetPosition(image).X * bitmapImage.PixelWidth / image.ActualHeight;
|
||||||
|
double pixelMousePositionY = e.GetPosition(image).Y * bitmapImage.PixelHeight / image.ActualHeight;
|
||||||
|
|
||||||
|
System.Drawing.Point point = new System.Drawing.Point((int)pixelMousePositionX, (int)pixelMousePositionY);
|
||||||
|
pluginClassInstance.OnMouseWheel(point, e.Delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Window Events
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using DesktopMagicPluginAPI.Inputs;
|
||||||
|
|
||||||
|
namespace DesktopMagic.Plugins;
|
||||||
|
|
||||||
|
internal class SettingElement
|
||||||
|
{
|
||||||
|
public Element Element { get; }
|
||||||
|
public string Name { get; }
|
||||||
|
public int OrderIndex { get; }
|
||||||
|
|
||||||
|
public SettingElement(Element element, string name, int orderIndex)
|
||||||
|
{
|
||||||
|
Element = element;
|
||||||
|
Name = name;
|
||||||
|
OrderIndex = orderIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using DesktopMagicPluginAPI;
|
||||||
|
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace DesktopMagic.Plugins;
|
||||||
|
|
||||||
|
internal class Theme : ITheme
|
||||||
|
{
|
||||||
|
public Color PrimaryColor { get; set; } = Color.White;
|
||||||
|
public Color SecondaryColor { get; set; } = Color.White;
|
||||||
|
public Color BackgroundColor { get; set; } = Color.Transparent;
|
||||||
|
|
||||||
|
public string Font { get; set; } = "Segoe UI";
|
||||||
|
public int CornerRadius { get; set; }
|
||||||
|
public int Margin { get; set; }
|
||||||
|
|
||||||
|
public System.Windows.Media.Brush PrimaryBrush { get; set; } = System.Windows.Media.Brushes.White;
|
||||||
|
public System.Windows.Media.Brush SecondaryBrush { get; set; } = System.Windows.Media.Brushes.White;
|
||||||
|
public System.Windows.Media.Brush BackgroundBrush { get; set; } = System.Windows.Media.Brushes.Transparent;
|
||||||
|
}
|
||||||
@@ -3,10 +3,11 @@
|
|||||||
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
|
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
<system:String x:Key="linePlugine">Linie</system:String>
|
<system:String x:Key="lineMode">Linie</system:String>
|
||||||
<system:String x:Key="mirrorPlugine">Spiegeln</system:String>
|
<system:String x:Key="mirrorMode">Spiegeln</system:String>
|
||||||
<system:String x:Key="updatePlugins">Plugins Neu Laden</system:String>
|
<system:String x:Key="updatePlugins">Plugins Neu Laden</system:String>
|
||||||
<system:String x:Key="openPluginsFolder">Plugins Ordner Öffnen</system:String>
|
<system:String x:Key="openPluginsFolder">Plugins Ordner Öffnen</system:String>
|
||||||
|
<system:String x:Key="downloadPlugins">Plugins Herunterladen</system:String>
|
||||||
<system:String x:Key="color">Farbe:</system:String>
|
<system:String x:Key="color">Farbe:</system:String>
|
||||||
<system:String x:Key="default">Standard</system:String>
|
<system:String x:Key="default">Standard</system:String>
|
||||||
<system:String x:Key="wantToCloseProgram">Wollen sie das Programm wirklich schließen?</system:String>
|
<system:String x:Key="wantToCloseProgram">Wollen sie das Programm wirklich schließen?</system:String>
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
<system:String x:Key="deleteLayout">Layout Löschen</system:String>
|
<system:String x:Key="deleteLayout">Layout Löschen</system:String>
|
||||||
<system:String x:Key="ok">Ok</system:String>
|
<system:String x:Key="ok">Ok</system:String>
|
||||||
<system:String x:Key="cancel">Abbrechen</system:String>
|
<system:String x:Key="cancel">Abbrechen</system:String>
|
||||||
|
<system:String x:Key="enterLayoutName">Layoutnamen eingeben:</system:String>
|
||||||
<col:ArrayList x:Key="musicVisualizerOptionsComboboxItems">
|
<col:ArrayList x:Key="musicVisualizerOptionsComboboxItems">
|
||||||
<system:String>Unten</system:String>
|
<system:String>Unten</system:String>
|
||||||
<system:String>Mitte</system:String>
|
<system:String>Mitte</system:String>
|
||||||
|
|||||||
@@ -3,10 +3,11 @@
|
|||||||
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
|
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
<system:String x:Key="linePlugine">Line</system:String>
|
<system:String x:Key="lineMode">Line</system:String>
|
||||||
<system:String x:Key="mirrorPlugine">Mirror</system:String>
|
<system:String x:Key="mirrorMode">Mirror</system:String>
|
||||||
<system:String x:Key="updatePlugins">Reload Plugins</system:String>
|
<system:String x:Key="updatePlugins">Reload Plugins</system:String>
|
||||||
<system:String x:Key="openPluginsFolder">Open Plugins Folder</system:String>
|
<system:String x:Key="openPluginsFolder">Open Plugins Folder</system:String>
|
||||||
|
<system:String x:Key="downloadPlugins">Download Plugins</system:String>
|
||||||
<system:String x:Key="color">Color:</system:String>
|
<system:String x:Key="color">Color:</system:String>
|
||||||
<system:String x:Key="default">Default</system:String>
|
<system:String x:Key="default">Default</system:String>
|
||||||
<system:String x:Key="wantToCloseProgram">Do you really want to close the program?</system:String>
|
<system:String x:Key="wantToCloseProgram">Do you really want to close the program?</system:String>
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
<system:String x:Key="deleteLayout">Delete Layout</system:String>
|
<system:String x:Key="deleteLayout">Delete Layout</system:String>
|
||||||
<system:String x:Key="ok">Ok</system:String>
|
<system:String x:Key="ok">Ok</system:String>
|
||||||
<system:String x:Key="cancel">Cancel</system:String>
|
<system:String x:Key="cancel">Cancel</system:String>
|
||||||
|
<system:String x:Key="enterLayoutName">Enter layout name</system:String>
|
||||||
<col:ArrayList x:Key="musicVisualizerOptionsComboboxItems">
|
<col:ArrayList x:Key="musicVisualizerOptionsComboboxItems">
|
||||||
<system:String>Bottom</system:String>
|
<system:String>Bottom</system:String>
|
||||||
<system:String>Middle</system:String>
|
<system:String>Middle</system:String>
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
<Window x:Class="DesktopMagic.TimeWindow"
|
|
||||||
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"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="TimeWindow" Height="450" Width="800"
|
|
||||||
Background="Transparent"
|
|
||||||
WindowStyle="None"
|
|
||||||
AllowsTransparency="True"
|
|
||||||
LocationChanged="Window_LocationChanged"
|
|
||||||
SizeChanged="Window_SizeChanged"
|
|
||||||
x:Name="window">
|
|
||||||
<Grid>
|
|
||||||
<Rectangle x:Name="panel" Fill="#4CBAFFEF" Stroke="White" Margin="0,0,0,0" Visibility="Collapsed" />
|
|
||||||
<Viewbox StretchDirection="DownOnly" Stretch="Uniform">
|
|
||||||
<TextBlock x:Name="textBlock" FontSize="999" Foreground="White" Text=" " IsHitTestVisible="False" />
|
|
||||||
</Viewbox>
|
|
||||||
</Grid>
|
|
||||||
<WindowChrome.WindowChrome>
|
|
||||||
<WindowChrome x:Name="tileBar" CaptionHeight="30" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
|
|
||||||
</WindowChrome.WindowChrome>
|
|
||||||
</Window>
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
using System.Timers;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Interop;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace DesktopMagic
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaktionslogik für TimeWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class TimeWindow : Window
|
|
||||||
{
|
|
||||||
private RegistryKey key;
|
|
||||||
|
|
||||||
public TimeWindow()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
Window w = new Window();
|
|
||||||
w.Top = -100;
|
|
||||||
w.Left = -100;
|
|
||||||
w.Width = 0;
|
|
||||||
w.Height = 0;
|
|
||||||
|
|
||||||
w.WindowStyle = WindowStyle.ToolWindow;
|
|
||||||
w.ShowInTaskbar = false;
|
|
||||||
w.Show();
|
|
||||||
this.Owner = w;
|
|
||||||
w.Hide();
|
|
||||||
|
|
||||||
Timer t = new Timer();
|
|
||||||
t.Interval = 100;
|
|
||||||
t.Elapsed += T_Elapsed;
|
|
||||||
t.Start();
|
|
||||||
|
|
||||||
key = Registry.CurrentUser.CreateSubKey(@"Software\" + MainWindow.AppName);
|
|
||||||
this.Top = double.Parse(key.GetValue("TimeWindowTop", 100).ToString());
|
|
||||||
this.Left = double.Parse(key.GetValue("TimeWindowLeft", 100).ToString());
|
|
||||||
this.Height = double.Parse(key.GetValue("TimeWindowHeight", 200).ToString());
|
|
||||||
this.Width = double.Parse(key.GetValue("TimeWindowWidth", 500).ToString());
|
|
||||||
this.IsEnabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnSourceInitialized(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnSourceInitialized(e);
|
|
||||||
|
|
||||||
//Set the window style to noactivate.
|
|
||||||
var helper = new WindowInteropHelper(this);
|
|
||||||
WindowPos.SetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE,
|
|
||||||
WindowPos.GetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE) | WindowPos.WS_EX_NOACTIVATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void T_Elapsed(object sender, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
if (MainWindow.EditMode)
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Visible;
|
|
||||||
new WindowPos().SetIsLocked(this, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
panel.Visibility = Visibility.Collapsed;
|
|
||||||
new WindowPos().SetIsLocked(this, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
textBlock.FontFamily = new FontFamily(MainWindow.GlobalFont);
|
|
||||||
textBlock.Foreground = MainWindow.GlobalColor;
|
|
||||||
//textBlock.Text = DateTime.Now.ToString("hh:mm:ss tt");
|
|
||||||
textBlock.Text = DateTime.Now.ToString("HH:mm:ss");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_LocationChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue("TimeWindowTop", this.Top);
|
|
||||||
key.SetValue("TimeWindowLeft", this.Left);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
|
||||||
{
|
|
||||||
key.SetValue("TimeWindowHeight", this.Height);
|
|
||||||
key.SetValue("TimeWindowWidth", this.Width);
|
|
||||||
tileBar.CaptionHeight = this.ActualHeight - 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,523 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETCoreApp,Version=v5.0",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETCoreApp,Version=v5.0": {
|
|
||||||
"DesktopMagic/1.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"DesktopMagicPluginAPI": "0.0.0.1",
|
|
||||||
"Extended.Wpf.Toolkit": "4.1.0",
|
|
||||||
"Google.Apis.Calendar.v3": "1.51.0.2312",
|
|
||||||
"Hardcodet.NotifyIcon.Wpf": "1.1.0",
|
|
||||||
"MaterialDesignThemes": "4.0.0",
|
|
||||||
"NAudio": "2.0.0",
|
|
||||||
"Stone_Red-C-Sharp-Utilities": "1.0.2.1",
|
|
||||||
"System.Management": "5.0.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"DesktopMagic.dll": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Extended.Wpf.Toolkit/4.1.0": {
|
|
||||||
"runtime": {
|
|
||||||
"lib/net40/Xceed.Wpf.AvalonDock.Themes.Aero.dll": {
|
|
||||||
"assemblyVersion": "4.1.0.0",
|
|
||||||
"fileVersion": "4.1.0.0"
|
|
||||||
},
|
|
||||||
"lib/net40/Xceed.Wpf.AvalonDock.Themes.Metro.dll": {
|
|
||||||
"assemblyVersion": "4.1.0.0",
|
|
||||||
"fileVersion": "4.1.0.0"
|
|
||||||
},
|
|
||||||
"lib/net40/Xceed.Wpf.AvalonDock.Themes.VS2010.dll": {
|
|
||||||
"assemblyVersion": "4.1.0.0",
|
|
||||||
"fileVersion": "4.1.0.0"
|
|
||||||
},
|
|
||||||
"lib/net40/Xceed.Wpf.AvalonDock.dll": {
|
|
||||||
"assemblyVersion": "4.1.0.0",
|
|
||||||
"fileVersion": "4.1.0.0"
|
|
||||||
},
|
|
||||||
"lib/net40/Xceed.Wpf.Toolkit.dll": {
|
|
||||||
"assemblyVersion": "4.1.0.0",
|
|
||||||
"fileVersion": "4.1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"resources": {
|
|
||||||
"lib/net40/cs-CZ/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "cs-CZ"
|
|
||||||
},
|
|
||||||
"lib/net40/de/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "de"
|
|
||||||
},
|
|
||||||
"lib/net40/es/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "es"
|
|
||||||
},
|
|
||||||
"lib/net40/fr/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "fr"
|
|
||||||
},
|
|
||||||
"lib/net40/hu/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "hu"
|
|
||||||
},
|
|
||||||
"lib/net40/it/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "it"
|
|
||||||
},
|
|
||||||
"lib/net40/ja-JP/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "ja-JP"
|
|
||||||
},
|
|
||||||
"lib/net40/pt-BR/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "pt-BR"
|
|
||||||
},
|
|
||||||
"lib/net40/ro/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "ro"
|
|
||||||
},
|
|
||||||
"lib/net40/ru/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "ru"
|
|
||||||
},
|
|
||||||
"lib/net40/sv/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "sv"
|
|
||||||
},
|
|
||||||
"lib/net40/zh-Hans/Xceed.Wpf.AvalonDock.resources.dll": {
|
|
||||||
"locale": "zh-Hans"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Google.Apis/1.51.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Google.Apis.Core": "1.51.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/Google.Apis.dll": {
|
|
||||||
"assemblyVersion": "1.51.0.0",
|
|
||||||
"fileVersion": "1.51.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Google.Apis.Auth/1.51.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Google.Apis": "1.51.0",
|
|
||||||
"Google.Apis.Core": "1.51.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/Google.Apis.Auth.PlatformServices.dll": {
|
|
||||||
"assemblyVersion": "1.51.0.0",
|
|
||||||
"fileVersion": "1.51.0.0"
|
|
||||||
},
|
|
||||||
"lib/netstandard2.0/Google.Apis.Auth.dll": {
|
|
||||||
"assemblyVersion": "1.51.0.0",
|
|
||||||
"fileVersion": "1.51.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Google.Apis.Calendar.v3/1.51.0.2312": {
|
|
||||||
"dependencies": {
|
|
||||||
"Google.Apis": "1.51.0",
|
|
||||||
"Google.Apis.Auth": "1.51.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/Google.Apis.Calendar.v3.dll": {
|
|
||||||
"assemblyVersion": "1.51.0.2312",
|
|
||||||
"fileVersion": "1.51.0.2312"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Google.Apis.Core/1.51.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Newtonsoft.Json": "12.0.3"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/Google.Apis.Core.dll": {
|
|
||||||
"assemblyVersion": "1.51.0.0",
|
|
||||||
"fileVersion": "1.51.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Hardcodet.NotifyIcon.Wpf/1.1.0": {
|
|
||||||
"runtime": {
|
|
||||||
"lib/net5.0-windows7.0/Hardcodet.NotifyIcon.Wpf.dll": {
|
|
||||||
"assemblyVersion": "1.1.0.0",
|
|
||||||
"fileVersion": "1.1.0.17"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"MaterialDesignColors/2.0.0": {
|
|
||||||
"runtime": {
|
|
||||||
"lib/netcoreapp3.1/MaterialDesignColors.dll": {
|
|
||||||
"assemblyVersion": "2.0.0.2422",
|
|
||||||
"fileVersion": "2.0.0.2422"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"MaterialDesignThemes/4.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"MaterialDesignColors": "2.0.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netcoreapp3.1/MaterialDesignThemes.Wpf.dll": {
|
|
||||||
"assemblyVersion": "4.0.0.2422",
|
|
||||||
"fileVersion": "4.0.0.2422"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Microsoft.NETCore.Platforms/5.0.0": {},
|
|
||||||
"Microsoft.Win32.Registry/5.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"System.Security.AccessControl": "5.0.0",
|
|
||||||
"System.Security.Principal.Windows": "5.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Microsoft.Win32.SystemEvents/5.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.NETCore.Platforms": "5.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"NAudio/2.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"NAudio.Asio": "2.0.0",
|
|
||||||
"NAudio.Core": "2.0.0",
|
|
||||||
"NAudio.Midi": "2.0.0",
|
|
||||||
"NAudio.Wasapi": "2.0.0",
|
|
||||||
"NAudio.WinForms": "2.0.0",
|
|
||||||
"NAudio.WinMM": "2.0.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/NAudio.dll": {
|
|
||||||
"assemblyVersion": "2.0.0.0",
|
|
||||||
"fileVersion": "2.0.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"NAudio.Asio/2.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.Win32.Registry": "5.0.0",
|
|
||||||
"NAudio.Core": "2.0.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/NAudio.Asio.dll": {
|
|
||||||
"assemblyVersion": "2.0.0.0",
|
|
||||||
"fileVersion": "2.0.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"NAudio.Core/2.0.0": {
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/NAudio.Core.dll": {
|
|
||||||
"assemblyVersion": "2.0.0.0",
|
|
||||||
"fileVersion": "2.0.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"NAudio.Midi/2.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"NAudio.Core": "2.0.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/NAudio.Midi.dll": {
|
|
||||||
"assemblyVersion": "2.0.0.0",
|
|
||||||
"fileVersion": "2.0.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"NAudio.Wasapi/2.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"NAudio.Core": "2.0.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/NAudio.Wasapi.dll": {
|
|
||||||
"assemblyVersion": "2.0.0.0",
|
|
||||||
"fileVersion": "2.0.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"NAudio.WinForms/2.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"NAudio.WinMM": "2.0.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netcoreapp3.1/NAudio.WinForms.dll": {
|
|
||||||
"assemblyVersion": "2.0.0.0",
|
|
||||||
"fileVersion": "2.0.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"NAudio.WinMM/2.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.Win32.Registry": "5.0.0",
|
|
||||||
"NAudio.Core": "2.0.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/NAudio.WinMM.dll": {
|
|
||||||
"assemblyVersion": "2.0.0.0",
|
|
||||||
"fileVersion": "2.0.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Newtonsoft.Json/12.0.3": {
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/Newtonsoft.Json.dll": {
|
|
||||||
"assemblyVersion": "12.0.0.0",
|
|
||||||
"fileVersion": "12.0.3.23909"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Stone_Red-C-Sharp-Utilities/1.0.2.1": {
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.1/Stone_Red-C-Sharp-Utilities.dll": {
|
|
||||||
"assemblyVersion": "1.0.2.1",
|
|
||||||
"fileVersion": "1.0.2.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"System.CodeDom/5.0.0": {},
|
|
||||||
"System.Drawing.Common/5.0.2": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.Win32.SystemEvents": "5.0.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netcoreapp3.0/System.Drawing.Common.dll": {
|
|
||||||
"assemblyVersion": "5.0.0.2",
|
|
||||||
"fileVersion": "5.0.421.11614"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"runtimeTargets": {
|
|
||||||
"runtimes/unix/lib/netcoreapp3.0/System.Drawing.Common.dll": {
|
|
||||||
"rid": "unix",
|
|
||||||
"assetType": "runtime",
|
|
||||||
"assemblyVersion": "5.0.0.2",
|
|
||||||
"fileVersion": "5.0.421.11614"
|
|
||||||
},
|
|
||||||
"runtimes/win/lib/netcoreapp3.0/System.Drawing.Common.dll": {
|
|
||||||
"rid": "win",
|
|
||||||
"assetType": "runtime",
|
|
||||||
"assemblyVersion": "5.0.0.2",
|
|
||||||
"fileVersion": "5.0.421.11614"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"System.Management/5.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.NETCore.Platforms": "5.0.0",
|
|
||||||
"Microsoft.Win32.Registry": "5.0.0",
|
|
||||||
"System.CodeDom": "5.0.0"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"lib/netstandard2.0/System.Management.dll": {
|
|
||||||
"assemblyVersion": "4.0.0.0",
|
|
||||||
"fileVersion": "5.0.20.51904"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"runtimeTargets": {
|
|
||||||
"runtimes/win/lib/netcoreapp2.0/System.Management.dll": {
|
|
||||||
"rid": "win",
|
|
||||||
"assetType": "runtime",
|
|
||||||
"assemblyVersion": "4.0.0.0",
|
|
||||||
"fileVersion": "5.0.20.51904"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"System.Security.AccessControl/5.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.NETCore.Platforms": "5.0.0",
|
|
||||||
"System.Security.Principal.Windows": "5.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"System.Security.Principal.Windows/5.0.0": {},
|
|
||||||
"DesktopMagicPluginAPI/0.0.0.1": {
|
|
||||||
"dependencies": {
|
|
||||||
"System.Drawing.Common": "5.0.2"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"DesktopMagicPluginAPI.dll": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"DesktopMagic/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
},
|
|
||||||
"Extended.Wpf.Toolkit/4.1.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-wXyuHE2ut8OIDUgi1dfyX1qVDQClc4ARmM9yfB0MAshudfaWhtXedWR34zSCIN2gu7CPzE3+u9iLvBv5uBxROg==",
|
|
||||||
"path": "extended.wpf.toolkit/4.1.0",
|
|
||||||
"hashPath": "extended.wpf.toolkit.4.1.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"Google.Apis/1.51.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-4QL7S1PnDN/VumfzrLOGw8tiFLYRL/oPVQkCuIVltAh/gSPWxLu7UFZeum4S3B/ry7794Wigg53jclLlYX/haQ==",
|
|
||||||
"path": "google.apis/1.51.0",
|
|
||||||
"hashPath": "google.apis.1.51.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"Google.Apis.Auth/1.51.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-rwyLkiXev6esCRXq+srUcEb8zWylNg7eyE9zO8GxiQplrn1+Jhn8WlwhyJ/xXM83Mrd7Fi0p/UpnOo+m8NBI2g==",
|
|
||||||
"path": "google.apis.auth/1.51.0",
|
|
||||||
"hashPath": "google.apis.auth.1.51.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"Google.Apis.Calendar.v3/1.51.0.2312": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-8iskPPgvvZ3VtGhWIjeP9R5ouQasGMUj66Z5G5VHLfriKIVm+MTqyC6XGYTxjeJhXYU6yRQLnNk8f6fAFYxb2A==",
|
|
||||||
"path": "google.apis.calendar.v3/1.51.0.2312",
|
|
||||||
"hashPath": "google.apis.calendar.v3.1.51.0.2312.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"Google.Apis.Core/1.51.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-2HBwN81SB5DBI/TKbJr6y6u2I5sBlLxUHYUkc26Y4FSFachdDlWISZZreO0AVKdJrHsbmKDhHdqkRjkLSGeiNw==",
|
|
||||||
"path": "google.apis.core/1.51.0",
|
|
||||||
"hashPath": "google.apis.core.1.51.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"Hardcodet.NotifyIcon.Wpf/1.1.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-FFEkdRSidMrbMfQVwhCzq6KtSyR1qQojqtiUrkCyjnOOuMf7W3TNQkzFnBBxYxFe7uLk5mz7M38wFh1qdWyfvg==",
|
|
||||||
"path": "hardcodet.notifyicon.wpf/1.1.0",
|
|
||||||
"hashPath": "hardcodet.notifyicon.wpf.1.1.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"MaterialDesignColors/2.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-+JoghC3QRK0u9Wul1To1ORjcfTbFTVzFPjJ02H7VREOdNzIIn427e8G9gP9hXu9pm1r2OneLnoCG/lTma5cG2w==",
|
|
||||||
"path": "materialdesigncolors/2.0.0",
|
|
||||||
"hashPath": "materialdesigncolors.2.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"MaterialDesignThemes/4.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-+n5oWHuRiYL/gUw2XfQHCRZqHtU8KbrdurgU0IcO98Zsyhw4BvggodfXY8veRtbjjmM9EJ/sG2yKBrgPOGX4JQ==",
|
|
||||||
"path": "materialdesignthemes/4.0.0",
|
|
||||||
"hashPath": "materialdesignthemes.4.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"Microsoft.NETCore.Platforms/5.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==",
|
|
||||||
"path": "microsoft.netcore.platforms/5.0.0",
|
|
||||||
"hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"Microsoft.Win32.Registry/5.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
|
|
||||||
"path": "microsoft.win32.registry/5.0.0",
|
|
||||||
"hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"Microsoft.Win32.SystemEvents/5.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-Bh6blKG8VAKvXiLe2L+sEsn62nc1Ij34MrNxepD2OCrS5cpCwQa9MeLyhVQPQ/R4Wlzwuy6wMK8hLb11QPDRsQ==",
|
|
||||||
"path": "microsoft.win32.systemevents/5.0.0",
|
|
||||||
"hashPath": "microsoft.win32.systemevents.5.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"NAudio/2.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-ZjQfWM3jBTpdHWApsbBP3Mb3ZvXZ2eK6MWED9YeuXwbR+Kfz5M5lHdLTVADAqOHyBDqSnvwFsQCAWWRfuGeG3w==",
|
|
||||||
"path": "naudio/2.0.0",
|
|
||||||
"hashPath": "naudio.2.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"NAudio.Asio/2.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-/Pd51zAS2L3+MK/dJ5VrInz6ggHUie9j1qCXysXL3Vj53p9A2RxjpIZafuyba2ZdeMKaOMOHXdtkUqFdKqVMQg==",
|
|
||||||
"path": "naudio.asio/2.0.0",
|
|
||||||
"hashPath": "naudio.asio.2.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"NAudio.Core/2.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-knmGOIYbzn9ZGkFcVs5d3zEYvi50jVriyEirVtAHjkcDoo2ziK32bZb7KkFARLD4lhCGkqp6uT0+0fc4JIfQcw==",
|
|
||||||
"path": "naudio.core/2.0.0",
|
|
||||||
"hashPath": "naudio.core.2.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"NAudio.Midi/2.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-25/wjDvc/SX8jHb/+F6+lzz7FRFiSujl9N6qq1KcFqfBFS6K1KtdclaZz+01B9PErwQUoraGCdruhiad6tYBvQ==",
|
|
||||||
"path": "naudio.midi/2.0.0",
|
|
||||||
"hashPath": "naudio.midi.2.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"NAudio.Wasapi/2.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-7ES+jfZyOooBp86gql9BZ/OjKFmGfLaSLCtJagtCYiRGxfauHp4hXyeuwxS2mPLBxBGxBo9oGThN6y3QY+/w/w==",
|
|
||||||
"path": "naudio.wasapi/2.0.0",
|
|
||||||
"hashPath": "naudio.wasapi.2.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"NAudio.WinForms/2.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-j65uncDKEhTh4z1IejmtnNhPBA4y6V9zEGnsLA3mm3JzX2e3flmL5UMadQUdx83UlmtF/8t5ichcmUhSGhrQHg==",
|
|
||||||
"path": "naudio.winforms/2.0.0",
|
|
||||||
"hashPath": "naudio.winforms.2.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"NAudio.WinMM/2.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-Q1trk5d9cdSRJSK/PXceUgpwIH7FivxkiE4nzmk0rl3qSM4ViHcpc2Fe/W1VUz2dHtGwOqOwpgSch7LHv7F48A==",
|
|
||||||
"path": "naudio.winmm/2.0.0",
|
|
||||||
"hashPath": "naudio.winmm.2.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"Newtonsoft.Json/12.0.3": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==",
|
|
||||||
"path": "newtonsoft.json/12.0.3",
|
|
||||||
"hashPath": "newtonsoft.json.12.0.3.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"Stone_Red-C-Sharp-Utilities/1.0.2.1": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-QzwH0QvsDiBvCJTFroZBhN/pMEIiz0C8TNkQci+pxCbnjfTtVkxAYsgmlshCl5oHFJh7VYDLcGAULcMBARSb+w==",
|
|
||||||
"path": "stone_red-c-sharp-utilities/1.0.2.1",
|
|
||||||
"hashPath": "stone_red-c-sharp-utilities.1.0.2.1.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"System.CodeDom/5.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-JPJArwA1kdj8qDAkY2XGjSWoYnqiM7q/3yRNkt6n28Mnn95MuEGkZXUbPBf7qc3IjwrGY5ttQon7yqHZyQJmOQ==",
|
|
||||||
"path": "system.codedom/5.0.0",
|
|
||||||
"hashPath": "system.codedom.5.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"System.Drawing.Common/5.0.2": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-rvr/M1WPf24ljpvvrVd74+NdjRUJu1bBkspkZcnzSZnmAUQWSvanlQ0k/hVHk+cHufZbZfu7vOh/vYc0q5Uu/A==",
|
|
||||||
"path": "system.drawing.common/5.0.2",
|
|
||||||
"hashPath": "system.drawing.common.5.0.2.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"System.Management/5.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-MF1CHaRcC+MLFdnDthv4/bKWBZnlnSpkGqa87pKukQefgEdwtb9zFW6zs0GjPp73qtpYYg4q6PEKbzJbxCpKfw==",
|
|
||||||
"path": "system.management/5.0.0",
|
|
||||||
"hashPath": "system.management.5.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"System.Security.AccessControl/5.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
|
|
||||||
"path": "system.security.accesscontrol/5.0.0",
|
|
||||||
"hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"System.Security.Principal.Windows/5.0.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==",
|
|
||||||
"path": "system.security.principal.windows/5.0.0",
|
|
||||||
"hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"DesktopMagicPluginAPI/0.0.0.1": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeOptions": {
|
|
||||||
"additionalProbingPaths": [
|
|
||||||
"C:\\Users\\David\\.dotnet\\store\\|arch|\\|tfm|",
|
|
||||||
"C:\\Users\\David\\.nuget\\packages",
|
|
||||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeOptions": {
|
|
||||||
"tfm": "net5.0",
|
|
||||||
"framework": {
|
|
||||||
"name": "Microsoft.WindowsDesktop.App",
|
|
||||||
"version": "5.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user