public bool HasDisplaysAttached() { try { return(DisplayDevice.GetGDIPrimaryDisplayDevice() != null); } catch (Exception) { return(false); } }
private void SetCurrentDisplay(NvPreset preset) { if (preset.primaryDisplay) { var displayId = DisplayDevice.GetGDIPrimaryDisplayDevice().DisplayId; _currentDisplay = Display.GetDisplays().FirstOrDefault(x => x.DisplayDevice.DisplayId == displayId); } else { _currentDisplay = Display.GetDisplays().FirstOrDefault(x => x.Name.Equals(preset.displayName)); } }