From 5fd7b74519d2b6192d718695c06c58955c47b0e2 Mon Sep 17 00:00:00 2001 From: seerge Date: Fri, 17 Mar 2023 15:03:09 +0100 Subject: [PATCH] Folder reorganisation --- Properties/launchSettings.json | 8 ---- .editorconfig => app/.editorconfig | 0 ASUSWmi.cs => app/ASUSWmi.cs | 1 - .../AnimeMatrix}/AnimeMatrixDevice.cs | 0 App.config => app/App.config | 2 +- AppConfig.cs => app/AppConfig.cs | 0 Aura.cs => app/Aura.cs | 0 .../Communication}/Device.cs | 0 .../Communication}/Packet.cs | 0 .../Communication}/Platform/UsbProvider.cs | 0 .../Platform/WindowsUsbProvider.cs | 0 Fans.Designer.cs => app/Fans.Designer.cs | 0 Fans.cs => app/Fans.cs | 0 Fans.resx => app/Fans.resx | 0 GHelper.csproj => app/GHelper.csproj | 2 +- GHelper.sln => app/GHelper.sln | 0 {Gpu => app/Gpu}/AmdAdl2.cs | 0 {Gpu => app/Gpu}/AmdGpuTemperatureProvider.cs | 0 {Gpu => app/Gpu}/IGpuTemperatureProvider.cs | 0 .../Gpu}/NvidiaGpuTemperatureProvider.cs | 0 HardwareMonitor.cs => app/HardwareMonitor.cs | 0 .../Keyboard.Designer.cs | 0 Keyboard.cs => app/Keyboard.cs | 0 Keyboard.resx => app/Keyboard.resx | 0 app/Logger.cs | 39 ++++++++++++++++++ NativeMethods.cs => app/NativeMethods.cs | 0 OSDBase.cs => app/OSDBase.cs | 0 Program.cs => app/Program.cs | 38 +---------------- .../Properties}/Resources.Designer.cs | 0 {Properties => app/Properties}/Resources.resx | 0 .../Properties}/Settings.Designer.cs | 0 .../Properties}/Settings.settings | 0 app/Properties/launchSettings.json | 7 ++++ {Resources => app/Resources}/eco.ico | Bin .../Resources}/everything-is-fine-itsfine.gif | Bin .../Resources}/icons8-charging-battery-48.png | Bin .../Resources}/icons8-fan-head-96.png | Bin .../Resources}/icons8-keyboard-48.png | Bin .../Resources}/icons8-laptop-48.png | Bin .../Resources}/icons8-matrix-desktop-48.png | Bin .../Resources}/icons8-processor-96.png | Bin .../Resources}/icons8-speed-48.png | Bin .../Resources}/icons8-speed-96.png | Bin .../Resources}/icons8-video-card-48.png | Bin {Resources => app/Resources}/standard.ico | Bin {Resources => app/Resources}/ultimate.ico | Bin RoundedButton.cs => app/RoundedButton.cs | 0 .../Settings.Designer.cs | 0 Settings.cs => app/Settings.cs | 0 Settings.resx => app/Settings.resx | 0 Startup.cs => app/Startup.cs | 0 ToastForm.cs => app/ToastForm.cs | 0 app.manifest => app/app.manifest | 0 favicon.ico => app/favicon.ico | Bin .../screenshots}/screen-5w.png | Bin 55 files changed, 49 insertions(+), 48 deletions(-) delete mode 100644 Properties/launchSettings.json rename .editorconfig => app/.editorconfig (100%) rename ASUSWmi.cs => app/ASUSWmi.cs (99%) rename {AnimeMatrix => app/AnimeMatrix}/AnimeMatrixDevice.cs (100%) rename App.config => app/App.config (85%) rename AppConfig.cs => app/AppConfig.cs (100%) rename Aura.cs => app/Aura.cs (100%) rename {Communication => app/Communication}/Device.cs (100%) rename {Communication => app/Communication}/Packet.cs (100%) rename {Communication => app/Communication}/Platform/UsbProvider.cs (100%) rename {Communication => app/Communication}/Platform/WindowsUsbProvider.cs (100%) rename Fans.Designer.cs => app/Fans.Designer.cs (100%) rename Fans.cs => app/Fans.cs (100%) rename Fans.resx => app/Fans.resx (100%) rename GHelper.csproj => app/GHelper.csproj (98%) rename GHelper.sln => app/GHelper.sln (100%) rename {Gpu => app/Gpu}/AmdAdl2.cs (100%) rename {Gpu => app/Gpu}/AmdGpuTemperatureProvider.cs (100%) rename {Gpu => app/Gpu}/IGpuTemperatureProvider.cs (100%) rename {Gpu => app/Gpu}/NvidiaGpuTemperatureProvider.cs (100%) rename HardwareMonitor.cs => app/HardwareMonitor.cs (100%) rename Keyboard.Designer.cs => app/Keyboard.Designer.cs (100%) rename Keyboard.cs => app/Keyboard.cs (100%) rename Keyboard.resx => app/Keyboard.resx (100%) create mode 100644 app/Logger.cs rename NativeMethods.cs => app/NativeMethods.cs (100%) rename OSDBase.cs => app/OSDBase.cs (100%) rename Program.cs => app/Program.cs (90%) rename {Properties => app/Properties}/Resources.Designer.cs (100%) rename {Properties => app/Properties}/Resources.resx (100%) rename {Properties => app/Properties}/Settings.Designer.cs (100%) rename {Properties => app/Properties}/Settings.settings (100%) create mode 100644 app/Properties/launchSettings.json rename {Resources => app/Resources}/eco.ico (100%) rename {Resources => app/Resources}/everything-is-fine-itsfine.gif (100%) rename {Resources => app/Resources}/icons8-charging-battery-48.png (100%) rename {Resources => app/Resources}/icons8-fan-head-96.png (100%) rename {Resources => app/Resources}/icons8-keyboard-48.png (100%) rename {Resources => app/Resources}/icons8-laptop-48.png (100%) rename {Resources => app/Resources}/icons8-matrix-desktop-48.png (100%) rename {Resources => app/Resources}/icons8-processor-96.png (100%) rename {Resources => app/Resources}/icons8-speed-48.png (100%) rename {Resources => app/Resources}/icons8-speed-96.png (100%) rename {Resources => app/Resources}/icons8-video-card-48.png (100%) rename {Resources => app/Resources}/standard.ico (100%) rename {Resources => app/Resources}/ultimate.ico (100%) rename RoundedButton.cs => app/RoundedButton.cs (100%) rename Settings.Designer.cs => app/Settings.Designer.cs (100%) rename Settings.cs => app/Settings.cs (100%) rename Settings.resx => app/Settings.resx (100%) rename Startup.cs => app/Startup.cs (100%) rename ToastForm.cs => app/ToastForm.cs (100%) rename app.manifest => app/app.manifest (100%) rename favicon.ico => app/favicon.ico (100%) rename {screenshots => app/screenshots}/screen-5w.png (100%) diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json deleted file mode 100644 index 1c164927..00000000 --- a/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "GHelper": { - "commandName": "Project", - "workingDirectory": "C:\\Users\\serge\\source\\GHelper" - } - } -} \ No newline at end of file diff --git a/.editorconfig b/app/.editorconfig similarity index 100% rename from .editorconfig rename to app/.editorconfig diff --git a/ASUSWmi.cs b/app/ASUSWmi.cs similarity index 99% rename from ASUSWmi.cs rename to app/ASUSWmi.cs index 8aa5be34..e1fe8873 100644 --- a/ASUSWmi.cs +++ b/app/ASUSWmi.cs @@ -1,7 +1,6 @@ using System.Management; using System.Runtime.InteropServices; - public class ASUSWmi { diff --git a/AnimeMatrix/AnimeMatrixDevice.cs b/app/AnimeMatrix/AnimeMatrixDevice.cs similarity index 100% rename from AnimeMatrix/AnimeMatrixDevice.cs rename to app/AnimeMatrix/AnimeMatrixDevice.cs diff --git a/App.config b/app/App.config similarity index 85% rename from App.config rename to app/App.config index 0d099bd0..3a6bb535 100644 --- a/App.config +++ b/app/App.config @@ -1,7 +1,7 @@  - + diff --git a/AppConfig.cs b/app/AppConfig.cs similarity index 100% rename from AppConfig.cs rename to app/AppConfig.cs diff --git a/Aura.cs b/app/Aura.cs similarity index 100% rename from Aura.cs rename to app/Aura.cs diff --git a/Communication/Device.cs b/app/Communication/Device.cs similarity index 100% rename from Communication/Device.cs rename to app/Communication/Device.cs diff --git a/Communication/Packet.cs b/app/Communication/Packet.cs similarity index 100% rename from Communication/Packet.cs rename to app/Communication/Packet.cs diff --git a/Communication/Platform/UsbProvider.cs b/app/Communication/Platform/UsbProvider.cs similarity index 100% rename from Communication/Platform/UsbProvider.cs rename to app/Communication/Platform/UsbProvider.cs diff --git a/Communication/Platform/WindowsUsbProvider.cs b/app/Communication/Platform/WindowsUsbProvider.cs similarity index 100% rename from Communication/Platform/WindowsUsbProvider.cs rename to app/Communication/Platform/WindowsUsbProvider.cs diff --git a/Fans.Designer.cs b/app/Fans.Designer.cs similarity index 100% rename from Fans.Designer.cs rename to app/Fans.Designer.cs diff --git a/Fans.cs b/app/Fans.cs similarity index 100% rename from Fans.cs rename to app/Fans.cs diff --git a/Fans.resx b/app/Fans.resx similarity index 100% rename from Fans.resx rename to app/Fans.resx diff --git a/GHelper.csproj b/app/GHelper.csproj similarity index 98% rename from GHelper.csproj rename to app/GHelper.csproj index 357b90d7..745a26e8 100644 --- a/GHelper.csproj +++ b/app/GHelper.csproj @@ -32,7 +32,7 @@ - Always + Never diff --git a/GHelper.sln b/app/GHelper.sln similarity index 100% rename from GHelper.sln rename to app/GHelper.sln diff --git a/Gpu/AmdAdl2.cs b/app/Gpu/AmdAdl2.cs similarity index 100% rename from Gpu/AmdAdl2.cs rename to app/Gpu/AmdAdl2.cs diff --git a/Gpu/AmdGpuTemperatureProvider.cs b/app/Gpu/AmdGpuTemperatureProvider.cs similarity index 100% rename from Gpu/AmdGpuTemperatureProvider.cs rename to app/Gpu/AmdGpuTemperatureProvider.cs diff --git a/Gpu/IGpuTemperatureProvider.cs b/app/Gpu/IGpuTemperatureProvider.cs similarity index 100% rename from Gpu/IGpuTemperatureProvider.cs rename to app/Gpu/IGpuTemperatureProvider.cs diff --git a/Gpu/NvidiaGpuTemperatureProvider.cs b/app/Gpu/NvidiaGpuTemperatureProvider.cs similarity index 100% rename from Gpu/NvidiaGpuTemperatureProvider.cs rename to app/Gpu/NvidiaGpuTemperatureProvider.cs diff --git a/HardwareMonitor.cs b/app/HardwareMonitor.cs similarity index 100% rename from HardwareMonitor.cs rename to app/HardwareMonitor.cs diff --git a/Keyboard.Designer.cs b/app/Keyboard.Designer.cs similarity index 100% rename from Keyboard.Designer.cs rename to app/Keyboard.Designer.cs diff --git a/Keyboard.cs b/app/Keyboard.cs similarity index 100% rename from Keyboard.cs rename to app/Keyboard.cs diff --git a/Keyboard.resx b/app/Keyboard.resx similarity index 100% rename from Keyboard.resx rename to app/Keyboard.resx diff --git a/app/Logger.cs b/app/Logger.cs new file mode 100644 index 00000000..76e31c1e --- /dev/null +++ b/app/Logger.cs @@ -0,0 +1,39 @@ +using System.Diagnostics; + +public static class Logger +{ + static string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper"; + static string logFile = appPath + "\\log.txt"; + + public static void WriteLine(string logMessage) + { + Debug.WriteLine(logMessage); + if (!Directory.Exists(appPath)) Directory.CreateDirectory(appPath); + + try + { + using (StreamWriter w = File.AppendText(logFile)) + { + w.WriteLine($"{DateTime.Now}: {logMessage}"); + w.Close(); + } + } + catch { } + + if (new Random().Next(100) == 1) Cleanup(); + + + } + + public static void Cleanup() + { + try + { + var file = File.ReadAllLines(logFile); + int skip = Math.Max(0, file.Count() - 500); + File.WriteAllLines(logFile, file.Skip(skip).ToArray()); + } + catch { } + } + +} diff --git a/NativeMethods.cs b/app/NativeMethods.cs similarity index 100% rename from NativeMethods.cs rename to app/NativeMethods.cs diff --git a/OSDBase.cs b/app/OSDBase.cs similarity index 100% rename from OSDBase.cs rename to app/OSDBase.cs diff --git a/Program.cs b/app/Program.cs similarity index 90% rename from Program.cs rename to app/Program.cs index 53b2d70d..602ed9dd 100644 --- a/Program.cs +++ b/app/Program.cs @@ -2,43 +2,7 @@ using Microsoft.Win32; using System.Diagnostics; using System.Management; using System.Reflection; -using System.Runtime.InteropServices; using System.Text.Json; -public static class Logger -{ - static string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper"; - static string logFile = appPath + "\\log.txt"; - - public static void WriteLine(string logMessage) - { - Debug.WriteLine(logMessage); - if (!Directory.Exists(appPath)) Directory.CreateDirectory(appPath); - - try - { - using (StreamWriter w = File.AppendText(logFile)) - { - w.WriteLine($"{DateTime.Now}: {logMessage}"); - w.Close(); - } - } catch { } - - if (new Random().Next(100) == 1) Cleanup(); - - - } - - public static void Cleanup() - { - try - { - var file = File.ReadAllLines(logFile); - int skip = Math.Max(0, file.Count() - 500); - File.WriteAllLines(logFile, file.Skip(skip).ToArray()); - } catch { } - } - -} namespace GHelper { @@ -163,7 +127,7 @@ namespace GHelper settingsForm.SetBatteryChargeLimit(config.getConfig("charge_limit")); settingsForm.AutoPerformance(isPlugged); - + bool switched = settingsForm.AutoGPUMode(isPlugged); if (!switched) settingsForm.AutoScreen(isPlugged); diff --git a/Properties/Resources.Designer.cs b/app/Properties/Resources.Designer.cs similarity index 100% rename from Properties/Resources.Designer.cs rename to app/Properties/Resources.Designer.cs diff --git a/Properties/Resources.resx b/app/Properties/Resources.resx similarity index 100% rename from Properties/Resources.resx rename to app/Properties/Resources.resx diff --git a/Properties/Settings.Designer.cs b/app/Properties/Settings.Designer.cs similarity index 100% rename from Properties/Settings.Designer.cs rename to app/Properties/Settings.Designer.cs diff --git a/Properties/Settings.settings b/app/Properties/Settings.settings similarity index 100% rename from Properties/Settings.settings rename to app/Properties/Settings.settings diff --git a/app/Properties/launchSettings.json b/app/Properties/launchSettings.json new file mode 100644 index 00000000..745ef362 --- /dev/null +++ b/app/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "profiles": { + "GHelper": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/Resources/eco.ico b/app/Resources/eco.ico similarity index 100% rename from Resources/eco.ico rename to app/Resources/eco.ico diff --git a/Resources/everything-is-fine-itsfine.gif b/app/Resources/everything-is-fine-itsfine.gif similarity index 100% rename from Resources/everything-is-fine-itsfine.gif rename to app/Resources/everything-is-fine-itsfine.gif diff --git a/Resources/icons8-charging-battery-48.png b/app/Resources/icons8-charging-battery-48.png similarity index 100% rename from Resources/icons8-charging-battery-48.png rename to app/Resources/icons8-charging-battery-48.png diff --git a/Resources/icons8-fan-head-96.png b/app/Resources/icons8-fan-head-96.png similarity index 100% rename from Resources/icons8-fan-head-96.png rename to app/Resources/icons8-fan-head-96.png diff --git a/Resources/icons8-keyboard-48.png b/app/Resources/icons8-keyboard-48.png similarity index 100% rename from Resources/icons8-keyboard-48.png rename to app/Resources/icons8-keyboard-48.png diff --git a/Resources/icons8-laptop-48.png b/app/Resources/icons8-laptop-48.png similarity index 100% rename from Resources/icons8-laptop-48.png rename to app/Resources/icons8-laptop-48.png diff --git a/Resources/icons8-matrix-desktop-48.png b/app/Resources/icons8-matrix-desktop-48.png similarity index 100% rename from Resources/icons8-matrix-desktop-48.png rename to app/Resources/icons8-matrix-desktop-48.png diff --git a/Resources/icons8-processor-96.png b/app/Resources/icons8-processor-96.png similarity index 100% rename from Resources/icons8-processor-96.png rename to app/Resources/icons8-processor-96.png diff --git a/Resources/icons8-speed-48.png b/app/Resources/icons8-speed-48.png similarity index 100% rename from Resources/icons8-speed-48.png rename to app/Resources/icons8-speed-48.png diff --git a/Resources/icons8-speed-96.png b/app/Resources/icons8-speed-96.png similarity index 100% rename from Resources/icons8-speed-96.png rename to app/Resources/icons8-speed-96.png diff --git a/Resources/icons8-video-card-48.png b/app/Resources/icons8-video-card-48.png similarity index 100% rename from Resources/icons8-video-card-48.png rename to app/Resources/icons8-video-card-48.png diff --git a/Resources/standard.ico b/app/Resources/standard.ico similarity index 100% rename from Resources/standard.ico rename to app/Resources/standard.ico diff --git a/Resources/ultimate.ico b/app/Resources/ultimate.ico similarity index 100% rename from Resources/ultimate.ico rename to app/Resources/ultimate.ico diff --git a/RoundedButton.cs b/app/RoundedButton.cs similarity index 100% rename from RoundedButton.cs rename to app/RoundedButton.cs diff --git a/Settings.Designer.cs b/app/Settings.Designer.cs similarity index 100% rename from Settings.Designer.cs rename to app/Settings.Designer.cs diff --git a/Settings.cs b/app/Settings.cs similarity index 100% rename from Settings.cs rename to app/Settings.cs diff --git a/Settings.resx b/app/Settings.resx similarity index 100% rename from Settings.resx rename to app/Settings.resx diff --git a/Startup.cs b/app/Startup.cs similarity index 100% rename from Startup.cs rename to app/Startup.cs diff --git a/ToastForm.cs b/app/ToastForm.cs similarity index 100% rename from ToastForm.cs rename to app/ToastForm.cs diff --git a/app.manifest b/app/app.manifest similarity index 100% rename from app.manifest rename to app/app.manifest diff --git a/favicon.ico b/app/favicon.ico similarity index 100% rename from favicon.ico rename to app/favicon.ico diff --git a/screenshots/screen-5w.png b/app/screenshots/screen-5w.png similarity index 100% rename from screenshots/screen-5w.png rename to app/screenshots/screen-5w.png