private String[] GetAvailableMonitors() { Screen[] allScreens = Screen.AllScreens; Dictionary <Int32, String> friendlyNames = ScreenInterrogatory.GetAllMonitorFriendlyNamesSafe(); String[] result = new String[allScreens.Length]; for (Int32 index = 0; index < allScreens.Length; index++) { Screen screen = allScreens[index]; StringBuilder sb = new StringBuilder(); sb.Append(index); sb.Append(" - "); String name; if (!friendlyNames.TryGetValue(index, out name)) { name = screen.DeviceName; } sb.Append(name); if (screen.Primary) { sb.Append(" [Primary]"); } result[index] = sb.ToString(); if (screen.Primary) { _activeMonitor = result[index]; } } return(result); }
public void LoadFullscreenComboSetting() { var fullscreenValue = SystemSettings.Default.Video_IsFullscreen; var borderValue = SystemSettings.Default.Video_IsBorderless; var option = ScreenInterrogatory.GetWindowOption(WindowOptions, fullscreenValue, borderValue); var optionName = option.Name; if (optionName.IsNullOrEmpty() || !FullscreenCombo.Items.Contains(optionName)) { FullscreenCombo.SelectedItem = FullscreenCombo.Items[0]; } FullscreenCombo.SelectedItem = optionName; }
// Gets possible resolutions, monitor names. public void PopulateSystemMonitorInformation() { Monitors = ScreenInterrogatory.GetMonitorInformation(); }