Пример #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);
 }