示例#1
0
 /// <summary>
 /// Gets the desktop information associated with the specified monitor.
 /// </summary>
 /// <param name="monitorDevice">Monitor information.</param>
 /// <returns>
 /// Returns a <see cref="DesktopDeviceInfo"/> structure that contains the desktop information associated with the specified monitor.
 /// </returns>
 public static DesktopDeviceInfo GetDesktopInfoFromMonitor(MonitorDeviceInfo monitorDevice) => GetDesktopInfoFromDisplay(monitorDevice.DisplayName);
示例#2
0
        /// <summary>
        /// Get the video adapter information associated with the specified monitor.
        /// </summary>
        /// <param name="monitorDeviceInfo"> Monitor information. </param>
        /// <returns>
        /// Returns a <see cref="VideoAdapterDeviceInfo"/> structure that contains the adapter information associated with the specified monitor.
        /// </returns>
        public static VideoAdapterDeviceInfo GetVideoAdapterDeviceFromMonitor(MonitorDeviceInfo monitorDeviceInfo)
        {
            var adapters = EnumerateVideoAdapterDevices();

            return(adapters.SingleOrDefault(adapter => adapter.DisplayName == monitorDeviceInfo.DisplayName));
        }