示例#1
0
        internal sealed override void Refresh(ref DisplayDevice displayDevice)
        {
            base.Refresh(ref displayDevice);

            this.RefreshMonitorList();

            if (this.State.HasFlag(DisplayAdapterStateIndicators.AttachedToDesktop))
            {
                var mode = GetCurrentDisplaySettingsEx(base.DeviceName, EnumDisplaySettingsExOptions.None);
                if (!mode.Equals(currentMode))
                {
                    currentMode = mode;
                    this.CurrentModeChanged?.Invoke(this, EventArgs.Empty);
                }
            }
        }
示例#2
0
 internal DisplayAdapter(DisplayDevice displayDevice)
     : base(ref displayDevice)
 {
     monitorsByDeviceName = new Dictionary <string, DisplayMonitor>();
     currentMode          = GetCurrentDisplaySettingsEx(base.DeviceName, EnumDisplaySettingsExOptions.None);
 }
示例#3
0
 internal static extern bool EnumDisplaySettingsExW(
     [In, MarshalAs(UnmanagedType.LPWStr)] string deviceName,
     [In] int modeIndex,
     [In, Out] ref DisplayDeviceMode devMode,
     [In] EnumDisplaySettingsExOptions options
     );