Пример #1
0
        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);
        }
Пример #2
0
        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;
        }
Пример #3
0
 // Gets possible resolutions, monitor names.
 public void PopulateSystemMonitorInformation()
 {
     Monitors = ScreenInterrogatory.GetMonitorInformation();
 }