Exemplo n.º 1
0
 public bool HasDisplaysAttached()
 {
     try
     {
         return(DisplayDevice.GetGDIPrimaryDisplayDevice() != null);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 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));
     }
 }