private static void UpdateDisplays() { Displays.Clear(); NativeMethods.NativeMethods.EnumDisplayMonitors(IntPtr.Zero, IntPtr.Zero, (IntPtr hMonitor, IntPtr hdcMonitor, ref RECT rect, IntPtr lpData) => { var monitorInfo = new MonitorInfo { CbSize = (uint)Marshal.SizeOf(typeof(MonitorInfo)) }; if (NativeMethods.NativeMethods.GetMonitorInfo(hMonitor, ref monitorInfo)) { Displays.Add(new DisplayInfo(hMonitor, monitorInfo)); } return(true); }, IntPtr.Zero); DisplayConfigChanged?.Invoke(null, EventArgs.Empty); }
protected void OnConfigUpdated(DisplayConfig newConfig) { DisplayConfigChanged?.Invoke(this, newConfig); }
protected void OnConfigUpdated(DisplayConfig newConfig) { CurrentConfig = newConfig; DisplayConfigChanged?.Invoke(this, newConfig); }