예제 #1
0
 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);
 }
예제 #2
0
 protected void OnConfigUpdated(DisplayConfig newConfig)
 {
     DisplayConfigChanged?.Invoke(this, newConfig);
 }
예제 #3
0
 protected void OnConfigUpdated(DisplayConfig newConfig)
 {
     CurrentConfig = newConfig;
     DisplayConfigChanged?.Invoke(this, newConfig);
 }