[WIP] Partially working shortcut detection

Fixed the profile validitiy detection on load,
but now have issue with the shortcut detection
This commit is contained in:
Terry MacDonald
2021-03-07 17:11:46 +13:00
parent 1588cd6a0b
commit 4531a0d4d5
6 changed files with 93 additions and 53 deletions

View File

@ -433,7 +433,28 @@ namespace DisplayMagicianShared
return shortcutFileName != null && System.IO.File.Exists(shortcutFileName);
}
public void RefreshPossbility()
{
// Check each display in this profile and make sure it's currently available
int validDisplayCount = 0;
foreach (string profileDisplayIdentifier in ProfileDisplayIdentifiers)
{
// If this profile has a display that isn't currently available then we need to say it's a no!
if (ProfileRepository.ConnectedDisplayIdentifiers.Contains(profileDisplayIdentifier))
validDisplayCount++;
}
if (validDisplayCount == ProfileDisplayIdentifiers.Count)
{
SharedLogger.logger.Debug($"ProfileRepository/IsPossibleRefresh: The profile {Name} is possible!");
_isPossible = true;
}
else
{
SharedLogger.logger.Debug($"ProfileRepository/IsPossibleRefresh: The profile {Name} is NOT possible!");
_isPossible = false;
}
}
}
// Custom Equality comparer for the Profile class