コード例 #1
0
        public async Task InitializeAsync()
        {
            _ActivityCount += 1;

            var resolutions = new HashSet <(int x, int y)>();

            await Task.Run(() =>
            {
                var devmode = new DEVMODE();
                for (int i = 0; DEVMODE.EnumDisplaySettings(null, i, ref devmode); i++)
                {
                    resolutions.Add((devmode.dmPelsWidth, devmode.dmPelsHeight));
                }
            });

            ResolutionItems = new ObservableCollection <Tuple <int, int> >(resolutions
                                                                           .Select(r => Tuple.Create(r.x, r.y)));

            _Table = await _LoadOptionsFileAsync();

            _RefreshFromTable(_Table);

            _ActivityCount -= 1;
        }
コード例 #2
0
 public static extern bool EnumDisplaySettings(string deviceName, int modeNum, ref DEVMODE devMode);