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