public IEnumerable <Display> Get() { var machineKeyHasChanged = _machineKeyHandler.CheckIfMachineKeyHasChanhed(); _machineKeyHandler.UpdateMachineKey(); var serializedDispalys = _settingsHandler.GetDisplays(); var savedDisplays = Deserialize(serializedDispalys); //TODO: for testing purposes move Screen.AllScreens to separate class var presentDisplays = Screen.AllScreens.Select(screen => new Display(screen.DeviceName, screen.Bounds.X, screen.Bounds.Y, screen.Bounds.Width, screen.Bounds.Height, true)); if (!machineKeyHasChanged && savedDisplays != null && savedDisplays.Count() == presentDisplays.Count()) { return(savedDisplays); } return(presentDisplays); }