Use new DisplayDevice.GetDisplay() interface instead of obsolete AvailableDisplays.

This commit is contained in:
the_fiddler 2011-12-15 11:30:39 +00:00
parent e838aa7953
commit 7569345e0a

View file

@ -18,16 +18,20 @@ namespace Examples.Tests
{
public static void Main()
{
foreach (DisplayDevice dev in DisplayDevice.AvailableDisplays)
for (int i = 0; i < 6; i++)
{
Trace.WriteLine(dev.ToString());
MessageBox.Show(dev.ToString());
dev.ChangeResolution(dev.SelectResolution(640, 480, 32, 60.0f));
Thread.Sleep(1000);
MessageBox.Show(dev.ToString());
dev.RestoreResolution();
Thread.Sleep(1000);
MessageBox.Show(dev.ToString());
DisplayDevice dev = DisplayDevice.GetDisplay(DisplayIndex.First + i);
if (dev != null)
{
Trace.WriteLine(dev.ToString());
MessageBox.Show(dev.ToString());
dev.ChangeResolution(dev.SelectResolution(640, 480, 32, 60.0f));
Thread.Sleep(1000);
MessageBox.Show(dev.ToString());
dev.RestoreResolution();
Thread.Sleep(1000);
MessageBox.Show(dev.ToString());
}
}
}
}