Move SkippedConnectionTypes earlier to stop error

This commit is contained in:
Terry MacDonald 2022-02-10 09:02:17 +13:00
parent 1f6af1f0c7
commit 963b267158
3 changed files with 23 additions and 23 deletions

View File

@ -26,8 +26,8 @@ using System.Resources;
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
// Version information
[assembly: AssemblyVersion("2.2.0.250")]
[assembly: AssemblyFileVersion("2.2.0.250")]
[assembly: AssemblyVersion("2.2.0.252")]
[assembly: AssemblyFileVersion("2.2.0.252")]
[assembly: NeutralResourcesLanguageAttribute( "en" )]
[assembly: CLSCompliant(true)]

View File

@ -171,6 +171,16 @@ namespace DisplayMagicianShared.AMD
static AMDLibrary() { }
public AMDLibrary()
{
// Populate the list of ConnectionTypes we want to skip as they don't support querying
SkippedColorConnectionTypes = new List<ADL_DISPLAY_CONNECTION_TYPE> {
ADL_DISPLAY_CONNECTION_TYPE.Composite,
ADL_DISPLAY_CONNECTION_TYPE.DVI_D,
ADL_DISPLAY_CONNECTION_TYPE.DVI_I,
ADL_DISPLAY_CONNECTION_TYPE.RCA_3Component,
ADL_DISPLAY_CONNECTION_TYPE.SVideo,
ADL_DISPLAY_CONNECTION_TYPE.VGA
};
_activeDisplayConfig = CreateDefaultConfig();
try
{
@ -211,17 +221,7 @@ namespace DisplayMagicianShared.AMD
{
// If we get here then the AMD ADL DLL wasn't found. We can't continue to use it, so we log the error and exit
SharedLogger.logger.Info(ex, $"AMDLibrary/AMDLibrary: Exception trying to load the AMD ADL DLL {ADLImport.ATI_ADL_DLL}. This generally means you don't have the AMD ADL driver installed.");
}
// Populate the list of ConnectionTypes we want to skip as they don't support querying
SkippedColorConnectionTypes = new List<ADL_DISPLAY_CONNECTION_TYPE> {
ADL_DISPLAY_CONNECTION_TYPE.Composite,
ADL_DISPLAY_CONNECTION_TYPE.DVI_D,
ADL_DISPLAY_CONNECTION_TYPE.DVI_I,
ADL_DISPLAY_CONNECTION_TYPE.RCA_3Component,
ADL_DISPLAY_CONNECTION_TYPE.SVideo,
ADL_DISPLAY_CONNECTION_TYPE.VGA
};
}
}

View File

@ -161,6 +161,15 @@ namespace DisplayMagicianShared.NVIDIA
static NVIDIALibrary() { }
public NVIDIALibrary()
{
// Populate the list of ConnectionTypes we want to skip as they don't support querying
SkippedColorConnectionTypes = new List<NV_MONITOR_CONN_TYPE> {
NV_MONITOR_CONN_TYPE.VGA,
NV_MONITOR_CONN_TYPE.COMPONENT,
NV_MONITOR_CONN_TYPE.SVIDEO,
NV_MONITOR_CONN_TYPE.DVI,
NV_MONITOR_CONN_TYPE.COMPOSITE,
};
_activeDisplayConfig = CreateDefaultConfig();
try
{
@ -197,16 +206,7 @@ namespace DisplayMagicianShared.NVIDIA
{
// If this fires, then the DLL isn't available, so we need don't try to do anything else
SharedLogger.logger.Info(ex, $"NVIDIALibrary/NVIDIALibrary: Exception trying to load the NVIDIA NVAPI DLL. This generally means you don't have the NVIDIA driver installed.");
}
// Populate the list of ConnectionTypes we want to skip as they don't support querying
SkippedColorConnectionTypes = new List<NV_MONITOR_CONN_TYPE> {
NV_MONITOR_CONN_TYPE.VGA,
NV_MONITOR_CONN_TYPE.COMPONENT,
NV_MONITOR_CONN_TYPE.SVIDEO,
NV_MONITOR_CONN_TYPE.DVI,
NV_MONITOR_CONN_TYPE.COMPOSITE,
};
}
}