Entity Framework: Как я могу обнаружить изменения, внесенные в объект в другой форме?

Как правило, максимальное разрешение является основным разрешением для ЖК-дисплеев. Однако это не всегда так. Если мы можем использовать там, получить Max Resolutions должно быть достаточно.

Максимальное разрешение может быть получено с помощью:

    [DllImport("user32.dll")]
    private static extern int EnumDisplaySettings(string deviceName, int modeNum, ref DeviceMode devMode);

    /// <summary>
    /// Gets the max resolution + refresh rate supported by specific display
    /// </summary>
    /// <param name="deviceName">Device name(System.Windows.Forms.Screen.DeviceName)</param>
    /// <param name="dispWidth">Width of the display</param>
    /// <param name="dispHeight">Height of the display</param>
    /// <param name="refreshRate">Refresh rate of the display</param>
    /// <returns></returns>
    public static void GetMaxResolutionWithRefreshRate(string deviceName, out int dispWidth, out int dispHeight, out int refreshRate)
    {
        dispWidth = dispHeight = refreshRate = 0;
        DeviceMode deviceMode = new DeviceMode();
        for (int i = 0; Win32.EnumDisplaySettings(deviceName, i, ref deviceMode) != 0; i++)
        {
            if (deviceMode.dmPelsWidth > dispWidth || (deviceMode.dmPelsWidth == dispWidth && deviceMode.dmPelsHeight >= dispHeight && deviceMode.dmDisplayFrequency >= refreshRate))
            {
                dispWidth = deviceMode.dmPelsWidth;
                dispHeight = deviceMode.dmPelsHeight;
                refreshRate = deviceMode.dmDisplayFrequency;
            }
        }
    }

public static void GetMaxResolutionWithRefreshRate(out int dispWidth, out int dispHeight, out int refreshRate)
    {
        GetMaxResolutionWithRefreshRate(null, out dispWidth, out dispHeight, out refreshRate);
    }
0
задан Vedat Galimidi 11 December 2014 в 13:26
поделиться