From 52fd635fda71f443b8c557b132305a3e3e64089f Mon Sep 17 00:00:00 2001 From: Vincent Maas Date: Sat, 15 Apr 2023 10:37:08 +0200 Subject: [PATCH] fix LG device settings not saving, upgrade to .NET 7 --- ColorControl/ColorControl.csproj | 20 +- ColorControl/Common/Utils.cs | 4 +- ColorControl/Forms/FormUtils.cs | 14 +- ColorControl/MainForm.cs | 33 +- ColorControl/Program.cs | 7 +- .../Services/Common/GraphicsService.cs | 5 +- .../EventDispatcher/EventDispatcher.cs | 54 + .../EventDispatcher/EventExtensions.cs | 17 + .../EventDispatcher/PowerEventDispatcher.cs | 27 + .../EventDispatcher/ProcessEventDispatcher.cs | 119 ++ .../SessionSwitchDispatcher.cs} | 22 +- ColorControl/Services/LG/LgDevice.cs | 31 +- ColorControl/Services/LG/LgPanel.Designer.cs | 1261 ++++++++--------- ColorControl/Services/LG/LgPanel.cs | 38 +- ColorControl/Services/LG/LgService.cs | 450 +++--- ColorControl/Services/NVIDIA/NvPanel.cs | 3 +- ColorControl/StartUpParams.cs | 9 + .../Svc/ColorControlBackgroundService.cs | 9 +- Nspector/Nspector.csproj | 4 +- NvAPIWrapper/NvAPIWrapper.csproj | 4 +- 20 files changed, 1164 insertions(+), 967 deletions(-) create mode 100644 ColorControl/Services/EventDispatcher/EventDispatcher.cs create mode 100644 ColorControl/Services/EventDispatcher/EventExtensions.cs create mode 100644 ColorControl/Services/EventDispatcher/PowerEventDispatcher.cs create mode 100644 ColorControl/Services/EventDispatcher/ProcessEventDispatcher.cs rename ColorControl/{Native/UserSessionInfo.cs => Services/EventDispatcher/SessionSwitchDispatcher.cs} (59%) diff --git a/ColorControl/ColorControl.csproj b/ColorControl/ColorControl.csproj index 8cc4b1c..b7643dd 100644 --- a/ColorControl/ColorControl.csproj +++ b/ColorControl/ColorControl.csproj @@ -1,7 +1,7 @@  10.0 - net6.0-windows10.0.20348.0 + net7.0-windows10.0.20348.0 WinExe false publish\ @@ -19,8 +19,8 @@ Maassoft Maassoft 0 - 9.0.0.0 - 9.0.0.0 + 9.1.0.0 + 9.1.0.0 false true false @@ -89,17 +89,17 @@ - - + + - - - - + + + + - + diff --git a/ColorControl/Common/Utils.cs b/ColorControl/Common/Utils.cs index 7b645b1..761bbf2 100644 --- a/ColorControl/Common/Utils.cs +++ b/ColorControl/Common/Utils.cs @@ -296,7 +296,7 @@ The best and suggested method to provide this is via a Windows Service. Only whe return key != null && key.GetValue(null).ToString().Contains("--disable-lcd-text"); } - internal static bool InstallChromeFix(bool install) + internal static bool InstallChromeFix(bool install, string applicationDataFolder) { var argument = "--disable-lcd-text"; @@ -312,7 +312,7 @@ The best and suggested method to provide this is via a Windows Service. Only whe key.SetValue(null, value); } - var roamingFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); + var roamingFolder = applicationDataFolder ?? Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); UpdateShortcut(Path.Combine(roamingFolder, @"Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Google Chrome.lnk"), argument, !install); UpdateShortcut(Path.Combine(roamingFolder, @"Microsoft\Internet Explorer\Quick Launch\Google Chrome.lnk"), argument, !install); diff --git a/ColorControl/Forms/FormUtils.cs b/ColorControl/Forms/FormUtils.cs index 1e80bae..a841f82 100644 --- a/ColorControl/Forms/FormUtils.cs +++ b/ColorControl/Forms/FormUtils.cs @@ -45,12 +45,14 @@ namespace ColorControl.Forms public static void SetNotifyIconText(NotifyIcon ni, string text) { - text = text.Substring(0, Math.Min(text.Length, 127)); - Type t = typeof(NotifyIcon); - BindingFlags hidden = BindingFlags.NonPublic | BindingFlags.Instance; - t.GetField("text", hidden).SetValue(ni, text); - if ((bool)t.GetField("added", hidden).GetValue(ni)) - t.GetMethod("UpdateIcon", hidden).Invoke(ni, new object[] { true }); + ni.Text = text; + + //text = text.Substring(0, Math.Min(text.Length, 127)); + //Type t = typeof(NotifyIcon); + //BindingFlags hidden = BindingFlags.NonPublic | BindingFlags.Instance; + //t.GetField("text", hidden).SetValue(ni, text); + //if ((bool)t.GetField("added", hidden).GetValue(ni)) + // t.GetMethod("UpdateIcon", hidden).Invoke(ni, new object[] { true }); } public static ToolStripMenuItem BuildDropDownMenuEx(ToolStripItemCollection items, string parentName, string name, Type enumType, EventHandler clickEvent, object tag = null, int min = 0, int max = 0, bool noSubItems = false) diff --git a/ColorControl/MainForm.cs b/ColorControl/MainForm.cs index bd94fd5..e9eb84a 100644 --- a/ColorControl/MainForm.cs +++ b/ColorControl/MainForm.cs @@ -140,7 +140,6 @@ namespace ColorControl InitInfo(); UpdateServiceInfo(); - UserSessionInfo.Install(); _screenStateNotify = WinApi.RegisterPowerSettingNotification(Handle, ref Utils.GUID_CONSOLE_DISPLAY_STATE, 0); //Scale(new SizeF(1.25F, 1.25F)); @@ -320,9 +319,7 @@ namespace ColorControl { try { - var appContextProvider = Program.ServiceProvider.GetRequiredService(); - - _lgService = new LgService(appContextProvider, StartUpParams.RunningFromScheduledTask); + _lgService = Program.ServiceProvider.GetRequiredService(); _lgPanel = new LgPanel(_lgService, _nvService, _amdService, _trayIcon, Handle); _lgPanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; @@ -562,20 +559,24 @@ namespace ColorControl { //Logger.Debug($"WM_SYSCOMMAND: {m.WParam.ToInt32()}"); - if (m.WParam.ToInt32() == NativeConstants.SC_MONITORPOWER) - { + //if (m.WParam.ToInt32() == NativeConstants.SC_MONITORPOWER) + //{ - } + //} } else if (m.Msg == NativeConstants.WM_POWERBROADCAST) { + //Logger.Debug($"WM_POWERBROADCAST: {m.WParam.ToInt32()}"); + if (m.WParam.ToInt32() == WinApi.PBT_POWERSETTINGCHANGE) { var ps = Marshal.PtrToStructure(m.LParam); - Logger.Debug($"PBT_POWERSETTINGCHANGE: {ps.Data}"); + var power = (LgService.WindowsPowerSetting)ps.Data; - _lgService?.PowerSettingChanged((LgService.WindowsPowerSetting)ps.Data); + Logger.Debug($"PBT_POWERSETTINGCHANGE: {power}"); + + _lgService?.PowerSettingChanged(power); } } @@ -1398,14 +1399,12 @@ Currently ColorControl is {(Utils.IsAdministrator() ? "" : "not ")}running as ad if (_initialized) { _config.FixChromeFonts = chkFixChromeFonts.Checked; - if (chkFixChromeFonts.Checked) - { - Utils.ExecuteElevated(StartUpParams.ActivateChromeFontFixParam); - } - else - { - Utils.ExecuteElevated(StartUpParams.DeactivateChromeFontFixParam); - } + + var param = chkFixChromeFonts.Checked ? StartUpParams.ActivateChromeFontFixParam : StartUpParams.DeactivateChromeFontFixParam; + + var folder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); + + Utils.ExecuteElevated($"{param} {folder}"); } } diff --git a/ColorControl/Program.cs b/ColorControl/Program.cs index e74979c..7a5f05f 100644 --- a/ColorControl/Program.cs +++ b/ColorControl/Program.cs @@ -2,6 +2,7 @@ using ColorControl.Forms; using ColorControl.Services.AMD; using ColorControl.Services.Common; +using ColorControl.Services.EventDispatcher; using ColorControl.Services.LG; using ColorControl.Services.NVIDIA; using ColorControl.Svc; @@ -207,7 +208,7 @@ namespace ColorControl { if (startUpParams.ActivateChromeFontFix || startUpParams.DeactivateChromeFontFix) { - Utils.InstallChromeFix(startUpParams.ActivateChromeFontFix); + Utils.InstallChromeFix(startUpParams.ActivateChromeFontFix, startUpParams.ChromeFontFixApplicationDataFolder); return true; } if (startUpParams.EnableAutoStart || startUpParams.DisableAutoStart) @@ -353,6 +354,9 @@ namespace ColorControl { //services.AddSingleton(); services.RegisterSharedServices(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); }); } private static async Task RunService(string[] args) @@ -377,6 +381,7 @@ namespace ColorControl private static void RegisterSharedServices(this IServiceCollection services) { services.AddSingleton(); + services.AddSingleton(); } public static int EnumThreadWindows(IntPtr handle, IntPtr param) diff --git a/ColorControl/Services/Common/GraphicsService.cs b/ColorControl/Services/Common/GraphicsService.cs index 79063cc..8547d78 100644 --- a/ColorControl/Services/Common/GraphicsService.cs +++ b/ColorControl/Services/Common/GraphicsService.cs @@ -87,8 +87,9 @@ namespace ColorControl.Services.Common DEVMODEA devMode; while (NativeMethods.EnumDisplaySettingsA(displayName, i, out devMode)) { - if ((!portrait && devMode.dmPelsWidth == horizontal && devMode.dmPelsHeight == vertical) || - (portrait && devMode.dmPelsWidth == vertical && devMode.dmPelsHeight == horizontal)) + if (((!portrait && devMode.dmPelsWidth == horizontal && devMode.dmPelsHeight == vertical) || + (portrait && devMode.dmPelsWidth == vertical && devMode.dmPelsHeight == horizontal)) && + !list.Contains(devMode.dmDisplayFrequency)) { list.Add(devMode.dmDisplayFrequency); } diff --git a/ColorControl/Services/EventDispatcher/EventDispatcher.cs b/ColorControl/Services/EventDispatcher/EventDispatcher.cs new file mode 100644 index 0000000..71476da --- /dev/null +++ b/ColorControl/Services/EventDispatcher/EventDispatcher.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using static ColorControl.Services.EventDispatcher.EventExtensions; + +namespace ColorControl.Services.EventDispatcher; + +public class EventDispatcher where T : EventArgs +{ + private Dictionary> eventHandlers = new Dictionary>(); + private Dictionary> asyncEventHandlers = new Dictionary>(); + + public void RegisterEventHandler(string eventName, EventHandler eventHandler) + { + if (!eventHandlers.ContainsKey(eventName)) + { + eventHandlers.Add(eventName, eventHandler); + } + } + + public void RegisterAsyncEventHandler(string eventName, AsyncEventHandler eventHandler) + { + if (!asyncEventHandlers.ContainsKey(eventName)) + { + asyncEventHandlers.Add(eventName, eventHandler); + } + } + + public void UnregisterEventHandler(string eventName) + { + eventHandlers.Remove(eventName); + } + + public void DispatchEvent(string eventName, T eventArgs) + { + if (eventHandlers.ContainsKey(eventName)) + { + eventHandlers[eventName]?.Invoke(this, eventArgs); + } + } + + public async Task DispatchEventAsync(string eventName, T eventArgs) + { + if (asyncEventHandlers.ContainsKey(eventName)) + { + await asyncEventHandlers[eventName]?.InvokeAsync(this, eventArgs); + } + } + + protected bool HasHandlers(string eventName) + { + return eventHandlers.ContainsKey(eventName) || asyncEventHandlers.ContainsKey(eventName); + } +} diff --git a/ColorControl/Services/EventDispatcher/EventExtensions.cs b/ColorControl/Services/EventDispatcher/EventExtensions.cs new file mode 100644 index 0000000..071da6d --- /dev/null +++ b/ColorControl/Services/EventDispatcher/EventExtensions.cs @@ -0,0 +1,17 @@ +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace ColorControl.Services.EventDispatcher +{ + public static class EventExtensions + { + public delegate Task AsyncEventHandler(object sender, TEventArgs e, CancellationToken token); + + public static Task InvokeAsync(this AsyncEventHandler func, object sender, TArgs e) + { + return func == null ? Task.CompletedTask + : Task.WhenAll(func.GetInvocationList().Cast>().Select(f => f(sender, e, CancellationToken.None))); + } + } +} diff --git a/ColorControl/Services/EventDispatcher/PowerEventDispatcher.cs b/ColorControl/Services/EventDispatcher/PowerEventDispatcher.cs new file mode 100644 index 0000000..0728997 --- /dev/null +++ b/ColorControl/Services/EventDispatcher/PowerEventDispatcher.cs @@ -0,0 +1,27 @@ +using Microsoft.Win32; + +namespace ColorControl.Services.EventDispatcher +{ + public class PowerEventDispatcher : EventDispatcher + { + public const string Event_Suspend = "Suspend"; + public const string Event_Resume = "Resume"; + + public PowerEventDispatcher() + { + SystemEvents.PowerModeChanged += OnPowerModeChanged; + } + + private void OnPowerModeChanged(object sender, PowerModeChangedEventArgs e) + { + if (e.Mode == PowerModes.Suspend) + { + DispatchEvent(Event_Suspend, e); + } + else if (e.Mode == PowerModes.Resume) + { + DispatchEvent(Event_Resume, e); + } + } + } +} diff --git a/ColorControl/Services/EventDispatcher/ProcessEventDispatcher.cs b/ColorControl/Services/EventDispatcher/ProcessEventDispatcher.cs new file mode 100644 index 0000000..63b1b18 --- /dev/null +++ b/ColorControl/Services/EventDispatcher/ProcessEventDispatcher.cs @@ -0,0 +1,119 @@ +using ColorControl.Common; +using ColorControl.Forms; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Management; +using System.Threading.Tasks; + +namespace ColorControl.Services.EventDispatcher +{ + public class ProcessChangedEventArgs : EventArgs + { + public IList StartedProcesses { get; set; } + public IList StoppedProcesses { get; set; } + public IList RunningProcesses { get; set; } + public bool IsNotificationDisabled { get; set; } + public Process ForegroundProcess { get; set; } + public bool ForegroundProcessIsFullScreen { get; set; } + public string LastFullScreenProcessName = string.Empty; + public bool StoppedFullScreen { get; set; } + public bool IsScreenSaverActive { get; set; } + } + + + public class ProcessEventDispatcher : EventDispatcher + { + public const string Event_ProcessChanged = "ProcessChanged"; + public bool IsRunning { get; set; } + + protected static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); + + private ProcessChangedEventArgs MonitorContext { get; set; } + + public ProcessEventDispatcher() + { + IsRunning = true; + + var _ = CheckProcesses(); + } + + private async Task CheckProcesses() + { + await Task.Delay(2000); + + //var startWatch = new ManagementEventWatcher("SELECT * FROM Win32_ProcessStartTrace"); + //startWatch.EventArrived += startWatch_EventArrived; + //startWatch.Start(); + + MonitorContext ??= new ProcessChangedEventArgs(); + //Process[] lastProcesses = null; + + while (IsRunning) + { + await Task.Delay(1000); + + if (!HasHandlers(Event_ProcessChanged)) + { + continue; + } + + try + { + FillContext(MonitorContext); + + // Ignore if own process has the foreground + if (MonitorContext.ForegroundProcess?.Id == Environment.ProcessId) + { + continue; + } + + await DispatchEventAsync(Event_ProcessChanged, MonitorContext); + } + catch (Exception ex) + { + Logger.Error("CheckProcesses: " + ex.ToLogString()); + } + } + } + + private void FillContext(ProcessChangedEventArgs context) + { + var processes = Process.GetProcesses(); + + context.RunningProcesses = processes; + + context.IsNotificationDisabled = FormUtils.IsNotificationDisabled(); + + var (processId, isFullScreen) = FormUtils.GetForegroundProcessIdAndIfFullScreen(); + + if (processId > 0) + { + var process = context.RunningProcesses.FirstOrDefault(p => p.Id == processId); + + context.IsScreenSaverActive = process?.ProcessName?.Contains(".scr") == true; + context.ForegroundProcess = process; + context.ForegroundProcessIsFullScreen = isFullScreen; + + if (isFullScreen) + { + context.LastFullScreenProcessName = context.ForegroundProcess.ProcessName; + //Logger.Debug($"Foreground fullscreen app detected: {context.ForegroundProcess.ProcessName}"); + } + } + else + { + context.StoppedFullScreen = context.ForegroundProcessIsFullScreen; + context.ForegroundProcess = null; + context.ForegroundProcessIsFullScreen = false; + context.LastFullScreenProcessName = string.Empty; + } + } + + private void startWatch_EventArrived(object sender, EventArrivedEventArgs e) + { + //Logger.Debug("Process started: " + e.NewEvent.Properties["ProcessName"].Value); + } + } +} diff --git a/ColorControl/Native/UserSessionInfo.cs b/ColorControl/Services/EventDispatcher/SessionSwitchDispatcher.cs similarity index 59% rename from ColorControl/Native/UserSessionInfo.cs rename to ColorControl/Services/EventDispatcher/SessionSwitchDispatcher.cs index e756f8b..413ae9b 100644 --- a/ColorControl/Native/UserSessionInfo.cs +++ b/ColorControl/Services/EventDispatcher/SessionSwitchDispatcher.cs @@ -1,29 +1,29 @@ using Microsoft.Win32; -namespace ColorControl +namespace ColorControl.Services.EventDispatcher { - static class UserSessionInfo + public class SessionSwitchDispatcher : EventDispatcher { + public const string Event_SessionSwitch = "SessionSwitch"; + private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); - public static bool UserLocalSession { get; private set; } = true; - public static SessionSwitchReason LastSessionSwitchReason { get; private set; } = 0; + public bool UserLocalSession { get; private set; } = true; + public SessionSwitchReason LastSessionSwitchReason { get; private set; } = 0; - public delegate void UserSessionSwitchHandler(bool toLocal); - public static event UserSessionSwitchHandler UserSessionSwitch; - - public static void Install() + public SessionSwitchDispatcher() { SystemEvents.SessionSwitch += SessionSwitchHandler; } - public static void SessionSwitchHandler(object sender, SessionSwitchEventArgs evt) + public void SessionSwitchHandler(object sender, SessionSwitchEventArgs evt) { if (evt.Reason == SessionSwitchReason.ConsoleDisconnect) { Logger.Debug("Detected a disconnect from the console"); UserLocalSession = false; - UserSessionSwitch(false); + + DispatchEvent(Event_SessionSwitch, evt); } else if (evt.Reason == SessionSwitchReason.ConsoleConnect) { @@ -32,7 +32,7 @@ namespace ColorControl { Logger.Debug("Session state switched to local"); UserLocalSession = true; - UserSessionSwitch(true); + DispatchEvent(Event_SessionSwitch, evt); } } LastSessionSwitchReason = evt.Reason; diff --git a/ColorControl/Services/LG/LgDevice.cs b/ColorControl/Services/LG/LgDevice.cs index ab1e4a6..52e959b 100644 --- a/ColorControl/Services/LG/LgDevice.cs +++ b/ColorControl/Services/LG/LgDevice.cs @@ -61,7 +61,8 @@ namespace ColorControl.Services.LG Series2019, Series2020, Series2021, - Series2022 + Series2022, + Series2023 } protected static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); @@ -80,6 +81,7 @@ namespace ColorControl.Services.LG public bool PowerOffOnShutdown { get; set; } public bool PowerOffOnStandby { get; set; } public bool PowerOffOnScreenSaver { get; set; } + public int ScreenSaverMinimalDuration { get; set; } public bool PowerOnAfterScreenSaver { get; set; } public bool PowerOnAfterManualPowerOff { get; set; } public bool PowerOnByWindows { get; set; } @@ -143,6 +145,9 @@ namespace ColorControl.Services.LG public event EventHandler PictureSettingsChangedEvent; public event EventHandler PowerStateChangedEvent; + [JsonIgnore] + private Timer _powerOffTimer; + [JsonConstructor] public LgDevice(string name, string ipAddress, string macAddress, bool isCustom = true, bool isDummy = false) { @@ -256,6 +261,11 @@ namespace ColorControl.Services.LG AddGenericPictureAction("wolwowlOnOff", typeof(FalseToTrue), category: "network", title: "Wake-On-LAN"); } + ~LgDevice() + { + _powerOffTimer?.Dispose(); + } + private void AddInvokableAction(string name, Func, bool> function) { var action = new InvokableAction @@ -430,6 +440,7 @@ namespace ColorControl.Services.LG 'X' => ModelYear.Series2020, '1' => ModelYear.Series2021, '2' => ModelYear.Series2022, + '3' => ModelYear.Series2023, _ => ModelYear.None }; @@ -1083,5 +1094,23 @@ namespace ColorControl.Services.LG } } } + + internal void ClearPowerOffTask() + { + _powerOffTimer?.Dispose(); + } + + internal void PowerOffIn(int seconds) + { + _powerOffTimer = new Timer(PowerOffByTimer); + _powerOffTimer.Change(TimeSpan.FromSeconds(seconds), TimeSpan.FromSeconds(seconds)); + } + + private void PowerOffByTimer(object state) + { + _powerOffTimer?.Dispose(); + + var _ = PowerOff(true); + } } } diff --git a/ColorControl/Services/LG/LgPanel.Designer.cs b/ColorControl/Services/LG/LgPanel.Designer.cs index 6cc86b0..10a2759 100644 --- a/ColorControl/Services/LG/LgPanel.Designer.cs +++ b/ColorControl/Services/LG/LgPanel.Designer.cs @@ -28,837 +28,819 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.scLgController = new System.Windows.Forms.SplitContainer(); - this.btnLgSettings = new System.Windows.Forms.Button(); - this.chkLgQuickAccess = new System.Windows.Forms.CheckBox(); - this.cbxLgPcHdmiPort = new System.Windows.Forms.ComboBox(); - this.lblLgPcHdmiPort = new System.Windows.Forms.Label(); - this.edtLgPresetDescription = new System.Windows.Forms.TextBox(); - this.lblLgPresetDescription = new System.Windows.Forms.Label(); - this.btnLgDeviceOptionsHelp = new System.Windows.Forms.Button(); - this.btnLgGameBar = new System.Windows.Forms.Button(); - this.btnLgPresetEditTriggerConditions = new System.Windows.Forms.Button(); - this.edtLgPresetTriggerConditions = new System.Windows.Forms.TextBox(); - this.lblLgPresetExcludedProcesses = new System.Windows.Forms.Label(); - this.edtLgPresetExcludedProcesses = new System.Windows.Forms.TextBox(); - this.lblLgPresetIncludedProcesses = new System.Windows.Forms.Label(); - this.edtLgPresetIncludedProcesses = new System.Windows.Forms.TextBox(); - this.lblLgPresetTriggerCondition = new System.Windows.Forms.Label(); - this.cbxLgPresetTrigger = new System.Windows.Forms.ComboBox(); - this.lblLgPresetTrigger = new System.Windows.Forms.Label(); - this.btnLgExpert = new System.Windows.Forms.Button(); - this.mnuLgExpert = new System.Windows.Forms.ContextMenuStrip(this.components); - this.mnuLgOLEDMotionPro = new System.Windows.Forms.ToolStripMenuItem(); - this.miLgEnableMotionPro = new System.Windows.Forms.ToolStripMenuItem(); - this.miLgDisableMotionPro = new System.Windows.Forms.ToolStripMenuItem(); - this.miLgExpertSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.chkLgRemoteControlShow = new System.Windows.Forms.CheckBox(); - this.label3 = new System.Windows.Forms.Label(); - this.cbxLgDevices = new System.Windows.Forms.ComboBox(); - this.btnLgDeviceConvertToCustom = new System.Windows.Forms.Button(); - this.cbxLgApps = new System.Windows.Forms.ComboBox(); - this.lvLgPresets = new System.Windows.Forms.ListView(); - this.label5 = new System.Windows.Forms.Label(); - this.cbxLgPresetDevice = new System.Windows.Forms.ComboBox(); - this.btnDeleteLg = new System.Windows.Forms.Button(); - this.btnApplyLg = new System.Windows.Forms.Button(); - this.lblDeviceFilter = new System.Windows.Forms.Label(); - this.lblLgPresetDevice = new System.Windows.Forms.Label(); - this.btnAddLg = new System.Windows.Forms.Button(); - this.edtShortcutLg = new System.Windows.Forms.TextBox(); - this.edtLgDeviceFilter = new System.Windows.Forms.TextBox(); - this.btnLgRemoveDevice = new System.Windows.Forms.Button(); - this.btnLgRefreshApps = new System.Windows.Forms.Button(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.btnLgAddDevice = new System.Windows.Forms.Button(); - this.edtNameLg = new System.Windows.Forms.TextBox(); - this.btnSetShortcutLg = new System.Windows.Forms.Button(); - this.edtStepsLg = new System.Windows.Forms.TextBox(); - this.btnLgAddButton = new System.Windows.Forms.Button(); - this.mnuLgButtons = new System.Windows.Forms.ContextMenuStrip(this.components); - this.mnuLgRcButtons = new System.Windows.Forms.ToolStripMenuItem(); - this.mnuLgActions = new System.Windows.Forms.ToolStripMenuItem(); - this.mnuLgNvPresets = new System.Windows.Forms.ToolStripMenuItem(); - this.mnuLgAmdPresets = new System.Windows.Forms.ToolStripMenuItem(); - this.mnuLgProgram = new System.Windows.Forms.ToolStripMenuItem(); - this.btnCloneLg = new System.Windows.Forms.Button(); - this.lblStepsLg = new System.Windows.Forms.Label(); - this.btnLgDeviceFilterRefresh = new System.Windows.Forms.Button(); - this.clbLgPower = new System.Windows.Forms.CheckedListBox(); - this.lblLgError = new System.Windows.Forms.Label(); - this.mnuLgSettings = new System.Windows.Forms.ContextMenuStrip(this.components); - this.miTestPowerOffOn = new System.Windows.Forms.ToolStripMenuItem(); - this.miNvSettings = new System.Windows.Forms.ToolStripMenuItem(); - ((System.ComponentModel.ISupportInitialize)(this.scLgController)).BeginInit(); - this.scLgController.Panel1.SuspendLayout(); - this.scLgController.SuspendLayout(); - this.mnuLgExpert.SuspendLayout(); - this.mnuLgButtons.SuspendLayout(); - this.mnuLgSettings.SuspendLayout(); - this.SuspendLayout(); + components = new System.ComponentModel.Container(); + scLgController = new System.Windows.Forms.SplitContainer(); + btnLgDeviceOptionsSettings = new System.Windows.Forms.Button(); + btnLgSettings = new System.Windows.Forms.Button(); + chkLgQuickAccess = new System.Windows.Forms.CheckBox(); + cbxLgPcHdmiPort = new System.Windows.Forms.ComboBox(); + lblLgPcHdmiPort = new System.Windows.Forms.Label(); + edtLgPresetDescription = new System.Windows.Forms.TextBox(); + lblLgPresetDescription = new System.Windows.Forms.Label(); + btnLgDeviceOptionsHelp = new System.Windows.Forms.Button(); + btnLgGameBar = new System.Windows.Forms.Button(); + btnLgPresetEditTriggerConditions = new System.Windows.Forms.Button(); + edtLgPresetTriggerConditions = new System.Windows.Forms.TextBox(); + lblLgPresetExcludedProcesses = new System.Windows.Forms.Label(); + edtLgPresetExcludedProcesses = new System.Windows.Forms.TextBox(); + lblLgPresetIncludedProcesses = new System.Windows.Forms.Label(); + edtLgPresetIncludedProcesses = new System.Windows.Forms.TextBox(); + lblLgPresetTriggerCondition = new System.Windows.Forms.Label(); + cbxLgPresetTrigger = new System.Windows.Forms.ComboBox(); + lblLgPresetTrigger = new System.Windows.Forms.Label(); + btnLgExpert = new System.Windows.Forms.Button(); + mnuLgExpert = new System.Windows.Forms.ContextMenuStrip(components); + mnuLgOLEDMotionPro = new System.Windows.Forms.ToolStripMenuItem(); + miLgEnableMotionPro = new System.Windows.Forms.ToolStripMenuItem(); + miLgDisableMotionPro = new System.Windows.Forms.ToolStripMenuItem(); + miLgExpertSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + chkLgRemoteControlShow = new System.Windows.Forms.CheckBox(); + label3 = new System.Windows.Forms.Label(); + cbxLgDevices = new System.Windows.Forms.ComboBox(); + btnLgDeviceConvertToCustom = new System.Windows.Forms.Button(); + cbxLgApps = new System.Windows.Forms.ComboBox(); + lvLgPresets = new System.Windows.Forms.ListView(); + label5 = new System.Windows.Forms.Label(); + cbxLgPresetDevice = new System.Windows.Forms.ComboBox(); + btnDeleteLg = new System.Windows.Forms.Button(); + btnApplyLg = new System.Windows.Forms.Button(); + lblDeviceFilter = new System.Windows.Forms.Label(); + lblLgPresetDevice = new System.Windows.Forms.Label(); + btnAddLg = new System.Windows.Forms.Button(); + edtShortcutLg = new System.Windows.Forms.TextBox(); + edtLgDeviceFilter = new System.Windows.Forms.TextBox(); + btnLgRemoveDevice = new System.Windows.Forms.Button(); + btnLgRefreshApps = new System.Windows.Forms.Button(); + label2 = new System.Windows.Forms.Label(); + label1 = new System.Windows.Forms.Label(); + btnLgAddDevice = new System.Windows.Forms.Button(); + edtNameLg = new System.Windows.Forms.TextBox(); + btnSetShortcutLg = new System.Windows.Forms.Button(); + edtStepsLg = new System.Windows.Forms.TextBox(); + btnLgAddButton = new System.Windows.Forms.Button(); + mnuLgButtons = new System.Windows.Forms.ContextMenuStrip(components); + mnuLgRcButtons = new System.Windows.Forms.ToolStripMenuItem(); + mnuLgActions = new System.Windows.Forms.ToolStripMenuItem(); + mnuLgNvPresets = new System.Windows.Forms.ToolStripMenuItem(); + mnuLgAmdPresets = new System.Windows.Forms.ToolStripMenuItem(); + mnuLgProgram = new System.Windows.Forms.ToolStripMenuItem(); + btnCloneLg = new System.Windows.Forms.Button(); + lblStepsLg = new System.Windows.Forms.Label(); + btnLgDeviceFilterRefresh = new System.Windows.Forms.Button(); + clbLgPower = new System.Windows.Forms.CheckedListBox(); + lblLgError = new System.Windows.Forms.Label(); + mnuLgSettings = new System.Windows.Forms.ContextMenuStrip(components); + miTestPowerOffOn = new System.Windows.Forms.ToolStripMenuItem(); + miNvSettings = new System.Windows.Forms.ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)scLgController).BeginInit(); + scLgController.Panel1.SuspendLayout(); + scLgController.SuspendLayout(); + mnuLgExpert.SuspendLayout(); + mnuLgButtons.SuspendLayout(); + mnuLgSettings.SuspendLayout(); + SuspendLayout(); // // scLgController // - this.scLgController.Dock = System.Windows.Forms.DockStyle.Fill; - this.scLgController.Location = new System.Drawing.Point(0, 0); - this.scLgController.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.scLgController.Name = "scLgController"; + scLgController.Dock = System.Windows.Forms.DockStyle.Fill; + scLgController.Location = new System.Drawing.Point(0, 0); + scLgController.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + scLgController.Name = "scLgController"; // // scLgController.Panel1 // - this.scLgController.Panel1.Controls.Add(this.btnLgSettings); - this.scLgController.Panel1.Controls.Add(this.chkLgQuickAccess); - this.scLgController.Panel1.Controls.Add(this.cbxLgPcHdmiPort); - this.scLgController.Panel1.Controls.Add(this.lblLgPcHdmiPort); - this.scLgController.Panel1.Controls.Add(this.edtLgPresetDescription); - this.scLgController.Panel1.Controls.Add(this.lblLgPresetDescription); - this.scLgController.Panel1.Controls.Add(this.btnLgDeviceOptionsHelp); - this.scLgController.Panel1.Controls.Add(this.btnLgGameBar); - this.scLgController.Panel1.Controls.Add(this.btnLgPresetEditTriggerConditions); - this.scLgController.Panel1.Controls.Add(this.edtLgPresetTriggerConditions); - this.scLgController.Panel1.Controls.Add(this.lblLgPresetExcludedProcesses); - this.scLgController.Panel1.Controls.Add(this.edtLgPresetExcludedProcesses); - this.scLgController.Panel1.Controls.Add(this.lblLgPresetIncludedProcesses); - this.scLgController.Panel1.Controls.Add(this.edtLgPresetIncludedProcesses); - this.scLgController.Panel1.Controls.Add(this.lblLgPresetTriggerCondition); - this.scLgController.Panel1.Controls.Add(this.cbxLgPresetTrigger); - this.scLgController.Panel1.Controls.Add(this.lblLgPresetTrigger); - this.scLgController.Panel1.Controls.Add(this.btnLgExpert); - this.scLgController.Panel1.Controls.Add(this.chkLgRemoteControlShow); - this.scLgController.Panel1.Controls.Add(this.label3); - this.scLgController.Panel1.Controls.Add(this.cbxLgDevices); - this.scLgController.Panel1.Controls.Add(this.btnLgDeviceConvertToCustom); - this.scLgController.Panel1.Controls.Add(this.cbxLgApps); - this.scLgController.Panel1.Controls.Add(this.lvLgPresets); - this.scLgController.Panel1.Controls.Add(this.label5); - this.scLgController.Panel1.Controls.Add(this.cbxLgPresetDevice); - this.scLgController.Panel1.Controls.Add(this.btnDeleteLg); - this.scLgController.Panel1.Controls.Add(this.btnApplyLg); - this.scLgController.Panel1.Controls.Add(this.lblDeviceFilter); - this.scLgController.Panel1.Controls.Add(this.lblLgPresetDevice); - this.scLgController.Panel1.Controls.Add(this.btnAddLg); - this.scLgController.Panel1.Controls.Add(this.edtShortcutLg); - this.scLgController.Panel1.Controls.Add(this.edtLgDeviceFilter); - this.scLgController.Panel1.Controls.Add(this.btnLgRemoveDevice); - this.scLgController.Panel1.Controls.Add(this.btnLgRefreshApps); - this.scLgController.Panel1.Controls.Add(this.label2); - this.scLgController.Panel1.Controls.Add(this.label1); - this.scLgController.Panel1.Controls.Add(this.btnLgAddDevice); - this.scLgController.Panel1.Controls.Add(this.edtNameLg); - this.scLgController.Panel1.Controls.Add(this.btnSetShortcutLg); - this.scLgController.Panel1.Controls.Add(this.edtStepsLg); - this.scLgController.Panel1.Controls.Add(this.btnLgAddButton); - this.scLgController.Panel1.Controls.Add(this.btnCloneLg); - this.scLgController.Panel1.Controls.Add(this.lblStepsLg); - this.scLgController.Panel1.Controls.Add(this.btnLgDeviceFilterRefresh); - this.scLgController.Panel1.Controls.Add(this.clbLgPower); - this.scLgController.Panel1.Controls.Add(this.lblLgError); - this.scLgController.Panel1MinSize = 750; - this.scLgController.Panel2MinSize = 150; - this.scLgController.Size = new System.Drawing.Size(1114, 539); - this.scLgController.SplitterDistance = 899; - this.scLgController.SplitterWidth = 5; - this.scLgController.TabIndex = 43; + scLgController.Panel1.Controls.Add(btnLgDeviceOptionsSettings); + scLgController.Panel1.Controls.Add(btnLgSettings); + scLgController.Panel1.Controls.Add(chkLgQuickAccess); + scLgController.Panel1.Controls.Add(cbxLgPcHdmiPort); + scLgController.Panel1.Controls.Add(lblLgPcHdmiPort); + scLgController.Panel1.Controls.Add(edtLgPresetDescription); + scLgController.Panel1.Controls.Add(lblLgPresetDescription); + scLgController.Panel1.Controls.Add(btnLgDeviceOptionsHelp); + scLgController.Panel1.Controls.Add(btnLgGameBar); + scLgController.Panel1.Controls.Add(btnLgPresetEditTriggerConditions); + scLgController.Panel1.Controls.Add(edtLgPresetTriggerConditions); + scLgController.Panel1.Controls.Add(lblLgPresetExcludedProcesses); + scLgController.Panel1.Controls.Add(edtLgPresetExcludedProcesses); + scLgController.Panel1.Controls.Add(lblLgPresetIncludedProcesses); + scLgController.Panel1.Controls.Add(edtLgPresetIncludedProcesses); + scLgController.Panel1.Controls.Add(lblLgPresetTriggerCondition); + scLgController.Panel1.Controls.Add(cbxLgPresetTrigger); + scLgController.Panel1.Controls.Add(lblLgPresetTrigger); + scLgController.Panel1.Controls.Add(btnLgExpert); + scLgController.Panel1.Controls.Add(chkLgRemoteControlShow); + scLgController.Panel1.Controls.Add(label3); + scLgController.Panel1.Controls.Add(cbxLgDevices); + scLgController.Panel1.Controls.Add(btnLgDeviceConvertToCustom); + scLgController.Panel1.Controls.Add(cbxLgApps); + scLgController.Panel1.Controls.Add(lvLgPresets); + scLgController.Panel1.Controls.Add(label5); + scLgController.Panel1.Controls.Add(cbxLgPresetDevice); + scLgController.Panel1.Controls.Add(btnDeleteLg); + scLgController.Panel1.Controls.Add(btnApplyLg); + scLgController.Panel1.Controls.Add(lblDeviceFilter); + scLgController.Panel1.Controls.Add(lblLgPresetDevice); + scLgController.Panel1.Controls.Add(btnAddLg); + scLgController.Panel1.Controls.Add(edtShortcutLg); + scLgController.Panel1.Controls.Add(edtLgDeviceFilter); + scLgController.Panel1.Controls.Add(btnLgRemoveDevice); + scLgController.Panel1.Controls.Add(btnLgRefreshApps); + scLgController.Panel1.Controls.Add(label2); + scLgController.Panel1.Controls.Add(label1); + scLgController.Panel1.Controls.Add(btnLgAddDevice); + scLgController.Panel1.Controls.Add(edtNameLg); + scLgController.Panel1.Controls.Add(btnSetShortcutLg); + scLgController.Panel1.Controls.Add(edtStepsLg); + scLgController.Panel1.Controls.Add(btnLgAddButton); + scLgController.Panel1.Controls.Add(btnCloneLg); + scLgController.Panel1.Controls.Add(lblStepsLg); + scLgController.Panel1.Controls.Add(btnLgDeviceFilterRefresh); + scLgController.Panel1.Controls.Add(clbLgPower); + scLgController.Panel1.Controls.Add(lblLgError); + scLgController.Panel1MinSize = 750; + scLgController.Panel2MinSize = 150; + scLgController.Size = new System.Drawing.Size(1114, 539); + scLgController.SplitterDistance = 899; + scLgController.SplitterWidth = 5; + scLgController.TabIndex = 43; + // + // btnLgDeviceOptionsSettings + // + btnLgDeviceOptionsSettings.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnLgDeviceOptionsSettings.Enabled = false; + btnLgDeviceOptionsSettings.Location = new System.Drawing.Point(872, 103); + btnLgDeviceOptionsSettings.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgDeviceOptionsSettings.Name = "btnLgDeviceOptionsSettings"; + btnLgDeviceOptionsSettings.Size = new System.Drawing.Size(22, 27); + btnLgDeviceOptionsSettings.TabIndex = 65; + btnLgDeviceOptionsSettings.Text = "S"; + btnLgDeviceOptionsSettings.UseVisualStyleBackColor = true; + btnLgDeviceOptionsSettings.Click += btnLgDeviceOptionsSettings_Click; // // btnLgSettings // - this.btnLgSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnLgSettings.Location = new System.Drawing.Point(807, 284); - this.btnLgSettings.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgSettings.Name = "btnLgSettings"; - this.btnLgSettings.Size = new System.Drawing.Size(88, 27); - this.btnLgSettings.TabIndex = 64; - this.btnLgSettings.Text = "Settings..."; - this.btnLgSettings.UseVisualStyleBackColor = true; - this.btnLgSettings.Click += new System.EventHandler(this.btnLgSettings_Click); + btnLgSettings.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + btnLgSettings.Location = new System.Drawing.Point(807, 284); + btnLgSettings.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgSettings.Name = "btnLgSettings"; + btnLgSettings.Size = new System.Drawing.Size(88, 27); + btnLgSettings.TabIndex = 64; + btnLgSettings.Text = "Settings..."; + btnLgSettings.UseVisualStyleBackColor = true; + btnLgSettings.Click += btnLgSettings_Click; // // chkLgQuickAccess // - this.chkLgQuickAccess.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.chkLgQuickAccess.AutoSize = true; - this.chkLgQuickAccess.Enabled = false; - this.chkLgQuickAccess.Location = new System.Drawing.Point(341, 320); - this.chkLgQuickAccess.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.chkLgQuickAccess.Name = "chkLgQuickAccess"; - this.chkLgQuickAccess.Size = new System.Drawing.Size(96, 19); - this.chkLgQuickAccess.TabIndex = 63; - this.chkLgQuickAccess.Text = "Quick Access"; - this.chkLgQuickAccess.UseVisualStyleBackColor = true; + chkLgQuickAccess.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + chkLgQuickAccess.AutoSize = true; + chkLgQuickAccess.Enabled = false; + chkLgQuickAccess.Location = new System.Drawing.Point(341, 320); + chkLgQuickAccess.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + chkLgQuickAccess.Name = "chkLgQuickAccess"; + chkLgQuickAccess.Size = new System.Drawing.Size(96, 19); + chkLgQuickAccess.TabIndex = 63; + chkLgQuickAccess.Text = "Quick Access"; + chkLgQuickAccess.UseVisualStyleBackColor = true; // // cbxLgPcHdmiPort // - this.cbxLgPcHdmiPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxLgPcHdmiPort.FormattingEnabled = true; - this.cbxLgPcHdmiPort.Items.AddRange(new object[] { - "None", - "HDMI1", - "HDMI2", - "HDMI3", - "HDMI4"}); - this.cbxLgPcHdmiPort.Location = new System.Drawing.Point(667, 42); - this.cbxLgPcHdmiPort.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cbxLgPcHdmiPort.Name = "cbxLgPcHdmiPort"; - this.cbxLgPcHdmiPort.Size = new System.Drawing.Size(86, 23); - this.cbxLgPcHdmiPort.TabIndex = 62; - this.cbxLgPcHdmiPort.SelectedIndexChanged += new System.EventHandler(this.cbxLgPcHdmiPort_SelectedIndexChanged); + cbxLgPcHdmiPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + cbxLgPcHdmiPort.FormattingEnabled = true; + cbxLgPcHdmiPort.Items.AddRange(new object[] { "None", "HDMI1", "HDMI2", "HDMI3", "HDMI4" }); + cbxLgPcHdmiPort.Location = new System.Drawing.Point(667, 42); + cbxLgPcHdmiPort.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cbxLgPcHdmiPort.Name = "cbxLgPcHdmiPort"; + cbxLgPcHdmiPort.Size = new System.Drawing.Size(86, 23); + cbxLgPcHdmiPort.TabIndex = 62; + cbxLgPcHdmiPort.SelectedIndexChanged += cbxLgPcHdmiPort_SelectedIndexChanged; // // lblLgPcHdmiPort // - this.lblLgPcHdmiPort.AutoSize = true; - this.lblLgPcHdmiPort.Location = new System.Drawing.Point(577, 45); - this.lblLgPcHdmiPort.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblLgPcHdmiPort.Name = "lblLgPcHdmiPort"; - this.lblLgPcHdmiPort.Size = new System.Drawing.Size(84, 15); - this.lblLgPcHdmiPort.TabIndex = 61; - this.lblLgPcHdmiPort.Text = "PC HDMI port:"; + lblLgPcHdmiPort.AutoSize = true; + lblLgPcHdmiPort.Location = new System.Drawing.Point(577, 45); + lblLgPcHdmiPort.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblLgPcHdmiPort.Name = "lblLgPcHdmiPort"; + lblLgPcHdmiPort.Size = new System.Drawing.Size(84, 15); + lblLgPcHdmiPort.TabIndex = 61; + lblLgPcHdmiPort.Text = "PC HDMI port:"; // // edtLgPresetDescription // - this.edtLgPresetDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.edtLgPresetDescription.Enabled = false; - this.edtLgPresetDescription.Location = new System.Drawing.Point(100, 489); - this.edtLgPresetDescription.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.edtLgPresetDescription.Multiline = true; - this.edtLgPresetDescription.Name = "edtLgPresetDescription"; - this.edtLgPresetDescription.Size = new System.Drawing.Size(699, 43); - this.edtLgPresetDescription.TabIndex = 60; + edtLgPresetDescription.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + edtLgPresetDescription.Enabled = false; + edtLgPresetDescription.Location = new System.Drawing.Point(100, 489); + edtLgPresetDescription.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + edtLgPresetDescription.Multiline = true; + edtLgPresetDescription.Name = "edtLgPresetDescription"; + edtLgPresetDescription.Size = new System.Drawing.Size(699, 43); + edtLgPresetDescription.TabIndex = 60; // // lblLgPresetDescription // - this.lblLgPresetDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.lblLgPresetDescription.AutoSize = true; - this.lblLgPresetDescription.Location = new System.Drawing.Point(6, 494); - this.lblLgPresetDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblLgPresetDescription.Name = "lblLgPresetDescription"; - this.lblLgPresetDescription.Size = new System.Drawing.Size(70, 15); - this.lblLgPresetDescription.TabIndex = 59; - this.lblLgPresetDescription.Text = "Description:"; + lblLgPresetDescription.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + lblLgPresetDescription.AutoSize = true; + lblLgPresetDescription.Location = new System.Drawing.Point(6, 494); + lblLgPresetDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblLgPresetDescription.Name = "lblLgPresetDescription"; + lblLgPresetDescription.Size = new System.Drawing.Size(70, 15); + lblLgPresetDescription.TabIndex = 59; + lblLgPresetDescription.Text = "Description:"; // // btnLgDeviceOptionsHelp // - this.btnLgDeviceOptionsHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnLgDeviceOptionsHelp.Location = new System.Drawing.Point(872, 70); - this.btnLgDeviceOptionsHelp.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgDeviceOptionsHelp.Name = "btnLgDeviceOptionsHelp"; - this.btnLgDeviceOptionsHelp.Size = new System.Drawing.Size(22, 27); - this.btnLgDeviceOptionsHelp.TabIndex = 58; - this.btnLgDeviceOptionsHelp.Text = "?"; - this.btnLgDeviceOptionsHelp.UseVisualStyleBackColor = true; - this.btnLgDeviceOptionsHelp.Click += new System.EventHandler(this.btnLgDeviceOptionsHelp_Click); + btnLgDeviceOptionsHelp.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnLgDeviceOptionsHelp.Location = new System.Drawing.Point(872, 70); + btnLgDeviceOptionsHelp.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgDeviceOptionsHelp.Name = "btnLgDeviceOptionsHelp"; + btnLgDeviceOptionsHelp.Size = new System.Drawing.Size(22, 27); + btnLgDeviceOptionsHelp.TabIndex = 58; + btnLgDeviceOptionsHelp.Text = "?"; + btnLgDeviceOptionsHelp.UseVisualStyleBackColor = true; + btnLgDeviceOptionsHelp.Click += btnLgDeviceOptionsHelp_Click; // // btnLgGameBar // - this.btnLgGameBar.Location = new System.Drawing.Point(478, 40); - this.btnLgGameBar.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgGameBar.Name = "btnLgGameBar"; - this.btnLgGameBar.Size = new System.Drawing.Size(88, 27); - this.btnLgGameBar.TabIndex = 55; - this.btnLgGameBar.Text = "Game Bar"; - this.btnLgGameBar.UseVisualStyleBackColor = true; - this.btnLgGameBar.Click += new System.EventHandler(this.btnLgGameBar_Click); + btnLgGameBar.Location = new System.Drawing.Point(478, 40); + btnLgGameBar.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgGameBar.Name = "btnLgGameBar"; + btnLgGameBar.Size = new System.Drawing.Size(88, 27); + btnLgGameBar.TabIndex = 55; + btnLgGameBar.Text = "Game Bar"; + btnLgGameBar.UseVisualStyleBackColor = true; + btnLgGameBar.Click += btnLgGameBar_Click; // // btnLgPresetEditTriggerConditions // - this.btnLgPresetEditTriggerConditions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnLgPresetEditTriggerConditions.Enabled = false; - this.btnLgPresetEditTriggerConditions.Location = new System.Drawing.Point(804, 347); - this.btnLgPresetEditTriggerConditions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgPresetEditTriggerConditions.Name = "btnLgPresetEditTriggerConditions"; - this.btnLgPresetEditTriggerConditions.Size = new System.Drawing.Size(88, 27); - this.btnLgPresetEditTriggerConditions.TabIndex = 54; - this.btnLgPresetEditTriggerConditions.Text = "Edit..."; - this.btnLgPresetEditTriggerConditions.UseVisualStyleBackColor = true; - this.btnLgPresetEditTriggerConditions.Click += new System.EventHandler(this.btnLgPresetEditTriggerConditions_Click); + btnLgPresetEditTriggerConditions.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnLgPresetEditTriggerConditions.Enabled = false; + btnLgPresetEditTriggerConditions.Location = new System.Drawing.Point(804, 347); + btnLgPresetEditTriggerConditions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgPresetEditTriggerConditions.Name = "btnLgPresetEditTriggerConditions"; + btnLgPresetEditTriggerConditions.Size = new System.Drawing.Size(88, 27); + btnLgPresetEditTriggerConditions.TabIndex = 54; + btnLgPresetEditTriggerConditions.Text = "Edit..."; + btnLgPresetEditTriggerConditions.UseVisualStyleBackColor = true; + btnLgPresetEditTriggerConditions.Click += btnLgPresetEditTriggerConditions_Click; // // edtLgPresetTriggerConditions // - this.edtLgPresetTriggerConditions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.edtLgPresetTriggerConditions.Enabled = false; - this.edtLgPresetTriggerConditions.Location = new System.Drawing.Point(601, 349); - this.edtLgPresetTriggerConditions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.edtLgPresetTriggerConditions.Name = "edtLgPresetTriggerConditions"; - this.edtLgPresetTriggerConditions.ReadOnly = true; - this.edtLgPresetTriggerConditions.Size = new System.Drawing.Size(194, 23); - this.edtLgPresetTriggerConditions.TabIndex = 53; + edtLgPresetTriggerConditions.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + edtLgPresetTriggerConditions.Enabled = false; + edtLgPresetTriggerConditions.Location = new System.Drawing.Point(601, 349); + edtLgPresetTriggerConditions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + edtLgPresetTriggerConditions.Name = "edtLgPresetTriggerConditions"; + edtLgPresetTriggerConditions.ReadOnly = true; + edtLgPresetTriggerConditions.Size = new System.Drawing.Size(194, 23); + edtLgPresetTriggerConditions.TabIndex = 53; // // lblLgPresetExcludedProcesses // - this.lblLgPresetExcludedProcesses.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.lblLgPresetExcludedProcesses.AutoSize = true; - this.lblLgPresetExcludedProcesses.Location = new System.Drawing.Point(475, 414); - this.lblLgPresetExcludedProcesses.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblLgPresetExcludedProcesses.Name = "lblLgPresetExcludedProcesses"; - this.lblLgPresetExcludedProcesses.Size = new System.Drawing.Size(112, 15); - this.lblLgPresetExcludedProcesses.TabIndex = 52; - this.lblLgPresetExcludedProcesses.Text = "Excluded processes:"; + lblLgPresetExcludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + lblLgPresetExcludedProcesses.AutoSize = true; + lblLgPresetExcludedProcesses.Location = new System.Drawing.Point(475, 414); + lblLgPresetExcludedProcesses.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblLgPresetExcludedProcesses.Name = "lblLgPresetExcludedProcesses"; + lblLgPresetExcludedProcesses.Size = new System.Drawing.Size(112, 15); + lblLgPresetExcludedProcesses.TabIndex = 52; + lblLgPresetExcludedProcesses.Text = "Excluded processes:"; // // edtLgPresetExcludedProcesses // - this.edtLgPresetExcludedProcesses.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.edtLgPresetExcludedProcesses.Enabled = false; - this.edtLgPresetExcludedProcesses.Location = new System.Drawing.Point(601, 411); - this.edtLgPresetExcludedProcesses.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.edtLgPresetExcludedProcesses.Name = "edtLgPresetExcludedProcesses"; - this.edtLgPresetExcludedProcesses.Size = new System.Drawing.Size(289, 23); - this.edtLgPresetExcludedProcesses.TabIndex = 51; + edtLgPresetExcludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + edtLgPresetExcludedProcesses.Enabled = false; + edtLgPresetExcludedProcesses.Location = new System.Drawing.Point(601, 411); + edtLgPresetExcludedProcesses.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + edtLgPresetExcludedProcesses.Name = "edtLgPresetExcludedProcesses"; + edtLgPresetExcludedProcesses.Size = new System.Drawing.Size(289, 23); + edtLgPresetExcludedProcesses.TabIndex = 51; // // lblLgPresetIncludedProcesses // - this.lblLgPresetIncludedProcesses.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.lblLgPresetIncludedProcesses.AutoSize = true; - this.lblLgPresetIncludedProcesses.Location = new System.Drawing.Point(475, 384); - this.lblLgPresetIncludedProcesses.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblLgPresetIncludedProcesses.Name = "lblLgPresetIncludedProcesses"; - this.lblLgPresetIncludedProcesses.Size = new System.Drawing.Size(110, 15); - this.lblLgPresetIncludedProcesses.TabIndex = 50; - this.lblLgPresetIncludedProcesses.Text = "Included processes:"; + lblLgPresetIncludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + lblLgPresetIncludedProcesses.AutoSize = true; + lblLgPresetIncludedProcesses.Location = new System.Drawing.Point(475, 384); + lblLgPresetIncludedProcesses.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblLgPresetIncludedProcesses.Name = "lblLgPresetIncludedProcesses"; + lblLgPresetIncludedProcesses.Size = new System.Drawing.Size(110, 15); + lblLgPresetIncludedProcesses.TabIndex = 50; + lblLgPresetIncludedProcesses.Text = "Included processes:"; // // edtLgPresetIncludedProcesses // - this.edtLgPresetIncludedProcesses.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.edtLgPresetIncludedProcesses.Enabled = false; - this.edtLgPresetIncludedProcesses.Location = new System.Drawing.Point(601, 381); - this.edtLgPresetIncludedProcesses.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.edtLgPresetIncludedProcesses.Name = "edtLgPresetIncludedProcesses"; - this.edtLgPresetIncludedProcesses.Size = new System.Drawing.Size(289, 23); - this.edtLgPresetIncludedProcesses.TabIndex = 49; + edtLgPresetIncludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + edtLgPresetIncludedProcesses.Enabled = false; + edtLgPresetIncludedProcesses.Location = new System.Drawing.Point(601, 381); + edtLgPresetIncludedProcesses.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + edtLgPresetIncludedProcesses.Name = "edtLgPresetIncludedProcesses"; + edtLgPresetIncludedProcesses.Size = new System.Drawing.Size(289, 23); + edtLgPresetIncludedProcesses.TabIndex = 49; // // lblLgPresetTriggerCondition // - this.lblLgPresetTriggerCondition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.lblLgPresetTriggerCondition.AutoSize = true; - this.lblLgPresetTriggerCondition.Location = new System.Drawing.Point(475, 353); - this.lblLgPresetTriggerCondition.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblLgPresetTriggerCondition.Name = "lblLgPresetTriggerCondition"; - this.lblLgPresetTriggerCondition.Size = new System.Drawing.Size(63, 15); - this.lblLgPresetTriggerCondition.TabIndex = 47; - this.lblLgPresetTriggerCondition.Text = "Condition:"; + lblLgPresetTriggerCondition.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + lblLgPresetTriggerCondition.AutoSize = true; + lblLgPresetTriggerCondition.Location = new System.Drawing.Point(475, 353); + lblLgPresetTriggerCondition.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblLgPresetTriggerCondition.Name = "lblLgPresetTriggerCondition"; + lblLgPresetTriggerCondition.Size = new System.Drawing.Size(63, 15); + lblLgPresetTriggerCondition.TabIndex = 47; + lblLgPresetTriggerCondition.Text = "Condition:"; // // cbxLgPresetTrigger // - this.cbxLgPresetTrigger.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.cbxLgPresetTrigger.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxLgPresetTrigger.Enabled = false; - this.cbxLgPresetTrigger.FormattingEnabled = true; - this.cbxLgPresetTrigger.Location = new System.Drawing.Point(601, 318); - this.cbxLgPresetTrigger.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cbxLgPresetTrigger.Name = "cbxLgPresetTrigger"; - this.cbxLgPresetTrigger.Size = new System.Drawing.Size(289, 23); - this.cbxLgPresetTrigger.TabIndex = 46; + cbxLgPresetTrigger.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + cbxLgPresetTrigger.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + cbxLgPresetTrigger.Enabled = false; + cbxLgPresetTrigger.FormattingEnabled = true; + cbxLgPresetTrigger.Location = new System.Drawing.Point(601, 318); + cbxLgPresetTrigger.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cbxLgPresetTrigger.Name = "cbxLgPresetTrigger"; + cbxLgPresetTrigger.Size = new System.Drawing.Size(289, 23); + cbxLgPresetTrigger.TabIndex = 46; // // lblLgPresetTrigger // - this.lblLgPresetTrigger.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.lblLgPresetTrigger.AutoSize = true; - this.lblLgPresetTrigger.Location = new System.Drawing.Point(475, 321); - this.lblLgPresetTrigger.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblLgPresetTrigger.Name = "lblLgPresetTrigger"; - this.lblLgPresetTrigger.Size = new System.Drawing.Size(46, 15); - this.lblLgPresetTrigger.TabIndex = 45; - this.lblLgPresetTrigger.Text = "Trigger:"; + lblLgPresetTrigger.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + lblLgPresetTrigger.AutoSize = true; + lblLgPresetTrigger.Location = new System.Drawing.Point(475, 321); + lblLgPresetTrigger.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblLgPresetTrigger.Name = "lblLgPresetTrigger"; + lblLgPresetTrigger.Size = new System.Drawing.Size(46, 15); + lblLgPresetTrigger.TabIndex = 45; + lblLgPresetTrigger.Text = "Trigger:"; // // btnLgExpert // - this.btnLgExpert.ContextMenuStrip = this.mnuLgExpert; - this.btnLgExpert.Location = new System.Drawing.Point(368, 39); - this.btnLgExpert.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgExpert.Name = "btnLgExpert"; - this.btnLgExpert.Size = new System.Drawing.Size(88, 27); - this.btnLgExpert.TabIndex = 44; - this.btnLgExpert.Text = "Expert..."; - this.btnLgExpert.UseVisualStyleBackColor = true; - this.btnLgExpert.Click += new System.EventHandler(this.btnLgExpert_Click); + btnLgExpert.ContextMenuStrip = mnuLgExpert; + btnLgExpert.Location = new System.Drawing.Point(368, 39); + btnLgExpert.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgExpert.Name = "btnLgExpert"; + btnLgExpert.Size = new System.Drawing.Size(88, 27); + btnLgExpert.TabIndex = 44; + btnLgExpert.Text = "Expert..."; + btnLgExpert.UseVisualStyleBackColor = true; + btnLgExpert.Click += btnLgExpert_Click; // // mnuLgExpert // - this.mnuLgExpert.ImageScalingSize = new System.Drawing.Size(20, 20); - this.mnuLgExpert.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.mnuLgOLEDMotionPro, - this.miLgExpertSeparator1}); - this.mnuLgExpert.Name = "mnuLgButtons"; - this.mnuLgExpert.Size = new System.Drawing.Size(359, 32); - this.mnuLgExpert.Opening += new System.ComponentModel.CancelEventHandler(this.mnuLgExpert_Opening); + mnuLgExpert.ImageScalingSize = new System.Drawing.Size(20, 20); + mnuLgExpert.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { mnuLgOLEDMotionPro, miLgExpertSeparator1 }); + mnuLgExpert.Name = "mnuLgButtons"; + mnuLgExpert.Size = new System.Drawing.Size(359, 32); + mnuLgExpert.Opening += mnuLgExpert_Opening; // // mnuLgOLEDMotionPro // - this.mnuLgOLEDMotionPro.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.miLgEnableMotionPro, - this.miLgDisableMotionPro}); - this.mnuLgOLEDMotionPro.Name = "mnuLgOLEDMotionPro"; - this.mnuLgOLEDMotionPro.Size = new System.Drawing.Size(358, 22); - this.mnuLgOLEDMotionPro.Text = "Activate OLED Motion Pro (B9/C9/E9/W9/C2/G2 only)"; + mnuLgOLEDMotionPro.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { miLgEnableMotionPro, miLgDisableMotionPro }); + mnuLgOLEDMotionPro.Name = "mnuLgOLEDMotionPro"; + mnuLgOLEDMotionPro.Size = new System.Drawing.Size(358, 22); + mnuLgOLEDMotionPro.Text = "Activate OLED Motion Pro (B9/C9/E9/W9/C2/G2 only)"; // // miLgEnableMotionPro // - this.miLgEnableMotionPro.Name = "miLgEnableMotionPro"; - this.miLgEnableMotionPro.Size = new System.Drawing.Size(207, 22); - this.miLgEnableMotionPro.Text = "Enable OLED Motion Pro"; - this.miLgEnableMotionPro.Click += new System.EventHandler(this.miLgEnableMotionPro_Click); + miLgEnableMotionPro.Name = "miLgEnableMotionPro"; + miLgEnableMotionPro.Size = new System.Drawing.Size(207, 22); + miLgEnableMotionPro.Text = "Enable OLED Motion Pro"; + miLgEnableMotionPro.Click += miLgEnableMotionPro_Click; // // miLgDisableMotionPro // - this.miLgDisableMotionPro.Name = "miLgDisableMotionPro"; - this.miLgDisableMotionPro.Size = new System.Drawing.Size(207, 22); - this.miLgDisableMotionPro.Text = "Disable OLED Motion Pro"; - this.miLgDisableMotionPro.Click += new System.EventHandler(this.miLgDisableMotionPro_Click); + miLgDisableMotionPro.Name = "miLgDisableMotionPro"; + miLgDisableMotionPro.Size = new System.Drawing.Size(207, 22); + miLgDisableMotionPro.Text = "Disable OLED Motion Pro"; + miLgDisableMotionPro.Click += miLgDisableMotionPro_Click; // // miLgExpertSeparator1 // - this.miLgExpertSeparator1.Name = "miLgExpertSeparator1"; - this.miLgExpertSeparator1.Size = new System.Drawing.Size(355, 6); + miLgExpertSeparator1.Name = "miLgExpertSeparator1"; + miLgExpertSeparator1.Size = new System.Drawing.Size(355, 6); // // chkLgRemoteControlShow // - this.chkLgRemoteControlShow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.chkLgRemoteControlShow.Appearance = System.Windows.Forms.Appearance.Button; - this.chkLgRemoteControlShow.AutoSize = true; - this.chkLgRemoteControlShow.Location = new System.Drawing.Point(793, 8); - this.chkLgRemoteControlShow.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.chkLgRemoteControlShow.Name = "chkLgRemoteControlShow"; - this.chkLgRemoteControlShow.Size = new System.Drawing.Size(101, 25); - this.chkLgRemoteControlShow.TabIndex = 43; - this.chkLgRemoteControlShow.Text = "Remote Control"; - this.chkLgRemoteControlShow.UseVisualStyleBackColor = true; - this.chkLgRemoteControlShow.CheckedChanged += new System.EventHandler(this.chkLgRemoteControlShow_CheckedChanged); + chkLgRemoteControlShow.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + chkLgRemoteControlShow.Appearance = System.Windows.Forms.Appearance.Button; + chkLgRemoteControlShow.AutoSize = true; + chkLgRemoteControlShow.Location = new System.Drawing.Point(793, 8); + chkLgRemoteControlShow.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + chkLgRemoteControlShow.Name = "chkLgRemoteControlShow"; + chkLgRemoteControlShow.Size = new System.Drawing.Size(101, 25); + chkLgRemoteControlShow.TabIndex = 43; + chkLgRemoteControlShow.Text = "Remote Control"; + chkLgRemoteControlShow.UseVisualStyleBackColor = true; + chkLgRemoteControlShow.CheckedChanged += chkLgRemoteControlShow_CheckedChanged; // // label3 // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(6, 14); - this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(45, 15); - this.label3.TabIndex = 31; - this.label3.Text = "Device:"; + label3.AutoSize = true; + label3.Location = new System.Drawing.Point(6, 14); + label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label3.Name = "label3"; + label3.Size = new System.Drawing.Size(45, 15); + label3.TabIndex = 31; + label3.Text = "Device:"; // // cbxLgDevices // - this.cbxLgDevices.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxLgDevices.DropDownWidth = 400; - this.cbxLgDevices.FormattingEnabled = true; - this.cbxLgDevices.Location = new System.Drawing.Point(100, 9); - this.cbxLgDevices.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cbxLgDevices.Name = "cbxLgDevices"; - this.cbxLgDevices.Size = new System.Drawing.Size(370, 23); - this.cbxLgDevices.TabIndex = 30; - this.cbxLgDevices.SelectedIndexChanged += new System.EventHandler(this.cbxLgDevices_SelectedIndexChanged); + cbxLgDevices.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + cbxLgDevices.DropDownWidth = 400; + cbxLgDevices.FormattingEnabled = true; + cbxLgDevices.Location = new System.Drawing.Point(100, 9); + cbxLgDevices.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cbxLgDevices.Name = "cbxLgDevices"; + cbxLgDevices.Size = new System.Drawing.Size(370, 23); + cbxLgDevices.TabIndex = 30; + cbxLgDevices.SelectedIndexChanged += cbxLgDevices_SelectedIndexChanged; // // btnLgDeviceConvertToCustom // - this.btnLgDeviceConvertToCustom.Location = new System.Drawing.Point(667, 8); - this.btnLgDeviceConvertToCustom.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgDeviceConvertToCustom.Name = "btnLgDeviceConvertToCustom"; - this.btnLgDeviceConvertToCustom.Size = new System.Drawing.Size(88, 27); - this.btnLgDeviceConvertToCustom.TabIndex = 41; - this.btnLgDeviceConvertToCustom.Text = "To custom..."; - this.btnLgDeviceConvertToCustom.UseVisualStyleBackColor = true; - this.btnLgDeviceConvertToCustom.Click += new System.EventHandler(this.btnLgDeviceConvertToCustom_Click); + btnLgDeviceConvertToCustom.Location = new System.Drawing.Point(667, 8); + btnLgDeviceConvertToCustom.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgDeviceConvertToCustom.Name = "btnLgDeviceConvertToCustom"; + btnLgDeviceConvertToCustom.Size = new System.Drawing.Size(88, 27); + btnLgDeviceConvertToCustom.TabIndex = 41; + btnLgDeviceConvertToCustom.Text = "To custom..."; + btnLgDeviceConvertToCustom.UseVisualStyleBackColor = true; + btnLgDeviceConvertToCustom.Click += btnLgDeviceConvertToCustom_Click; // // cbxLgApps // - this.cbxLgApps.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.cbxLgApps.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxLgApps.Enabled = false; - this.cbxLgApps.FormattingEnabled = true; - this.cbxLgApps.Location = new System.Drawing.Point(100, 380); - this.cbxLgApps.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cbxLgApps.Name = "cbxLgApps"; - this.cbxLgApps.Size = new System.Drawing.Size(233, 23); - this.cbxLgApps.TabIndex = 26; - this.cbxLgApps.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbxLgApps_KeyPress); + cbxLgApps.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + cbxLgApps.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + cbxLgApps.Enabled = false; + cbxLgApps.FormattingEnabled = true; + cbxLgApps.Location = new System.Drawing.Point(100, 380); + cbxLgApps.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cbxLgApps.Name = "cbxLgApps"; + cbxLgApps.Size = new System.Drawing.Size(233, 23); + cbxLgApps.TabIndex = 26; + cbxLgApps.KeyPress += cbxLgApps_KeyPress; // // lvLgPresets // - this.lvLgPresets.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvLgPresets.CheckBoxes = true; - this.lvLgPresets.FullRowSelect = true; - this.lvLgPresets.Location = new System.Drawing.Point(6, 152); - this.lvLgPresets.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.lvLgPresets.MultiSelect = false; - this.lvLgPresets.Name = "lvLgPresets"; - this.lvLgPresets.ShowItemToolTips = true; - this.lvLgPresets.Size = new System.Drawing.Size(888, 126); - this.lvLgPresets.TabIndex = 8; - this.lvLgPresets.UseCompatibleStateImageBehavior = false; - this.lvLgPresets.View = System.Windows.Forms.View.Details; - this.lvLgPresets.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvLgPresets_ColumnClick); - this.lvLgPresets.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvLgPresets_ItemChecked); - this.lvLgPresets.SelectedIndexChanged += new System.EventHandler(this.lvLgPresets_SelectedIndexChanged); - this.lvLgPresets.DoubleClick += new System.EventHandler(this.lvLgPresets_DoubleClick); + lvLgPresets.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + lvLgPresets.CheckBoxes = true; + lvLgPresets.FullRowSelect = true; + lvLgPresets.Location = new System.Drawing.Point(6, 152); + lvLgPresets.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + lvLgPresets.MultiSelect = false; + lvLgPresets.Name = "lvLgPresets"; + lvLgPresets.ShowItemToolTips = true; + lvLgPresets.Size = new System.Drawing.Size(888, 126); + lvLgPresets.TabIndex = 8; + lvLgPresets.UseCompatibleStateImageBehavior = false; + lvLgPresets.View = System.Windows.Forms.View.Details; + lvLgPresets.ColumnClick += lvLgPresets_ColumnClick; + lvLgPresets.ItemChecked += lvLgPresets_ItemChecked; + lvLgPresets.SelectedIndexChanged += lvLgPresets_SelectedIndexChanged; + lvLgPresets.DoubleClick += lvLgPresets_DoubleClick; // // label5 // - this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(6, 384); - this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(32, 15); - this.label5.TabIndex = 25; - this.label5.Text = "App:"; + label5.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + label5.AutoSize = true; + label5.Location = new System.Drawing.Point(6, 384); + label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label5.Name = "label5"; + label5.Size = new System.Drawing.Size(32, 15); + label5.TabIndex = 25; + label5.Text = "App:"; // // cbxLgPresetDevice // - this.cbxLgPresetDevice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.cbxLgPresetDevice.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxLgPresetDevice.Enabled = false; - this.cbxLgPresetDevice.FormattingEnabled = true; - this.cbxLgPresetDevice.Location = new System.Drawing.Point(100, 348); - this.cbxLgPresetDevice.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cbxLgPresetDevice.Name = "cbxLgPresetDevice"; - this.cbxLgPresetDevice.Size = new System.Drawing.Size(370, 23); - this.cbxLgPresetDevice.TabIndex = 40; + cbxLgPresetDevice.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + cbxLgPresetDevice.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + cbxLgPresetDevice.Enabled = false; + cbxLgPresetDevice.FormattingEnabled = true; + cbxLgPresetDevice.Location = new System.Drawing.Point(100, 348); + cbxLgPresetDevice.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cbxLgPresetDevice.Name = "cbxLgPresetDevice"; + cbxLgPresetDevice.Size = new System.Drawing.Size(370, 23); + cbxLgPresetDevice.TabIndex = 40; // // btnDeleteLg // - this.btnDeleteLg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnDeleteLg.Enabled = false; - this.btnDeleteLg.Location = new System.Drawing.Point(289, 284); - this.btnDeleteLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnDeleteLg.Name = "btnDeleteLg"; - this.btnDeleteLg.Size = new System.Drawing.Size(88, 27); - this.btnDeleteLg.TabIndex = 27; - this.btnDeleteLg.Text = "Delete"; - this.btnDeleteLg.UseVisualStyleBackColor = true; - this.btnDeleteLg.Click += new System.EventHandler(this.btnDeleteLg_Click); + btnDeleteLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnDeleteLg.Enabled = false; + btnDeleteLg.Location = new System.Drawing.Point(289, 284); + btnDeleteLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnDeleteLg.Name = "btnDeleteLg"; + btnDeleteLg.Size = new System.Drawing.Size(88, 27); + btnDeleteLg.TabIndex = 27; + btnDeleteLg.Text = "Delete"; + btnDeleteLg.UseVisualStyleBackColor = true; + btnDeleteLg.Click += btnDeleteLg_Click; // // btnApplyLg // - this.btnApplyLg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnApplyLg.Enabled = false; - this.btnApplyLg.Location = new System.Drawing.Point(6, 284); - this.btnApplyLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnApplyLg.Name = "btnApplyLg"; - this.btnApplyLg.Size = new System.Drawing.Size(88, 27); - this.btnApplyLg.TabIndex = 9; - this.btnApplyLg.Text = "Apply"; - this.btnApplyLg.UseVisualStyleBackColor = true; - this.btnApplyLg.Click += new System.EventHandler(this.btnApplyLg_Click); + btnApplyLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnApplyLg.Enabled = false; + btnApplyLg.Location = new System.Drawing.Point(6, 284); + btnApplyLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnApplyLg.Name = "btnApplyLg"; + btnApplyLg.Size = new System.Drawing.Size(88, 27); + btnApplyLg.TabIndex = 9; + btnApplyLg.Text = "Apply"; + btnApplyLg.UseVisualStyleBackColor = true; + btnApplyLg.Click += btnApplyLg_Click; // // lblDeviceFilter // - this.lblDeviceFilter.AutoSize = true; - this.lblDeviceFilter.Location = new System.Drawing.Point(6, 45); - this.lblDeviceFilter.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblDeviceFilter.Name = "lblDeviceFilter"; - this.lblDeviceFilter.Size = new System.Drawing.Size(72, 15); - this.lblDeviceFilter.TabIndex = 24; - this.lblDeviceFilter.Text = "Device filter:"; + lblDeviceFilter.AutoSize = true; + lblDeviceFilter.Location = new System.Drawing.Point(6, 45); + lblDeviceFilter.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblDeviceFilter.Name = "lblDeviceFilter"; + lblDeviceFilter.Size = new System.Drawing.Size(72, 15); + lblDeviceFilter.TabIndex = 24; + lblDeviceFilter.Text = "Device filter:"; // // lblLgPresetDevice // - this.lblLgPresetDevice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.lblLgPresetDevice.AutoSize = true; - this.lblLgPresetDevice.Location = new System.Drawing.Point(6, 351); - this.lblLgPresetDevice.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblLgPresetDevice.Name = "lblLgPresetDevice"; - this.lblLgPresetDevice.Size = new System.Drawing.Size(45, 15); - this.lblLgPresetDevice.TabIndex = 39; - this.lblLgPresetDevice.Text = "Device:"; + lblLgPresetDevice.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + lblLgPresetDevice.AutoSize = true; + lblLgPresetDevice.Location = new System.Drawing.Point(6, 351); + lblLgPresetDevice.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblLgPresetDevice.Name = "lblLgPresetDevice"; + lblLgPresetDevice.Size = new System.Drawing.Size(45, 15); + lblLgPresetDevice.TabIndex = 39; + lblLgPresetDevice.Text = "Device:"; // // btnAddLg // - this.btnAddLg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnAddLg.Location = new System.Drawing.Point(195, 284); - this.btnAddLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnAddLg.Name = "btnAddLg"; - this.btnAddLg.Size = new System.Drawing.Size(88, 27); - this.btnAddLg.TabIndex = 28; - this.btnAddLg.Text = "Add"; - this.btnAddLg.UseVisualStyleBackColor = true; - this.btnAddLg.Click += new System.EventHandler(this.btnAddLg_Click); + btnAddLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnAddLg.Location = new System.Drawing.Point(195, 284); + btnAddLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnAddLg.Name = "btnAddLg"; + btnAddLg.Size = new System.Drawing.Size(88, 27); + btnAddLg.TabIndex = 28; + btnAddLg.Text = "Add"; + btnAddLg.UseVisualStyleBackColor = true; + btnAddLg.Click += btnAddLg_Click; // // edtShortcutLg // - this.edtShortcutLg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.edtShortcutLg.Enabled = false; - this.edtShortcutLg.Location = new System.Drawing.Point(100, 411); - this.edtShortcutLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.edtShortcutLg.Name = "edtShortcutLg"; - this.edtShortcutLg.ReadOnly = true; - this.edtShortcutLg.Size = new System.Drawing.Size(233, 23); - this.edtShortcutLg.TabIndex = 11; - this.edtShortcutLg.TextChanged += new System.EventHandler(this.edtShortcutLg_TextChanged); - this.edtShortcutLg.KeyDown += new System.Windows.Forms.KeyEventHandler(this.edtShortcut_KeyDown); - this.edtShortcutLg.KeyUp += new System.Windows.Forms.KeyEventHandler(this.edtShortcut_KeyUp); + edtShortcutLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + edtShortcutLg.Enabled = false; + edtShortcutLg.Location = new System.Drawing.Point(100, 411); + edtShortcutLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + edtShortcutLg.Name = "edtShortcutLg"; + edtShortcutLg.ReadOnly = true; + edtShortcutLg.Size = new System.Drawing.Size(233, 23); + edtShortcutLg.TabIndex = 11; + edtShortcutLg.TextChanged += edtShortcutLg_TextChanged; + edtShortcutLg.KeyDown += edtShortcut_KeyDown; + edtShortcutLg.KeyUp += edtShortcut_KeyUp; // // edtLgDeviceFilter // - this.edtLgDeviceFilter.Location = new System.Drawing.Point(100, 40); - this.edtLgDeviceFilter.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.edtLgDeviceFilter.Name = "edtLgDeviceFilter"; - this.edtLgDeviceFilter.Size = new System.Drawing.Size(165, 23); - this.edtLgDeviceFilter.TabIndex = 23; - this.edtLgDeviceFilter.TextChanged += new System.EventHandler(this.edtLgDeviceFilter_TextChanged); + edtLgDeviceFilter.Location = new System.Drawing.Point(100, 40); + edtLgDeviceFilter.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + edtLgDeviceFilter.Name = "edtLgDeviceFilter"; + edtLgDeviceFilter.Size = new System.Drawing.Size(165, 23); + edtLgDeviceFilter.TabIndex = 23; + edtLgDeviceFilter.TextChanged += edtLgDeviceFilter_TextChanged; // // btnLgRemoveDevice // - this.btnLgRemoveDevice.Location = new System.Drawing.Point(573, 8); - this.btnLgRemoveDevice.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgRemoveDevice.Name = "btnLgRemoveDevice"; - this.btnLgRemoveDevice.Size = new System.Drawing.Size(88, 27); - this.btnLgRemoveDevice.TabIndex = 38; - this.btnLgRemoveDevice.Text = "Remove"; - this.btnLgRemoveDevice.UseVisualStyleBackColor = true; - this.btnLgRemoveDevice.Click += new System.EventHandler(this.btnLgRemoveDevice_Click); + btnLgRemoveDevice.Location = new System.Drawing.Point(573, 8); + btnLgRemoveDevice.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgRemoveDevice.Name = "btnLgRemoveDevice"; + btnLgRemoveDevice.Size = new System.Drawing.Size(88, 27); + btnLgRemoveDevice.TabIndex = 38; + btnLgRemoveDevice.Text = "Remove"; + btnLgRemoveDevice.UseVisualStyleBackColor = true; + btnLgRemoveDevice.Click += btnLgRemoveDevice_Click; // // btnLgRefreshApps // - this.btnLgRefreshApps.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnLgRefreshApps.Enabled = false; - this.btnLgRefreshApps.Location = new System.Drawing.Point(341, 378); - this.btnLgRefreshApps.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgRefreshApps.Name = "btnLgRefreshApps"; - this.btnLgRefreshApps.Size = new System.Drawing.Size(88, 27); - this.btnLgRefreshApps.TabIndex = 29; - this.btnLgRefreshApps.Text = "Refresh"; - this.btnLgRefreshApps.UseVisualStyleBackColor = true; - this.btnLgRefreshApps.Click += new System.EventHandler(this.btnLgRefreshApps_Click); + btnLgRefreshApps.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnLgRefreshApps.Enabled = false; + btnLgRefreshApps.Location = new System.Drawing.Point(341, 378); + btnLgRefreshApps.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgRefreshApps.Name = "btnLgRefreshApps"; + btnLgRefreshApps.Size = new System.Drawing.Size(88, 27); + btnLgRefreshApps.TabIndex = 29; + btnLgRefreshApps.Text = "Refresh"; + btnLgRefreshApps.UseVisualStyleBackColor = true; + btnLgRefreshApps.Click += btnLgRefreshApps_Click; // // label2 // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(6, 415); - this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(55, 15); - this.label2.TabIndex = 12; - this.label2.Text = "Shortcut:"; + label2.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + label2.AutoSize = true; + label2.Location = new System.Drawing.Point(6, 415); + label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(55, 15); + label2.TabIndex = 12; + label2.Text = "Shortcut:"; // // label1 // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(6, 321); - this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(42, 15); - this.label1.TabIndex = 20; - this.label1.Text = "Name:"; + label1.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + label1.AutoSize = true; + label1.Location = new System.Drawing.Point(6, 321); + label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(42, 15); + label1.TabIndex = 20; + label1.Text = "Name:"; // // btnLgAddDevice // - this.btnLgAddDevice.Location = new System.Drawing.Point(478, 8); - this.btnLgAddDevice.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgAddDevice.Name = "btnLgAddDevice"; - this.btnLgAddDevice.Size = new System.Drawing.Size(88, 27); - this.btnLgAddDevice.TabIndex = 37; - this.btnLgAddDevice.Text = "Add"; - this.btnLgAddDevice.UseVisualStyleBackColor = true; - this.btnLgAddDevice.Click += new System.EventHandler(this.btnLgAddDevice_Click); + btnLgAddDevice.Location = new System.Drawing.Point(478, 8); + btnLgAddDevice.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgAddDevice.Name = "btnLgAddDevice"; + btnLgAddDevice.Size = new System.Drawing.Size(88, 27); + btnLgAddDevice.TabIndex = 37; + btnLgAddDevice.Text = "Add"; + btnLgAddDevice.UseVisualStyleBackColor = true; + btnLgAddDevice.Click += btnLgAddDevice_Click; // // edtNameLg // - this.edtNameLg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.edtNameLg.Enabled = false; - this.edtNameLg.Location = new System.Drawing.Point(100, 318); - this.edtNameLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.edtNameLg.Name = "edtNameLg"; - this.edtNameLg.Size = new System.Drawing.Size(233, 23); - this.edtNameLg.TabIndex = 19; + edtNameLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + edtNameLg.Enabled = false; + edtNameLg.Location = new System.Drawing.Point(100, 318); + edtNameLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + edtNameLg.Name = "edtNameLg"; + edtNameLg.Size = new System.Drawing.Size(233, 23); + edtNameLg.TabIndex = 19; // // btnSetShortcutLg // - this.btnSetShortcutLg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnSetShortcutLg.Enabled = false; - this.btnSetShortcutLg.Location = new System.Drawing.Point(384, 284); - this.btnSetShortcutLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnSetShortcutLg.Name = "btnSetShortcutLg"; - this.btnSetShortcutLg.Size = new System.Drawing.Size(88, 27); - this.btnSetShortcutLg.TabIndex = 13; - this.btnSetShortcutLg.Text = "Save"; - this.btnSetShortcutLg.UseVisualStyleBackColor = true; - this.btnSetShortcutLg.Click += new System.EventHandler(this.btnSetShortcutLg_Click); + btnSetShortcutLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnSetShortcutLg.Enabled = false; + btnSetShortcutLg.Location = new System.Drawing.Point(384, 284); + btnSetShortcutLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnSetShortcutLg.Name = "btnSetShortcutLg"; + btnSetShortcutLg.Size = new System.Drawing.Size(88, 27); + btnSetShortcutLg.TabIndex = 13; + btnSetShortcutLg.Text = "Save"; + btnSetShortcutLg.UseVisualStyleBackColor = true; + btnSetShortcutLg.Click += btnSetShortcutLg_Click; // // edtStepsLg // - this.edtStepsLg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.edtStepsLg.Enabled = false; - this.edtStepsLg.Location = new System.Drawing.Point(100, 440); - this.edtStepsLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.edtStepsLg.Multiline = true; - this.edtStepsLg.Name = "edtStepsLg"; - this.edtStepsLg.Size = new System.Drawing.Size(699, 43); - this.edtStepsLg.TabIndex = 17; + edtStepsLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + edtStepsLg.Enabled = false; + edtStepsLg.Location = new System.Drawing.Point(100, 440); + edtStepsLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + edtStepsLg.Multiline = true; + edtStepsLg.Name = "edtStepsLg"; + edtStepsLg.Size = new System.Drawing.Size(699, 43); + edtStepsLg.TabIndex = 17; // // btnLgAddButton // - this.btnLgAddButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnLgAddButton.ContextMenuStrip = this.mnuLgButtons; - this.btnLgAddButton.Enabled = false; - this.btnLgAddButton.Location = new System.Drawing.Point(807, 439); - this.btnLgAddButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgAddButton.Name = "btnLgAddButton"; - this.btnLgAddButton.Size = new System.Drawing.Size(88, 27); - this.btnLgAddButton.TabIndex = 32; - this.btnLgAddButton.Text = "Add step"; - this.btnLgAddButton.UseVisualStyleBackColor = true; - this.btnLgAddButton.Click += new System.EventHandler(this.btnLgAddButton_Click); + btnLgAddButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + btnLgAddButton.ContextMenuStrip = mnuLgButtons; + btnLgAddButton.Enabled = false; + btnLgAddButton.Location = new System.Drawing.Point(807, 439); + btnLgAddButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgAddButton.Name = "btnLgAddButton"; + btnLgAddButton.Size = new System.Drawing.Size(88, 27); + btnLgAddButton.TabIndex = 32; + btnLgAddButton.Text = "Add step"; + btnLgAddButton.UseVisualStyleBackColor = true; + btnLgAddButton.Click += btnLgAddButton_Click; // // mnuLgButtons // - this.mnuLgButtons.ImageScalingSize = new System.Drawing.Size(20, 20); - this.mnuLgButtons.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.mnuLgRcButtons, - this.mnuLgActions, - this.mnuLgNvPresets, - this.mnuLgAmdPresets, - this.mnuLgProgram}); - this.mnuLgButtons.Name = "mnuLgButtons"; - this.mnuLgButtons.Size = new System.Drawing.Size(153, 114); - this.mnuLgButtons.Opening += new System.ComponentModel.CancelEventHandler(this.mnuLgButtons_Opening); + mnuLgButtons.ImageScalingSize = new System.Drawing.Size(20, 20); + mnuLgButtons.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { mnuLgRcButtons, mnuLgActions, mnuLgNvPresets, mnuLgAmdPresets, mnuLgProgram }); + mnuLgButtons.Name = "mnuLgButtons"; + mnuLgButtons.Size = new System.Drawing.Size(153, 114); + mnuLgButtons.Opening += mnuLgButtons_Opening; // // mnuLgRcButtons // - this.mnuLgRcButtons.Name = "mnuLgRcButtons"; - this.mnuLgRcButtons.Size = new System.Drawing.Size(152, 22); - this.mnuLgRcButtons.Text = "Buttons"; + mnuLgRcButtons.Name = "mnuLgRcButtons"; + mnuLgRcButtons.Size = new System.Drawing.Size(152, 22); + mnuLgRcButtons.Text = "Buttons"; // // mnuLgActions // - this.mnuLgActions.Name = "mnuLgActions"; - this.mnuLgActions.Size = new System.Drawing.Size(152, 22); - this.mnuLgActions.Text = "Actions"; + mnuLgActions.Name = "mnuLgActions"; + mnuLgActions.Size = new System.Drawing.Size(152, 22); + mnuLgActions.Text = "Actions"; // // mnuLgNvPresets // - this.mnuLgNvPresets.Name = "mnuLgNvPresets"; - this.mnuLgNvPresets.Size = new System.Drawing.Size(152, 22); - this.mnuLgNvPresets.Text = "NVIDIA presets"; + mnuLgNvPresets.Name = "mnuLgNvPresets"; + mnuLgNvPresets.Size = new System.Drawing.Size(152, 22); + mnuLgNvPresets.Text = "NVIDIA presets"; // // mnuLgAmdPresets // - this.mnuLgAmdPresets.Name = "mnuLgAmdPresets"; - this.mnuLgAmdPresets.Size = new System.Drawing.Size(152, 22); - this.mnuLgAmdPresets.Text = "AMD presets"; + mnuLgAmdPresets.Name = "mnuLgAmdPresets"; + mnuLgAmdPresets.Size = new System.Drawing.Size(152, 22); + mnuLgAmdPresets.Text = "AMD presets"; // // mnuLgProgram // - this.mnuLgProgram.Name = "mnuLgProgram"; - this.mnuLgProgram.Size = new System.Drawing.Size(152, 22); - this.mnuLgProgram.Text = "Start Program"; - this.mnuLgProgram.Click += new System.EventHandler(this.mnuLgProgram_Click); + mnuLgProgram.Name = "mnuLgProgram"; + mnuLgProgram.Size = new System.Drawing.Size(152, 22); + mnuLgProgram.Text = "Start Program"; + mnuLgProgram.Click += mnuLgProgram_Click; // // btnCloneLg // - this.btnCloneLg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnCloneLg.Enabled = false; - this.btnCloneLg.Location = new System.Drawing.Point(100, 284); - this.btnCloneLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnCloneLg.Name = "btnCloneLg"; - this.btnCloneLg.Size = new System.Drawing.Size(88, 27); - this.btnCloneLg.TabIndex = 14; - this.btnCloneLg.Text = "Clone"; - this.btnCloneLg.UseVisualStyleBackColor = true; - this.btnCloneLg.Click += new System.EventHandler(this.btnCloneLg_Click); + btnCloneLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnCloneLg.Enabled = false; + btnCloneLg.Location = new System.Drawing.Point(100, 284); + btnCloneLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnCloneLg.Name = "btnCloneLg"; + btnCloneLg.Size = new System.Drawing.Size(88, 27); + btnCloneLg.TabIndex = 14; + btnCloneLg.Text = "Clone"; + btnCloneLg.UseVisualStyleBackColor = true; + btnCloneLg.Click += btnCloneLg_Click; // // lblStepsLg // - this.lblStepsLg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.lblStepsLg.AutoSize = true; - this.lblStepsLg.Location = new System.Drawing.Point(6, 445); - this.lblStepsLg.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblStepsLg.Name = "lblStepsLg"; - this.lblStepsLg.Size = new System.Drawing.Size(38, 15); - this.lblStepsLg.TabIndex = 16; - this.lblStepsLg.Text = "Steps:"; + lblStepsLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + lblStepsLg.AutoSize = true; + lblStepsLg.Location = new System.Drawing.Point(6, 445); + lblStepsLg.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblStepsLg.Name = "lblStepsLg"; + lblStepsLg.Size = new System.Drawing.Size(38, 15); + lblStepsLg.TabIndex = 16; + lblStepsLg.Text = "Steps:"; // // btnLgDeviceFilterRefresh // - this.btnLgDeviceFilterRefresh.Location = new System.Drawing.Point(273, 39); - this.btnLgDeviceFilterRefresh.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnLgDeviceFilterRefresh.Name = "btnLgDeviceFilterRefresh"; - this.btnLgDeviceFilterRefresh.Size = new System.Drawing.Size(88, 27); - this.btnLgDeviceFilterRefresh.TabIndex = 35; - this.btnLgDeviceFilterRefresh.Text = "Refresh"; - this.btnLgDeviceFilterRefresh.UseVisualStyleBackColor = true; - this.btnLgDeviceFilterRefresh.Click += new System.EventHandler(this.btnLgDeviceFilterRefresh_Click); + btnLgDeviceFilterRefresh.Location = new System.Drawing.Point(273, 39); + btnLgDeviceFilterRefresh.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLgDeviceFilterRefresh.Name = "btnLgDeviceFilterRefresh"; + btnLgDeviceFilterRefresh.Size = new System.Drawing.Size(88, 27); + btnLgDeviceFilterRefresh.TabIndex = 35; + btnLgDeviceFilterRefresh.Text = "Refresh"; + btnLgDeviceFilterRefresh.UseVisualStyleBackColor = true; + btnLgDeviceFilterRefresh.Click += btnLgDeviceFilterRefresh_Click; // // clbLgPower // - this.clbLgPower.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.clbLgPower.CheckOnClick = true; - this.clbLgPower.ColumnWidth = 240; - this.clbLgPower.FormattingEnabled = true; - this.clbLgPower.Items.AddRange(new object[] { - "Power on after startup", - "Power on after resume from standby", - "Power off on shutdown", - "Power off on standby", - "Power off when screensaver activates", - "Power on when screensaver deactivates", - "Power on even after manual power off", - "Allow triggers to be fired for this device", - "Use Windows power settings to power on", - "Use Windows power settings to power off", - "Use secure connection"}); - this.clbLgPower.Location = new System.Drawing.Point(6, 70); - this.clbLgPower.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.clbLgPower.MultiColumn = true; - this.clbLgPower.Name = "clbLgPower"; - this.clbLgPower.Size = new System.Drawing.Size(861, 76); - this.clbLgPower.TabIndex = 34; - this.clbLgPower.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.clbLgPower_ItemCheck); + clbLgPower.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + clbLgPower.ColumnWidth = 240; + clbLgPower.FormattingEnabled = true; + clbLgPower.Items.AddRange(new object[] { "Power on after startup", "Power on after resume from standby", "Power off on shutdown", "Power off on standby", "Power off when screensaver activates", "Power on when screensaver deactivates", "Power on even after manual power off", "Allow triggers to be fired for this device", "Use Windows power settings to power on", "Use Windows power settings to power off", "Use secure connection" }); + clbLgPower.Location = new System.Drawing.Point(6, 70); + clbLgPower.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + clbLgPower.MultiColumn = true; + clbLgPower.Name = "clbLgPower"; + clbLgPower.Size = new System.Drawing.Size(861, 76); + clbLgPower.TabIndex = 34; + clbLgPower.ItemCheck += clbLgPower_ItemCheck; + clbLgPower.SelectedIndexChanged += clbLgPower_SelectedIndexChanged; // // lblLgError // - this.lblLgError.AutoSize = true; - this.lblLgError.Location = new System.Drawing.Point(6, 9); - this.lblLgError.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblLgError.Name = "lblLgError"; - this.lblLgError.Size = new System.Drawing.Size(53, 15); - this.lblLgError.TabIndex = 15; - this.lblLgError.Text = "ErrorText"; - this.lblLgError.Visible = false; + lblLgError.AutoSize = true; + lblLgError.Location = new System.Drawing.Point(6, 9); + lblLgError.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblLgError.Name = "lblLgError"; + lblLgError.Size = new System.Drawing.Size(53, 15); + lblLgError.TabIndex = 15; + lblLgError.Text = "ErrorText"; + lblLgError.Visible = false; // // mnuLgSettings // - this.mnuLgSettings.ImageScalingSize = new System.Drawing.Size(20, 20); - this.mnuLgSettings.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.miTestPowerOffOn, - this.miNvSettings}); - this.mnuLgSettings.Name = "mnuLgButtons"; - this.mnuLgSettings.Size = new System.Drawing.Size(168, 48); + mnuLgSettings.ImageScalingSize = new System.Drawing.Size(20, 20); + mnuLgSettings.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { miTestPowerOffOn, miNvSettings }); + mnuLgSettings.Name = "mnuLgButtons"; + mnuLgSettings.Size = new System.Drawing.Size(168, 48); // // miTestPowerOffOn // - this.miTestPowerOffOn.Name = "miTestPowerOffOn"; - this.miTestPowerOffOn.Size = new System.Drawing.Size(167, 22); - this.miTestPowerOffOn.Text = "Test power off/on"; - this.miTestPowerOffOn.Click += new System.EventHandler(this.miTestPowerOffOn_Click); + miTestPowerOffOn.Name = "miTestPowerOffOn"; + miTestPowerOffOn.Size = new System.Drawing.Size(167, 22); + miTestPowerOffOn.Text = "Test power off/on"; + miTestPowerOffOn.Click += miTestPowerOffOn_Click; // // miNvSettings // - this.miNvSettings.Name = "miNvSettings"; - this.miNvSettings.Size = new System.Drawing.Size(167, 22); - this.miNvSettings.Text = "Settings"; - this.miNvSettings.Click += new System.EventHandler(this.miNvSettings_Click); + miNvSettings.Name = "miNvSettings"; + miNvSettings.Size = new System.Drawing.Size(167, 22); + miNvSettings.Text = "Settings"; + miNvSettings.Click += miNvSettings_Click; // // LgPanel // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.scLgController); - this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.Name = "LgPanel"; - this.Size = new System.Drawing.Size(1114, 539); - this.scLgController.Panel1.ResumeLayout(false); - this.scLgController.Panel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.scLgController)).EndInit(); - this.scLgController.ResumeLayout(false); - this.mnuLgExpert.ResumeLayout(false); - this.mnuLgButtons.ResumeLayout(false); - this.mnuLgSettings.ResumeLayout(false); - this.ResumeLayout(false); - + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + Controls.Add(scLgController); + Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + Name = "LgPanel"; + Size = new System.Drawing.Size(1114, 539); + scLgController.Panel1.ResumeLayout(false); + scLgController.Panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)scLgController).EndInit(); + scLgController.ResumeLayout(false); + mnuLgExpert.ResumeLayout(false); + mnuLgButtons.ResumeLayout(false); + mnuLgSettings.ResumeLayout(false); + ResumeLayout(false); } #endregion @@ -925,5 +907,6 @@ private System.Windows.Forms.ContextMenuStrip mnuLgSettings; private System.Windows.Forms.ToolStripMenuItem miTestPowerOffOn; private System.Windows.Forms.ToolStripMenuItem miNvSettings; + private System.Windows.Forms.Button btnLgDeviceOptionsSettings; } } diff --git a/ColorControl/Services/LG/LgPanel.cs b/ColorControl/Services/LG/LgPanel.cs index be6c447..25bb6a5 100644 --- a/ColorControl/Services/LG/LgPanel.cs +++ b/ColorControl/Services/LG/LgPanel.cs @@ -32,7 +32,6 @@ namespace ColorControl.Services.LG private NotifyIcon _trayIcon; private string _lgTabMessage; - private bool _initialized = false; private bool _disableEvents = false; private LgGameBar _gameBarForm; @@ -74,7 +73,6 @@ namespace ColorControl.Services.LG public void Init() { _lgService.RefreshDevices(afterStartUp: true).ContinueWith((_) => BeginInvoke(() => AfterLgServiceRefreshDevices())); - _lgService.InstallEventHandlers(); } @@ -290,11 +288,6 @@ namespace ColorControl.Services.LG edtLgPresetIncludedProcesses.Text, edtLgPresetExcludedProcesses.Text); - if (triggerType != PresetTriggerType.None) - { - _lgService.InstallEventHandlers(); - } - var shortcutChanged = !shortcut.Equals(preset.shortcut); if (shortcutChanged) { @@ -665,7 +658,7 @@ namespace ColorControl.Services.LG private void clbLgPower_ItemCheck(object sender, ItemCheckEventArgs e) { - if (!_initialized || _disableEvents) + if (_disableEvents) { return; } @@ -702,8 +695,6 @@ You can also activate this option by using the Expert-button and selecting Wake- device.PowerOnByWindows = clbLgPower.GetItemChecked(9); device.UseSecureConnection = clbLgPower.GetItemChecked(10); - _lgService.InstallEventHandlers(); - if (e.Index == 10) { _lgService.RefreshDevices().ContinueWith((_) => BeginInvoke(() => FillLgDevices())); @@ -1279,5 +1270,32 @@ The InStart, EzAdjust and Software Update items are now visible under the Expert } } + + private void clbLgPower_SelectedIndexChanged(object sender, EventArgs e) + { + btnLgDeviceOptionsSettings.Enabled = clbLgPower.SelectedIndex == 4; + } + + private void btnLgDeviceOptionsSettings_Click(object sender, EventArgs e) + { + var device = _lgService.SelectedDevice; + var selectedItem = clbLgPower.SelectedItem; + + var durationField = new MessageForms.FieldDefinition + { + Label = "Enter the minimal duration the screen saver must be running (in seconds)", + FieldType = MessageForms.FieldType.Numeric, + MinValue = 0, + MaxValue = 3600, + Value = device.ScreenSaverMinimalDuration + }; + + if (!MessageForms.ShowDialog($"Settings - {selectedItem}", new[] { durationField }).Any()) + { + return; + } + + device.ScreenSaverMinimalDuration = durationField.ValueAsInt; + } } } diff --git a/ColorControl/Services/LG/LgService.cs b/ColorControl/Services/LG/LgService.cs index 94ed8df..602dd26 100644 --- a/ColorControl/Services/LG/LgService.cs +++ b/ColorControl/Services/LG/LgService.cs @@ -1,6 +1,6 @@ using ColorControl.Common; -using ColorControl.Forms; using ColorControl.Services.Common; +using ColorControl.Services.EventDispatcher; using ColorControl.Svc; using LgTv; using Microsoft.Extensions.DependencyInjection; @@ -12,7 +12,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -using System.Management; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; @@ -77,6 +76,9 @@ namespace ColorControl.Services.LG private string _configFilename; private bool _allowPowerOn; + private readonly PowerEventDispatcher _powerEventDispatcher; + private readonly SessionSwitchDispatcher _sessionSwitchDispatcher; + private readonly ProcessEventDispatcher _processEventDispatcher; private LgDevice _selectedDevice; private string _rcButtonsFilename; private List _remoteControlButtons; @@ -84,15 +86,15 @@ namespace ColorControl.Services.LG private bool _poweredOffByScreenSaver; private int _poweredOffByScreenSaverProcessId; - private Task _monitorTask; - private int _monitorTaskCounter; private LgPreset _lastTriggeredPreset; private RestartDetector _restartDetector; - public LgService(AppContextProvider appContextProvider, bool allowPowerOn) : base(appContextProvider) + public LgService(AppContextProvider appContextProvider, PowerEventDispatcher powerEventDispatcher, SessionSwitchDispatcher sessionSwitchDispatcher, ProcessEventDispatcher processEventDispatcher) : base(appContextProvider) { - _allowPowerOn = allowPowerOn; - + _allowPowerOn = appContextProvider.GetAppContext().StartUpParams.RunningFromScheduledTask; + _powerEventDispatcher = powerEventDispatcher; + _sessionSwitchDispatcher = sessionSwitchDispatcher; + _processEventDispatcher = processEventDispatcher; LgPreset.LgApps = _lgApps; _restartDetector = new RestartDetector(); @@ -111,9 +113,8 @@ namespace ColorControl.Services.LG { try { - var appContextProvider = Program.ServiceProvider.GetRequiredService(); + var lgService = Program.ServiceProvider.GetRequiredService(); - var lgService = new LgService(appContextProvider, true); await lgService.RefreshDevices(afterStartUp: true); var result = await lgService.ApplyPreset(presetName); @@ -442,32 +443,35 @@ namespace ColorControl.Services.LG public void InstallEventHandlers() { - SystemEvents.PowerModeChanged -= PowerModeChanged; - SystemEvents.PowerModeChanged += PowerModeChanged; + _powerEventDispatcher.RegisterEventHandler(PowerEventDispatcher.Event_Suspend, PowerModeChanged); + _powerEventDispatcher.RegisterEventHandler(PowerEventDispatcher.Event_Resume, PowerModeChanged); + //SystemEvents.SessionEnded -= SessionEnded; //SystemEvents.SessionEnded += SessionEnded; - UserSessionInfo.UserSessionSwitch -= SessionSwitched; - UserSessionInfo.UserSessionSwitch += SessionSwitched; + _sessionSwitchDispatcher.RegisterEventHandler(SessionSwitchDispatcher.Event_SessionSwitch, SessionSwitched); - MonitorProcesses(); + _processEventDispatcher.RegisterAsyncEventHandler(ProcessEventDispatcher.Event_ProcessChanged, ProcessChanged); } - private void SessionSwitched(bool toLocal) + private void SessionSwitched(object sender, SessionSwitchEventArgs e) { - if (toLocal) + if (_sessionSwitchDispatcher.UserLocalSession) { - if (_poweredOffByScreenSaver) - { - Logger.Debug("User switched to local and screen was powered off due to screensaver: waking up"); - _poweredOffByScreenSaver = false; - _poweredOffByScreenSaverProcessId = 0; - WakeAfterStartupOrResume(); - } - else - { - Logger.Debug("User switched to local but screen was not powered off by screensaver: NOT waking up"); - } + return; + } + + + if (_poweredOffByScreenSaver) + { + Logger.Debug("User switched to local and screen was powered off due to screensaver: waking up"); + _poweredOffByScreenSaver = false; + _poweredOffByScreenSaverProcessId = 0; + WakeAfterStartupOrResume(); + } + else + { + Logger.Debug("User switched to local but screen was not powered off by screensaver: NOT waking up"); } } @@ -479,6 +483,8 @@ namespace ColorControl.Services.LG if (powerOn) { + Devices.ForEach(d => d.ClearPowerOffTask()); + WakeAfterStartupOrResume(PowerOnOffState.Resume); return; } @@ -516,199 +522,101 @@ namespace ColorControl.Services.LG } } - private void MonitorProcesses() + public async Task ProcessChanged(object sender, ProcessChangedEventArgs args, CancellationToken token) { - var enableMonitoring = ShouldMonitorProcesses(); - if (enableMonitoring && _monitorTask == null) + try { - _monitorTask = CheckProcesses(); - } - else if (!enableMonitoring && _monitorTask != null) - { - _monitorTask = null; - } - } + var wasConnected = Devices.Any(d => (d.PowerOffOnScreenSaver || d.PowerOnAfterScreenSaver) && d.IsConnected()); - public bool ShouldMonitorProcesses() - { - return Devices.Any(d => d.PowerOffOnScreenSaver || d.PowerOnAfterScreenSaver) || _presets.Any(p => p.Triggers.Any(t => t.Trigger != PresetTriggerType.None)); - } + var applicableDevices = Devices.Where(d => d.PowerOffOnScreenSaver || d.PowerOnAfterScreenSaver || d.TriggersEnabled && _presets.Any(p => p.Triggers.Any(t => t.Trigger != PresetTriggerType.None) && + ((string.IsNullOrEmpty(p.DeviceMacAddress) && d == SelectedDevice) || p.DeviceMacAddress.Equals(d.MacAddress, StringComparison.OrdinalIgnoreCase)))); - public async Task CheckProcesses() - { - var wasConnected = Devices.Any(d => (d.PowerOffOnScreenSaver || d.PowerOnAfterScreenSaver) && d.IsConnected()); - _monitorTaskCounter++; - var validCounter = _monitorTaskCounter; - var lastProcessId = 0; - - await Task.Delay(2000); - - //var startWatch = new ManagementEventWatcher("SELECT * FROM Win32_ProcessStartTrace"); - //startWatch.EventArrived += startWatch_EventArrived; - //startWatch.Start(); - - MonitorContext ??= new ProcessMonitorContext(); - //Process[] lastProcesses = null; - - while (validCounter == _monitorTaskCounter) - { - await Task.Delay(_poweredOffByScreenSaver ? 500 : 1000); - - try + if (!applicableDevices.Any()) { - var applicableDevices = Devices.Where(d => d.PowerOffOnScreenSaver || d.PowerOnAfterScreenSaver || d.TriggersEnabled && _presets.Any(p => p.Triggers.Any(t => t.Trigger != PresetTriggerType.None) && - ((string.IsNullOrEmpty(p.DeviceMacAddress) && d == SelectedDevice) || p.DeviceMacAddress.Equals(d.MacAddress, StringComparison.OrdinalIgnoreCase)))); - - if (!applicableDevices.Any()) - { - continue; - } - - if (_poweredOffByScreenSaver && !UserSessionInfo.UserLocalSession) - { - continue; - } - - var processes = Process.GetProcesses(); - - if (_poweredOffByScreenSaver) - { - if (processes.Any(p => p.Id == _poweredOffByScreenSaverProcessId)) - { - continue; - } - - Logger.Debug("Screensaver stopped, waking"); - _poweredOffByScreenSaver = false; - _poweredOffByScreenSaverProcessId = 0; - lastProcessId = 0; - WakeAfterStartupOrResume(PowerOnOffState.ScreenSaver); - - continue; - } - - var connectedDevices = applicableDevices.Where(d => d.IsConnected()).ToList(); - - if (!connectedDevices.Any()) - { - if (wasConnected) - { - Logger.Debug("Process monitor: TV(s) where connected, but not any longer"); - wasConnected = false; - continue; - } - else - { - var devices = applicableDevices.ToList(); - foreach (var device in devices) - { - Logger.Debug($"Process monitor: test connection with {device.Name}..."); - var test = await device.TestConnection(); - Logger.Debug("Process monitor: test connection result: " + test); - } - - connectedDevices = applicableDevices.Where(d => d.IsConnected()).ToList(); - - if (!connectedDevices.Any()) - { - continue; - } - } - } - - if (!wasConnected) - { - Logger.Debug("Process monitor: TV(s) where not connected, but connection has now been established"); - wasConnected = true; - } - - if (connectedDevices.Any(d => d.PowerOffOnScreenSaver || d.PowerOnAfterScreenSaver)) - { - lastProcessId = await HandleScreenSaverProcessAsync(lastProcessId, processes, connectedDevices); - } - - MonitorContext.Devices = connectedDevices.Where(d => d.TriggersEnabled).ToList(); - MonitorContext.RunningProcesses = processes; - - await ExecuteProcessPresets(MonitorContext); + return; } - catch (Exception ex) + + if (_poweredOffByScreenSaver && !_sessionSwitchDispatcher.UserLocalSession) { - Logger.Error("CheckProcesses: " + ex.ToLogString()); + return; } + + var processes = args.RunningProcesses; + + if (_poweredOffByScreenSaver) + { + if (processes.Any(p => p.Id == _poweredOffByScreenSaverProcessId)) + { + return; + } + + Logger.Debug("Screensaver stopped, waking"); + _poweredOffByScreenSaver = false; + _poweredOffByScreenSaverProcessId = 0; + WakeAfterStartupOrResume(PowerOnOffState.ScreenSaver); + + return; + } + + var connectedDevices = applicableDevices.Where(d => d.IsConnected()).ToList(); + + if (!connectedDevices.Any()) + { + if (wasConnected) + { + Logger.Debug("Process monitor: TV(s) where connected, but not any longer"); + wasConnected = false; + + return; + } + else + { + var devices = applicableDevices.ToList(); + foreach (var device in devices) + { + Logger.Debug($"Process monitor: test connection with {device.Name}..."); + var test = await device.TestConnection(); + Logger.Debug("Process monitor: test connection result: " + test); + } + + connectedDevices = applicableDevices.Where(d => d.IsConnected()).ToList(); + + if (!connectedDevices.Any()) + { + return; + } + } + } + + if (!wasConnected) + { + Logger.Debug("Process monitor: TV(s) where not connected, but connection has now been established"); + wasConnected = true; + } + + if (connectedDevices.Any(d => d.PowerOffOnScreenSaver || d.PowerOnAfterScreenSaver)) + { + await HandleScreenSaverProcessAsync(processes, connectedDevices); + } + + await ExecuteProcessPresets(args, connectedDevices); + + } + catch (Exception ex) + { + Logger.Error("ProcessChanged: " + ex.ToLogString()); } } - private void startWatch_EventArrived(object sender, EventArrivedEventArgs e) + private async Task ExecuteProcessPresets(ProcessChangedEventArgs context, IList connectedDevices) { - //Logger.Debug("Process started: " + e.NewEvent.Properties["ProcessName"].Value); - } + var triggerDevices = connectedDevices.Where(d => d.TriggersEnabled).ToList(); - private async Task HandleScreenSaverProcessAsync(int lastProcessId, Process[] processes, List connectedDevices) - { - var process = processes.FirstOrDefault(p => p.ProcessName.ToLowerInvariant().EndsWith(".scr")); - - if (process == null) + if (context.IsScreenSaverActive) { - return 0; + return; } - var parent = process.Parent(processes); - - if (parent?.ProcessName.Contains("winlogon") ?? false) - { - Logger.Debug($"Screensaver started: {process.ProcessName}, parent: {parent.ProcessName}"); - try - { - foreach (var device in connectedDevices.Where(d => d.PowerOffOnScreenSaver)) - { - Logger.Debug($"Screensaver check: test connection with {device.Name}..."); - var test = await device.TestConnection(); - Logger.Debug("Screensaver check: test connection result: " + test); - if (!test) - { - continue; - } - - Logger.Debug($"Screensaver check: powering off tv {device.Name} because of screensaver"); - try - { - _poweredOffByScreenSaver = await device.PowerOff(true).WaitAsync(TimeSpan.FromSeconds(5)); - } - catch (TimeoutException) - { - // Assume powering off was successful - _poweredOffByScreenSaver = true; - Logger.Error($"Screensaver check: timeout exception while powering off (probably connection closed)"); - } - catch (Exception pex) - { - // Assume powering off was successful - _poweredOffByScreenSaver = true; - Logger.Error($"Screensaver check: exception while powering off (probably connection closed): " + pex.Message); - } - Logger.Debug($"Screensaver check: powered off tv {device.Name}"); - } - - _poweredOffByScreenSaverProcessId = process.Id; - lastProcessId = 0; - } - catch (Exception e) - { - Logger.Error($"Screensaver check: can't power off: " + e.ToLogString()); - } - } - else if (process.Id != lastProcessId) - { - Logger.Debug($"Screensaver started: {process.ProcessName}, but invalid parent: {parent?.ProcessName ?? "no parent"}"); - lastProcessId = process.Id; - } - - return lastProcessId; - } - - private async Task ExecuteProcessPresets(ProcessMonitorContext context) - { var selectedDevice = SelectedDevice; var presets = _presets.Where(p => p.Triggers.Any(t => t.Trigger == PresetTriggerType.ProcessSwitch) && @@ -719,33 +627,6 @@ namespace ColorControl.Services.LG return; } - context.IsNotificationDisabled = FormUtils.IsNotificationDisabled(); - - var (processId, isFullScreen) = FormUtils.GetForegroundProcessIdAndIfFullScreen(); - - if (processId == Environment.ProcessId) - { - return; - } - - if (processId > 0) - { - var process = context.RunningProcesses.FirstOrDefault(p => p.Id == processId); - - if (process?.ProcessName?.Contains(".scr") ?? false) - { - return; - } - - context.ForegroundProcess = process; - context.ForegroundProcessIsFullScreen = isFullScreen; - } - else - { - context.ForegroundProcess = null; - context.ForegroundProcessIsFullScreen = false; - } - var changedProcesses = new List(); if (context.ForegroundProcess != null) { @@ -754,23 +635,14 @@ namespace ColorControl.Services.LG if (context.ForegroundProcess != null && context.ForegroundProcessIsFullScreen) { - if (!context.LastFullScreenProcessName.Equals(context.ForegroundProcess.ProcessName)) - { - context.LastFullScreenProcessName = context.ForegroundProcess.ProcessName; - //Logger.Debug($"Foreground fullscreen app detected: {context.ForegroundProcess.ProcessName}"); - } - presets = presets.Where(p => p.Triggers.Any(t => t.Conditions.HasFlag(PresetConditionType.FullScreen))); - context.WasFullScreen = true; } - else if (context.WasFullScreen) + else if (context.StoppedFullScreen) { presets = presets.Where(p => p.Triggers.Any(t => !t.Conditions.HasFlag(PresetConditionType.FullScreen))); - context.WasFullScreen = false; - context.LastFullScreenProcessName = string.Empty; } - var isHDRActive = context.Devices.Any(d => d.IsUsingHDRPictureMode()); + var isHDRActive = triggerDevices.Any(d => d.IsUsingHDRPictureMode()); var isGsyncActive = LgDevice.ExternalServiceHandler("GsyncEnabled", new[] { "" }); @@ -784,27 +656,11 @@ namespace ColorControl.Services.LG IsNotificationDisabled = context.IsNotificationDisabled }; - var toApplyPresets = new List(); - foreach (var preset in presets) - { - if (preset.Triggers.Any(t => t.TriggerActive(triggerContext))) - { - toApplyPresets.Add(preset); - } - } + var toApplyPresets = presets.Where(p => p.Triggers.Any(t => t.TriggerActive(triggerContext))).ToList(); if (toApplyPresets.Any()) { - LgPreset toApplyPreset; - if (toApplyPresets.Count > 1) - { - toApplyPreset = toApplyPresets.FirstOrDefault(p => p.Triggers.Any(t => !t.IncludedProcesses.Contains("*"))); - toApplyPreset = toApplyPreset != null ? toApplyPreset : toApplyPresets.First(); - } - else - { - toApplyPreset = toApplyPresets.First(); - } + var toApplyPreset = toApplyPresets.FirstOrDefault(p => toApplyPresets.Count == 1 || p.Triggers.Any(t => !t.IncludedProcesses.Contains("*"))) ?? toApplyPresets.First(); if (_lastTriggeredPreset != toApplyPreset) { @@ -815,6 +671,78 @@ namespace ColorControl.Services.LG } } + private async Task HandleScreenSaverProcessAsync(IList processes, List connectedDevices) + { + var process = processes.FirstOrDefault(p => p.ProcessName.ToLowerInvariant().EndsWith(".scr")); + + var powerOffDevices = connectedDevices.Where(d => d.PowerOffOnScreenSaver).ToList(); + + if (process == null) + { + powerOffDevices.ForEach(d => d.ClearPowerOffTask()); + + return; + } + + var parent = process.Parent(processes); + + // Ignore manually started screen savers + if (parent?.ProcessName.Contains("winlogon") != true) + { + return; + } + + Logger.Debug($"Screensaver started: {process.ProcessName}, parent: {parent.ProcessName}"); + try + { + foreach (var device in powerOffDevices) + { + Logger.Debug($"Screensaver check: test connection with {device.Name}..."); + var test = await device.TestConnection(); + Logger.Debug("Screensaver check: test connection result: " + test); + if (!test) + { + continue; + } + + if (device.ScreenSaverMinimalDuration > 0) + { + _poweredOffByScreenSaver = true; + + device.PowerOffIn(device.ScreenSaverMinimalDuration); + + continue; + } + + + Logger.Debug($"Screensaver check: powering off tv {device.Name} because of screensaver"); + try + { + _poweredOffByScreenSaver = await device.PowerOff(true).WaitAsync(TimeSpan.FromSeconds(5)); + } + catch (TimeoutException) + { + // Assume powering off was successful + _poweredOffByScreenSaver = true; + Logger.Error($"Screensaver check: timeout exception while powering off (probably connection closed)"); + } + catch (Exception pex) + { + // Assume powering off was successful + _poweredOffByScreenSaver = true; + Logger.Error($"Screensaver check: exception while powering off (probably connection closed): " + pex.Message); + } + Logger.Debug($"Screensaver check: powered off tv {device.Name}"); + } + + _poweredOffByScreenSaverProcessId = process.Id; + } + catch (Exception e) + { + Logger.Error($"Screensaver check: can't power off: " + e.ToLogString()); + } + } + internal void AddCustomDevice(LgDevice device) { Devices.Add(device); @@ -929,7 +857,7 @@ namespace ColorControl.Services.LG return; } - if (checkUserSession && !UserSessionInfo.UserLocalSession) + if (checkUserSession && !_sessionSwitchDispatcher.UserLocalSession) { Logger.Debug($"WakeAfterStartupOrResume: not waking because session info indicates no local session"); return; diff --git a/ColorControl/Services/NVIDIA/NvPanel.cs b/ColorControl/Services/NVIDIA/NvPanel.cs index 9b82d05..be6b262 100644 --- a/ColorControl/Services/NVIDIA/NvPanel.cs +++ b/ColorControl/Services/NVIDIA/NvPanel.cs @@ -1,7 +1,6 @@ using ColorControl.Common; using ColorControl.Forms; using ColorControl.Native; -using NLog; using nspector; using nspector.Common; using nspector.Common.Meta; @@ -24,7 +23,7 @@ namespace ColorControl.Services.NVIDIA { public static readonly int SHORTCUTID_NVQA = -200; - private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); + //private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private Config _config; private NvService _nvService; diff --git a/ColorControl/StartUpParams.cs b/ColorControl/StartUpParams.cs index aaacc42..3d03ecf 100644 --- a/ColorControl/StartUpParams.cs +++ b/ColorControl/StartUpParams.cs @@ -28,6 +28,7 @@ namespace ColorControl public bool RunningFromScheduledTask { get; private set; } public bool ActivateChromeFontFix { get; private set; } public bool DeactivateChromeFontFix { get; private set; } + public string ChromeFontFixApplicationDataFolder { get; private set; } public bool ExecuteHelp { get; private set; } public bool ExecuteNvidiaPreset { get; private set; } public string NvidiaPresetIdOrName { get; private set; } @@ -63,6 +64,12 @@ namespace ColorControl { switch (parseNameParam) { + case ActivateChromeFontFixParam: + case DeactivateChromeFontFixParam: + { + settings.ChromeFontFixApplicationDataFolder = arg; + break; + } case ExecuteNvidiaPresetParam: { settings.NvidiaPresetIdOrName = arg; @@ -132,11 +139,13 @@ namespace ColorControl case ActivateChromeFontFixParam: { settings.ActivateChromeFontFix = true; + parseNameParam = ActivateChromeFontFixParam; break; } case DeactivateChromeFontFixParam: { settings.DeactivateChromeFontFix = true; + parseNameParam = DeactivateChromeFontFixParam; break; } case ExecuteHelpParam: diff --git a/ColorControl/Svc/ColorControlBackgroundService.cs b/ColorControl/Svc/ColorControlBackgroundService.cs index 24c0734..b260e37 100644 --- a/ColorControl/Svc/ColorControlBackgroundService.cs +++ b/ColorControl/Svc/ColorControlBackgroundService.cs @@ -1,4 +1,5 @@ using ColorControl.Common; +using ColorControl.Services.EventDispatcher; using ColorControl.Services.LG; using ColorControl.Services.NVIDIA; using Microsoft.Extensions.Hosting; @@ -18,8 +19,14 @@ namespace ColorControl.Svc public sealed class ColorControlBackgroundService : BackgroundService { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); + private readonly SessionSwitchDispatcher _sessionSwitchDispatcher; private static string LgConfigFile = "LgConfig.json"; + public ColorControlBackgroundService(SessionSwitchDispatcher sessionSwitchDispatcher) + { + _sessionSwitchDispatcher = sessionSwitchDispatcher; + } + protected override async Task ExecuteAsync(CancellationToken stoppingToken) { try @@ -207,7 +214,7 @@ namespace ColorControl.Svc private async Task WakeDevicesAsync() { - if (!UserSessionInfo.UserLocalSession) + if (!_sessionSwitchDispatcher.UserLocalSession) { return; } diff --git a/Nspector/Nspector.csproj b/Nspector/Nspector.csproj index b46d752..6a7cfd2 100644 --- a/Nspector/Nspector.csproj +++ b/Nspector/Nspector.csproj @@ -1,7 +1,7 @@  - net6.0-windows10.0.20348.0 + net7.0-windows10.0.20348.0 enable true enable @@ -10,7 +10,7 @@ - + diff --git a/NvAPIWrapper/NvAPIWrapper.csproj b/NvAPIWrapper/NvAPIWrapper.csproj index 06c7f50..885e42e 100644 --- a/NvAPIWrapper/NvAPIWrapper.csproj +++ b/NvAPIWrapper/NvAPIWrapper.csproj @@ -1,8 +1,8 @@  - net6.0-windows10.0.20348.0 - 0.8.1.101 + net7.0-windows10.0.20348.0 + 0.8.1.102 falahati.net NvAPIWrapper is a .Net wrapper for NVIDIA public API Soroush Falahati