mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
Improving Profile Form messages
This commit is contained in:
parent
54f3f5271a
commit
a39a9d202c
@ -420,29 +420,7 @@ namespace HeliosPlus.Shared
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsPossibleProfile(ProfileItem profile)
|
|
||||||
{
|
|
||||||
if (!(_currentProfile is ProfileItem))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!(profile is ProfileItem))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Check each display in this profile and make sure it's currently available
|
|
||||||
int validDisplayCount = 0;
|
|
||||||
foreach (string profileDisplayIdentifier in profile.ProfileDisplayIdentifiers)
|
|
||||||
{
|
|
||||||
// If this profile has a display that isn't currently available then we need to say it's a no!
|
|
||||||
if (_currentProfile.ProfileDisplayIdentifiers.Contains(profileDisplayIdentifier))
|
|
||||||
validDisplayCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (validDisplayCount == profile.ProfileDisplayIdentifiers.Count)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool LoadProfiles()
|
private static bool LoadProfiles()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -584,45 +562,50 @@ namespace HeliosPlus.Shared
|
|||||||
List<string> displayIdentifiers = new List<string>();
|
List<string> displayIdentifiers = new List<string>();
|
||||||
|
|
||||||
// If the Video Card is an NVidia, then we should generate specific NVidia displayIdentifiers
|
// If the Video Card is an NVidia, then we should generate specific NVidia displayIdentifiers
|
||||||
NvAPIWrapper.GPU.LogicalGPU[] myLogicalGPUs = NvAPIWrapper.GPU.LogicalGPU.GetLogicalGPUs();
|
bool isNvidia = false;
|
||||||
if (myLogicalGPUs.Length > 0)
|
NvAPIWrapper.GPU.PhysicalGPU[] myPhysicalGPUs = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
myPhysicalGPUs = NvAPIWrapper.GPU.PhysicalGPU.GetPhysicalGPUs();
|
||||||
|
isNvidia = true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
if (isNvidia && myPhysicalGPUs != null && myPhysicalGPUs.Length > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (NvAPIWrapper.GPU.LogicalGPU myLogicalGPU in myLogicalGPUs)
|
foreach (NvAPIWrapper.GPU.PhysicalGPU myPhysicalGPU in myPhysicalGPUs)
|
||||||
{
|
{
|
||||||
NvAPIWrapper.GPU.PhysicalGPU[] myPhysicalGPUs = myLogicalGPU.CorrespondingPhysicalGPUs;
|
// get a list of all physical outputs attached to the GPUs
|
||||||
foreach (NvAPIWrapper.GPU.PhysicalGPU myPhysicalGPU in myPhysicalGPUs)
|
NvAPIWrapper.GPU.GPUOutput[] myGPUOutputs = myPhysicalGPU.ActiveOutputs;
|
||||||
|
foreach (NvAPIWrapper.GPU.GPUOutput aGPUOutput in myGPUOutputs)
|
||||||
{
|
{
|
||||||
// get a list of all physical outputs attached to the GPUs
|
// Figure out the displaydevice attached to the output
|
||||||
NvAPIWrapper.GPU.GPUOutput[] myGPUOutputs = myPhysicalGPU.ActiveOutputs;
|
NvAPIWrapper.Display.DisplayDevice aConnectedDisplayDevice = myPhysicalGPU.GetDisplayDeviceByOutput(aGPUOutput);
|
||||||
foreach (NvAPIWrapper.GPU.GPUOutput aGPUOutput in myGPUOutputs)
|
|
||||||
{
|
|
||||||
// Figure out the displaydevice attached to the output
|
|
||||||
NvAPIWrapper.Display.DisplayDevice aConnectedDisplayDevice = myPhysicalGPU.GetDisplayDeviceByOutput(aGPUOutput);
|
|
||||||
|
|
||||||
// Create an array of all the important display info we need to record
|
// Create an array of all the important display info we need to record
|
||||||
string[] displayInfo = {
|
string[] displayInfo = {
|
||||||
"NVIDIA",
|
"NVIDIA",
|
||||||
myLogicalGPU.ToString(),
|
myPhysicalGPU.CorrespondingLogicalGPU.ToString(),
|
||||||
myPhysicalGPU.ToString(),
|
myPhysicalGPU.ToString(),
|
||||||
myPhysicalGPU.ArchitectInformation.ShortName.ToString(),
|
myPhysicalGPU.ArchitectInformation.ShortName.ToString(),
|
||||||
myPhysicalGPU.ArchitectInformation.Revision.ToString(),
|
myPhysicalGPU.ArchitectInformation.Revision.ToString(),
|
||||||
myPhysicalGPU.Board.ToString(),
|
myPhysicalGPU.Board.ToString(),
|
||||||
myPhysicalGPU.Foundry.ToString(),
|
myPhysicalGPU.Foundry.ToString(),
|
||||||
myPhysicalGPU.GPUId.ToString(),
|
myPhysicalGPU.GPUId.ToString(),
|
||||||
myPhysicalGPU.GPUType.ToString(),
|
myPhysicalGPU.GPUType.ToString(),
|
||||||
aGPUOutput.OutputId.ToString(),
|
aGPUOutput.OutputId.ToString(),
|
||||||
aConnectedDisplayDevice.ConnectionType.ToString(),
|
aConnectedDisplayDevice.ConnectionType.ToString(),
|
||||||
aConnectedDisplayDevice.DisplayId.ToString()
|
aConnectedDisplayDevice.DisplayId.ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a display identifier out of it
|
|
||||||
string displayIdentifier = String.Join("|", displayInfo);
|
|
||||||
// Add it to the list of display identifiers so we can return it
|
|
||||||
displayIdentifiers.Add(displayIdentifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Create a display identifier out of it
|
||||||
|
string displayIdentifier = String.Join("|", displayInfo);
|
||||||
|
// Add it to the list of display identifiers so we can return it
|
||||||
|
displayIdentifiers.Add(displayIdentifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else videocard is not NVIdia so we just use the WindowsAPI access method
|
// else videocard is not NVIdia so we just use the WindowsAPI access method
|
||||||
@ -633,16 +616,29 @@ namespace HeliosPlus.Shared
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Then go through the adapters we have running using the WindowsDisplayAPI
|
// Then go through the adapters we have running using the WindowsDisplayAPI
|
||||||
List<DisplayAdapter> allDisplayAdapters = DisplayAdapter.GetDisplayAdapters().ToList();
|
List<Display> attachedDisplayDevices = Display.GetDisplays().ToList();
|
||||||
foreach (DisplayAdapter displayAdapter in allDisplayAdapters)
|
|
||||||
|
foreach (Display attachedDisplay in attachedDisplayDevices)
|
||||||
{
|
{
|
||||||
|
DisplayAdapter displayAdapter = attachedDisplay.Adapter;
|
||||||
PathDisplayAdapter pathDisplayAdapter = displayAdapter.ToPathDisplayAdapter();
|
PathDisplayAdapter pathDisplayAdapter = displayAdapter.ToPathDisplayAdapter();
|
||||||
List<DisplayDevice> displayDevices = displayAdapter.GetDisplayDevices().Where(da => da.IsAvailable).ToList();
|
PathDisplaySource pathDisplaySource = attachedDisplay.ToPathDisplaySource();
|
||||||
|
PathDisplayTarget pathDisplayTarget = attachedDisplay.ToPathDisplayTarget();
|
||||||
// skip this DisplayAdapter if the number of available DisplayDevices is 0
|
|
||||||
if (displayDevices.Count == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
|
Debug.WriteLine($"ADDN : {attachedDisplay.DeviceName}");
|
||||||
|
Debug.WriteLine($"ADDFN : {attachedDisplay.DisplayFullName}");
|
||||||
|
Debug.WriteLine($"ADDIN : {attachedDisplay.DisplayName}");
|
||||||
|
Debug.WriteLine($"ADDIN : {attachedDisplay.IsAvailable}");
|
||||||
|
Debug.WriteLine($"ADDIGP : {attachedDisplay.IsGDIPrimary}");
|
||||||
|
Debug.WriteLine($"ADDIV : {attachedDisplay.IsValid}");
|
||||||
|
Debug.WriteLine($"ADCSCD : {attachedDisplay.CurrentSetting.ColorDepth}");
|
||||||
|
Debug.WriteLine($"ADCSF : {attachedDisplay.CurrentSetting.Frequency}");
|
||||||
|
Debug.WriteLine($"ADCSIE : {attachedDisplay.CurrentSetting.IsEnable}");
|
||||||
|
Debug.WriteLine($"ADCSII : {attachedDisplay.CurrentSetting.IsInterlaced}");
|
||||||
|
Debug.WriteLine($"ADCSO : {attachedDisplay.CurrentSetting.Orientation.ToString()}");
|
||||||
|
Debug.WriteLine($"ADCSOSM : {attachedDisplay.CurrentSetting.OutputScalingMode.ToString()}");
|
||||||
|
Debug.WriteLine($"ADCSP : {attachedDisplay.CurrentSetting.Position.ToString()}");
|
||||||
|
Debug.WriteLine($"ADCSR : {attachedDisplay.CurrentSetting.Resolution.ToString()}");
|
||||||
Debug.WriteLine($"DP : {displayAdapter.DevicePath}");
|
Debug.WriteLine($"DP : {displayAdapter.DevicePath}");
|
||||||
Debug.WriteLine($"DK : {displayAdapter.DeviceKey}");
|
Debug.WriteLine($"DK : {displayAdapter.DeviceKey}");
|
||||||
Debug.WriteLine($"DN : {displayAdapter.DeviceName}");
|
Debug.WriteLine($"DN : {displayAdapter.DeviceName}");
|
||||||
@ -650,63 +646,44 @@ namespace HeliosPlus.Shared
|
|||||||
Debug.WriteLine($"AI : {pathDisplayAdapter.AdapterId}");
|
Debug.WriteLine($"AI : {pathDisplayAdapter.AdapterId}");
|
||||||
Debug.WriteLine($"AIDP : {pathDisplayAdapter.DevicePath}");
|
Debug.WriteLine($"AIDP : {pathDisplayAdapter.DevicePath}");
|
||||||
Debug.WriteLine($"AIII : {pathDisplayAdapter.IsInvalid}");
|
Debug.WriteLine($"AIII : {pathDisplayAdapter.IsInvalid}");
|
||||||
|
Debug.WriteLine($"DDA : {displayAdapter.DeviceName}");
|
||||||
|
Debug.WriteLine($"PDSA : {pathDisplaySource.Adapter}");
|
||||||
|
Debug.WriteLine($"PDSCDS : {pathDisplaySource.CurrentDPIScale}");
|
||||||
|
Debug.WriteLine($"PDSDN : {pathDisplaySource.DisplayName}");
|
||||||
|
Debug.WriteLine($"PDSMDS : {pathDisplaySource.MaximumDPIScale}");
|
||||||
|
Debug.WriteLine($"PDSRDS : {pathDisplaySource.RecommendedDPIScale}");
|
||||||
|
Debug.WriteLine($"PDSSI : {pathDisplaySource.SourceId}");
|
||||||
|
Debug.WriteLine($"PDTA : {pathDisplayTarget.Adapter}");
|
||||||
|
Debug.WriteLine($"PDTCI : {pathDisplayTarget.ConnectorInstance}");
|
||||||
|
Debug.WriteLine($"PDTDP : {pathDisplayTarget.DevicePath}");
|
||||||
|
Debug.WriteLine($"PDTEMC : {pathDisplayTarget.EDIDManufactureCode}");
|
||||||
|
Debug.WriteLine($"PDTEMI : {pathDisplayTarget.EDIDManufactureId}");
|
||||||
|
Debug.WriteLine($"PDTEPC : {pathDisplayTarget.EDIDProductCode}");
|
||||||
|
Debug.WriteLine($"PDTFN : {pathDisplayTarget.FriendlyName}");
|
||||||
|
Debug.WriteLine($"PDTIA : {pathDisplayTarget.IsAvailable}");
|
||||||
|
Debug.WriteLine($"PDTPR : {pathDisplayTarget.PreferredResolution}");
|
||||||
|
Debug.WriteLine($"PDTPSM : {pathDisplayTarget.PreferredSignalMode}");
|
||||||
|
Debug.WriteLine($"PDTTI : {pathDisplayTarget.TargetId}");
|
||||||
|
Debug.WriteLine($"PDTVRS : {pathDisplayTarget.VirtualResolutionSupport}");
|
||||||
|
|
||||||
foreach (DisplayDevice displayDevice in displayDevices)
|
// Create an array of all the important display info we need to record
|
||||||
{
|
string[] displayInfo = {
|
||||||
|
"WINAPI",
|
||||||
|
displayAdapter.DeviceName.ToString(),
|
||||||
|
pathDisplayAdapter.AdapterId.ToString(),
|
||||||
|
pathDisplayTarget.ConnectorInstance.ToString(),
|
||||||
|
pathDisplayTarget.FriendlyName,
|
||||||
|
pathDisplayTarget.EDIDManufactureCode.ToString(),
|
||||||
|
pathDisplayTarget.EDIDManufactureId.ToString(),
|
||||||
|
pathDisplayTarget.EDIDProductCode.ToString(),
|
||||||
|
pathDisplayTarget.TargetId.ToString(),
|
||||||
|
};
|
||||||
|
|
||||||
PathDisplaySource pathDisplaySource = displayDevice.ToPathDisplaySource();
|
// Create a display identifier out of it
|
||||||
PathDisplayTarget pathDisplayTarget = displayDevice.ToPathDisplayTarget();
|
string displayIdentifier = String.Join("|", displayInfo);
|
||||||
|
// Add it to the list of display identifiers so we can return it
|
||||||
|
displayIdentifiers.Add(displayIdentifier);
|
||||||
|
|
||||||
// skip this DisplayDevice if it isn't available
|
|
||||||
if (!displayDevice.IsAvailable)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Console.WriteLine($"DDA : {displayDevice.Adapter}");
|
|
||||||
Debug.WriteLine($"DDDK : {displayDevice.DeviceKey}");
|
|
||||||
Debug.WriteLine($"DDDN : {displayDevice.DeviceName}");
|
|
||||||
Debug.WriteLine($"DDDP : {displayDevice.DevicePath}");
|
|
||||||
Debug.WriteLine($"DDDiFN : {displayDevice.DisplayFullName}");
|
|
||||||
Debug.WriteLine($"DDDiN : {displayDevice.DisplayName}");
|
|
||||||
Debug.WriteLine($"DDDiIA : {displayDevice.IsAvailable}");
|
|
||||||
Debug.WriteLine($"DDDiIV : {displayDevice.IsValid}");
|
|
||||||
Debug.WriteLine($"PDSA : {pathDisplaySource.Adapter}");
|
|
||||||
Debug.WriteLine($"PDSCDS : {pathDisplaySource.CurrentDPIScale}");
|
|
||||||
Debug.WriteLine($"PDSDN : {pathDisplaySource.DisplayName}");
|
|
||||||
Debug.WriteLine($"PDSMDS : {pathDisplaySource.MaximumDPIScale}");
|
|
||||||
Debug.WriteLine($"PDSRDS : {pathDisplaySource.RecommendedDPIScale}");
|
|
||||||
Debug.WriteLine($"PDSSI : {pathDisplaySource.SourceId}");
|
|
||||||
Debug.WriteLine($"PDTA : {pathDisplayTarget.Adapter}");
|
|
||||||
Debug.WriteLine($"PDTCI : {pathDisplayTarget.ConnectorInstance}");
|
|
||||||
Debug.WriteLine($"PDTDP : {pathDisplayTarget.DevicePath}");
|
|
||||||
Debug.WriteLine($"PDTEMC : {pathDisplayTarget.EDIDManufactureCode}");
|
|
||||||
Debug.WriteLine($"PDTEMI : {pathDisplayTarget.EDIDManufactureId}");
|
|
||||||
Debug.WriteLine($"PDTEPC : {pathDisplayTarget.EDIDProductCode}");
|
|
||||||
Debug.WriteLine($"PDTFN : {pathDisplayTarget.FriendlyName}");
|
|
||||||
Debug.WriteLine($"PDTIA : {pathDisplayTarget.IsAvailable}");
|
|
||||||
Debug.WriteLine($"PDTPR : {pathDisplayTarget.PreferredResolution}");
|
|
||||||
Debug.WriteLine($"PDTPSM : {pathDisplayTarget.PreferredSignalMode}");
|
|
||||||
Debug.WriteLine($"PDTTI : {pathDisplayTarget.TargetId}");
|
|
||||||
Debug.WriteLine($"PDTVRS : {pathDisplayTarget.VirtualResolutionSupport}");
|
|
||||||
|
|
||||||
// Create an array of all the important display info we need to record
|
|
||||||
string[] displayInfo = {
|
|
||||||
"WINAPI",
|
|
||||||
displayAdapter.DeviceName.ToString(),
|
|
||||||
pathDisplayAdapter.AdapterId.ToString(),
|
|
||||||
pathDisplaySource.SourceId.ToString(),
|
|
||||||
pathDisplayTarget.ConnectorInstance.ToString(),
|
|
||||||
pathDisplayTarget.FriendlyName,
|
|
||||||
pathDisplayTarget.EDIDManufactureCode.ToString(),
|
|
||||||
pathDisplayTarget.EDIDManufactureId.ToString(),
|
|
||||||
pathDisplayTarget.EDIDProductCode.ToString(),
|
|
||||||
pathDisplayTarget.TargetId.ToString(),
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create a display identifier out of it
|
|
||||||
string displayIdentifier = String.Join("|", displayInfo);
|
|
||||||
// Add it to the list of display identifiers so we can return it
|
|
||||||
displayIdentifiers.Add(displayIdentifier);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -773,12 +750,30 @@ namespace HeliosPlus.Shared
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Then go through the adapters we have running using the WindowsDisplayAPI
|
// Then go through the adapters we have running using the WindowsDisplayAPI
|
||||||
List<DisplayAdapter> allDisplayAdapters = DisplayAdapter.GetDisplayAdapters().ToList();
|
List<Display> attachedDisplayDevices = Display.GetDisplays().ToList();
|
||||||
foreach (DisplayAdapter displayAdapter in allDisplayAdapters)
|
List<UnAttachedDisplay> unattachedDisplayDevices = UnAttachedDisplay.GetUnAttachedDisplays().ToList();
|
||||||
{
|
|
||||||
PathDisplayAdapter pathDisplayAdapter = displayAdapter.ToPathDisplayAdapter();
|
|
||||||
List<DisplayDevice> displayDevices = displayAdapter.GetDisplayDevices().ToList();
|
|
||||||
|
|
||||||
|
foreach (Display attachedDisplay in attachedDisplayDevices)
|
||||||
|
{
|
||||||
|
DisplayAdapter displayAdapter = attachedDisplay.Adapter;
|
||||||
|
PathDisplayAdapter pathDisplayAdapter = displayAdapter.ToPathDisplayAdapter();
|
||||||
|
PathDisplaySource pathDisplaySource = attachedDisplay.ToPathDisplaySource();
|
||||||
|
PathDisplayTarget pathDisplayTarget = attachedDisplay.ToPathDisplayTarget();
|
||||||
|
|
||||||
|
Debug.WriteLine($"ADDN : {attachedDisplay.DeviceName}");
|
||||||
|
Debug.WriteLine($"ADDFN : {attachedDisplay.DisplayFullName}");
|
||||||
|
Debug.WriteLine($"ADDIN : {attachedDisplay.DisplayName}");
|
||||||
|
Debug.WriteLine($"ADDIN : {attachedDisplay.IsAvailable}");
|
||||||
|
Debug.WriteLine($"ADDIGP : {attachedDisplay.IsGDIPrimary}");
|
||||||
|
Debug.WriteLine($"ADDIV : {attachedDisplay.IsValid}");
|
||||||
|
Debug.WriteLine($"ADCSCD : {attachedDisplay.CurrentSetting.ColorDepth}");
|
||||||
|
Debug.WriteLine($"ADCSF : {attachedDisplay.CurrentSetting.Frequency}");
|
||||||
|
Debug.WriteLine($"ADCSIE : {attachedDisplay.CurrentSetting.IsEnable}");
|
||||||
|
Debug.WriteLine($"ADCSII : {attachedDisplay.CurrentSetting.IsInterlaced}");
|
||||||
|
Debug.WriteLine($"ADCSO : {attachedDisplay.CurrentSetting.Orientation.ToString()}");
|
||||||
|
Debug.WriteLine($"ADCSOSM : {attachedDisplay.CurrentSetting.OutputScalingMode.ToString()}");
|
||||||
|
Debug.WriteLine($"ADCSP : {attachedDisplay.CurrentSetting.Position.ToString()}");
|
||||||
|
Debug.WriteLine($"ADCSR : {attachedDisplay.CurrentSetting.Resolution.ToString()}");
|
||||||
Debug.WriteLine($"DP : {displayAdapter.DevicePath}");
|
Debug.WriteLine($"DP : {displayAdapter.DevicePath}");
|
||||||
Debug.WriteLine($"DK : {displayAdapter.DeviceKey}");
|
Debug.WriteLine($"DK : {displayAdapter.DeviceKey}");
|
||||||
Debug.WriteLine($"DN : {displayAdapter.DeviceName}");
|
Debug.WriteLine($"DN : {displayAdapter.DeviceName}");
|
||||||
@ -786,59 +781,101 @@ namespace HeliosPlus.Shared
|
|||||||
Debug.WriteLine($"AI : {pathDisplayAdapter.AdapterId}");
|
Debug.WriteLine($"AI : {pathDisplayAdapter.AdapterId}");
|
||||||
Debug.WriteLine($"AIDP : {pathDisplayAdapter.DevicePath}");
|
Debug.WriteLine($"AIDP : {pathDisplayAdapter.DevicePath}");
|
||||||
Debug.WriteLine($"AIII : {pathDisplayAdapter.IsInvalid}");
|
Debug.WriteLine($"AIII : {pathDisplayAdapter.IsInvalid}");
|
||||||
|
Debug.WriteLine($"DDA : {displayAdapter.DeviceName}");
|
||||||
foreach (DisplayDevice displayDevice in displayDevices)
|
Debug.WriteLine($"PDSA : {pathDisplaySource.Adapter}");
|
||||||
{
|
Debug.WriteLine($"PDSCDS : {pathDisplaySource.CurrentDPIScale}");
|
||||||
|
Debug.WriteLine($"PDSDN : {pathDisplaySource.DisplayName}");
|
||||||
|
Debug.WriteLine($"PDSMDS : {pathDisplaySource.MaximumDPIScale}");
|
||||||
|
Debug.WriteLine($"PDSRDS : {pathDisplaySource.RecommendedDPIScale}");
|
||||||
|
Debug.WriteLine($"PDSSI : {pathDisplaySource.SourceId}");
|
||||||
|
Debug.WriteLine($"PDTA : {pathDisplayTarget.Adapter}");
|
||||||
|
Debug.WriteLine($"PDTCI : {pathDisplayTarget.ConnectorInstance}");
|
||||||
|
Debug.WriteLine($"PDTDP : {pathDisplayTarget.DevicePath}");
|
||||||
|
Debug.WriteLine($"PDTEMC : {pathDisplayTarget.EDIDManufactureCode}");
|
||||||
|
Debug.WriteLine($"PDTEMI : {pathDisplayTarget.EDIDManufactureId}");
|
||||||
|
Debug.WriteLine($"PDTEPC : {pathDisplayTarget.EDIDProductCode}");
|
||||||
|
Debug.WriteLine($"PDTFN : {pathDisplayTarget.FriendlyName}");
|
||||||
|
Debug.WriteLine($"PDTIA : {pathDisplayTarget.IsAvailable}");
|
||||||
|
Debug.WriteLine($"PDTPR : {pathDisplayTarget.PreferredResolution}");
|
||||||
|
Debug.WriteLine($"PDTPSM : {pathDisplayTarget.PreferredSignalMode}");
|
||||||
|
Debug.WriteLine($"PDTTI : {pathDisplayTarget.TargetId}");
|
||||||
|
Debug.WriteLine($"PDTVRS : {pathDisplayTarget.VirtualResolutionSupport}");
|
||||||
|
|
||||||
PathDisplaySource pathDisplaySource = displayDevice.ToPathDisplaySource();
|
// Create an array of all the important display info we need to record
|
||||||
PathDisplayTarget pathDisplayTarget = displayDevice.ToPathDisplayTarget();
|
string[] displayInfo = {
|
||||||
|
"WINAPI",
|
||||||
|
displayAdapter.DeviceName.ToString(),
|
||||||
|
pathDisplayAdapter.AdapterId.ToString(),
|
||||||
|
pathDisplayTarget.ConnectorInstance.ToString(),
|
||||||
|
pathDisplayTarget.FriendlyName,
|
||||||
|
pathDisplayTarget.EDIDManufactureCode.ToString(),
|
||||||
|
pathDisplayTarget.EDIDManufactureId.ToString(),
|
||||||
|
pathDisplayTarget.EDIDProductCode.ToString(),
|
||||||
|
pathDisplayTarget.TargetId.ToString(),
|
||||||
|
};
|
||||||
|
|
||||||
Debug.WriteLine($"DDA : {displayDevice.Adapter}");
|
// Create a display identifier out of it
|
||||||
Debug.WriteLine($"DDDK : {displayDevice.DeviceKey}");
|
string displayIdentifier = String.Join("|", displayInfo);
|
||||||
Debug.WriteLine($"DDDN : {displayDevice.DeviceName}");
|
// Add it to the list of display identifiers so we can return it
|
||||||
Debug.WriteLine($"DDDP : {displayDevice.DevicePath}");
|
displayIdentifiers.Add(displayIdentifier);
|
||||||
Debug.WriteLine($"DDDiFN : {displayDevice.DisplayFullName}");
|
|
||||||
Debug.WriteLine($"DDDiN : {displayDevice.DisplayName}");
|
|
||||||
Debug.WriteLine($"DDDiIA : {displayDevice.IsAvailable}");
|
|
||||||
Debug.WriteLine($"DDDiIV : {displayDevice.IsValid}");
|
|
||||||
Debug.WriteLine($"PDSA : {pathDisplaySource.Adapter}");
|
|
||||||
Debug.WriteLine($"PDSCDS : {pathDisplaySource.CurrentDPIScale}");
|
|
||||||
Debug.WriteLine($"PDSDN : {pathDisplaySource.DisplayName}");
|
|
||||||
Debug.WriteLine($"PDSMDS : {pathDisplaySource.MaximumDPIScale}");
|
|
||||||
Debug.WriteLine($"PDSRDS : {pathDisplaySource.RecommendedDPIScale}");
|
|
||||||
Debug.WriteLine($"PDSSI : {pathDisplaySource.SourceId}");
|
|
||||||
Debug.WriteLine($"PDTA : {pathDisplayTarget.Adapter}");
|
|
||||||
Debug.WriteLine($"PDTCI : {pathDisplayTarget.ConnectorInstance}");
|
|
||||||
Debug.WriteLine($"PDTDP : {pathDisplayTarget.DevicePath}");
|
|
||||||
Debug.WriteLine($"PDTEMC : {pathDisplayTarget.EDIDManufactureCode}");
|
|
||||||
Debug.WriteLine($"PDTEMI : {pathDisplayTarget.EDIDManufactureId}");
|
|
||||||
Debug.WriteLine($"PDTEPC : {pathDisplayTarget.EDIDProductCode}");
|
|
||||||
Debug.WriteLine($"PDTFN : {pathDisplayTarget.FriendlyName}");
|
|
||||||
Debug.WriteLine($"PDTIA : {pathDisplayTarget.IsAvailable}");
|
|
||||||
Debug.WriteLine($"PDTPR : {pathDisplayTarget.PreferredResolution}");
|
|
||||||
Debug.WriteLine($"PDTPSM : {pathDisplayTarget.PreferredSignalMode}");
|
|
||||||
Debug.WriteLine($"PDTTI : {pathDisplayTarget.TargetId}");
|
|
||||||
Debug.WriteLine($"PDTVRS : {pathDisplayTarget.VirtualResolutionSupport}");
|
|
||||||
|
|
||||||
// Create an array of all the important display info we need to record
|
}
|
||||||
string[] displayInfo = {
|
|
||||||
"WINAPI",
|
|
||||||
displayAdapter.DeviceName.ToString(),
|
|
||||||
pathDisplayAdapter.AdapterId.ToString(),
|
|
||||||
pathDisplaySource.SourceId.ToString(),
|
|
||||||
pathDisplayTarget.ConnectorInstance.ToString(),
|
|
||||||
pathDisplayTarget.FriendlyName,
|
|
||||||
pathDisplayTarget.EDIDManufactureCode.ToString(),
|
|
||||||
pathDisplayTarget.EDIDManufactureId.ToString(),
|
|
||||||
pathDisplayTarget.EDIDProductCode.ToString(),
|
|
||||||
pathDisplayTarget.TargetId.ToString(),
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create a display identifier out of it
|
foreach (UnAttachedDisplay unattachedDisplay in unattachedDisplayDevices)
|
||||||
string displayIdentifier = String.Join("|", displayInfo);
|
{
|
||||||
// Add it to the list of display identifiers so we can return it
|
DisplayAdapter displayAdapter = unattachedDisplay.Adapter;
|
||||||
displayIdentifiers.Add(displayIdentifier);
|
PathDisplayAdapter pathDisplayAdapter = displayAdapter.ToPathDisplayAdapter();
|
||||||
}
|
PathDisplaySource pathDisplaySource = unattachedDisplay.ToPathDisplaySource();
|
||||||
|
PathDisplayTarget pathDisplayTarget = unattachedDisplay.ToPathDisplayTarget();
|
||||||
|
|
||||||
|
Debug.WriteLine($"ADDN : {unattachedDisplay.DeviceName}");
|
||||||
|
Debug.WriteLine($"ADDFN : {unattachedDisplay.DisplayFullName}");
|
||||||
|
Debug.WriteLine($"ADDIN : {unattachedDisplay.DisplayName}");
|
||||||
|
Debug.WriteLine($"ADDIN : {unattachedDisplay.IsAvailable}");
|
||||||
|
Debug.WriteLine($"ADDIV : {unattachedDisplay.IsValid}");
|
||||||
|
Debug.WriteLine($"DP : {displayAdapter.DevicePath}");
|
||||||
|
Debug.WriteLine($"DK : {displayAdapter.DeviceKey}");
|
||||||
|
Debug.WriteLine($"DN : {displayAdapter.DeviceName}");
|
||||||
|
Debug.WriteLine($"DK : {displayAdapter.DeviceKey}");
|
||||||
|
Debug.WriteLine($"AI : {pathDisplayAdapter.AdapterId}");
|
||||||
|
Debug.WriteLine($"AIDP : {pathDisplayAdapter.DevicePath}");
|
||||||
|
Debug.WriteLine($"AIII : {pathDisplayAdapter.IsInvalid}");
|
||||||
|
Debug.WriteLine($"PDSA : {pathDisplaySource.Adapter}");
|
||||||
|
Debug.WriteLine($"PDSCDS : {pathDisplaySource.CurrentDPIScale}");
|
||||||
|
Debug.WriteLine($"PDSDN : {pathDisplaySource.DisplayName}");
|
||||||
|
Debug.WriteLine($"PDSMDS : {pathDisplaySource.MaximumDPIScale}");
|
||||||
|
Debug.WriteLine($"PDSRDS : {pathDisplaySource.RecommendedDPIScale}");
|
||||||
|
Debug.WriteLine($"PDSSI : {pathDisplaySource.SourceId}");
|
||||||
|
Debug.WriteLine($"PDTA : {pathDisplayTarget.Adapter}");
|
||||||
|
Debug.WriteLine($"PDTCI : {pathDisplayTarget.ConnectorInstance}");
|
||||||
|
Debug.WriteLine($"PDTDP : {pathDisplayTarget.DevicePath}");
|
||||||
|
Debug.WriteLine($"PDTEMC : {pathDisplayTarget.EDIDManufactureCode}");
|
||||||
|
Debug.WriteLine($"PDTEMI : {pathDisplayTarget.EDIDManufactureId}");
|
||||||
|
Debug.WriteLine($"PDTEPC : {pathDisplayTarget.EDIDProductCode}");
|
||||||
|
Debug.WriteLine($"PDTFN : {pathDisplayTarget.FriendlyName}");
|
||||||
|
Debug.WriteLine($"PDTIA : {pathDisplayTarget.IsAvailable}");
|
||||||
|
Debug.WriteLine($"PDTPR : {pathDisplayTarget.PreferredResolution}");
|
||||||
|
Debug.WriteLine($"PDTPSM : {pathDisplayTarget.PreferredSignalMode}");
|
||||||
|
Debug.WriteLine($"PDTTI : {pathDisplayTarget.TargetId}");
|
||||||
|
Debug.WriteLine($"PDTVRS : {pathDisplayTarget.VirtualResolutionSupport}");
|
||||||
|
|
||||||
|
// Create an array of all the important display info we need to record
|
||||||
|
string[] displayInfo = {
|
||||||
|
"WINAPI",
|
||||||
|
displayAdapter.DeviceName.ToString(),
|
||||||
|
pathDisplayAdapter.AdapterId.ToString(),
|
||||||
|
pathDisplayTarget.ConnectorInstance.ToString(),
|
||||||
|
pathDisplayTarget.FriendlyName,
|
||||||
|
pathDisplayTarget.EDIDManufactureCode.ToString(),
|
||||||
|
pathDisplayTarget.EDIDManufactureId.ToString(),
|
||||||
|
pathDisplayTarget.EDIDProductCode.ToString(),
|
||||||
|
pathDisplayTarget.TargetId.ToString(),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create a display identifier out of it
|
||||||
|
string displayIdentifier = String.Join("|", displayInfo);
|
||||||
|
// Add it to the list of display identifiers so we can return it
|
||||||
|
displayIdentifiers.Add(displayIdentifier);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ namespace HeliosPlus.UIForms
|
|||||||
this.lbl_profile_shown_subtitle.BackColor = System.Drawing.Color.DimGray;
|
this.lbl_profile_shown_subtitle.BackColor = System.Drawing.Color.DimGray;
|
||||||
this.lbl_profile_shown_subtitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lbl_profile_shown_subtitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lbl_profile_shown_subtitle.ForeColor = System.Drawing.Color.White;
|
this.lbl_profile_shown_subtitle.ForeColor = System.Drawing.Color.White;
|
||||||
this.lbl_profile_shown_subtitle.Location = new System.Drawing.Point(18, 102);
|
this.lbl_profile_shown_subtitle.Location = new System.Drawing.Point(20, 102);
|
||||||
this.lbl_profile_shown_subtitle.Name = "lbl_profile_shown_subtitle";
|
this.lbl_profile_shown_subtitle.Name = "lbl_profile_shown_subtitle";
|
||||||
this.lbl_profile_shown_subtitle.Size = new System.Drawing.Size(132, 20);
|
this.lbl_profile_shown_subtitle.Size = new System.Drawing.Size(132, 20);
|
||||||
this.lbl_profile_shown_subtitle.TabIndex = 22;
|
this.lbl_profile_shown_subtitle.TabIndex = 22;
|
||||||
|
@ -184,7 +184,7 @@ namespace HeliosPlus.UIForms
|
|||||||
btn_save_or_rename.Text = "Rename To";
|
btn_save_or_rename.Text = "Rename To";
|
||||||
if (!_selectedProfile.IsPossible)
|
if (!_selectedProfile.IsPossible)
|
||||||
{
|
{
|
||||||
lbl_profile_shown_subtitle.Text = "(Display Profile is not valid so cannot be used)";
|
lbl_profile_shown_subtitle.Text = "This Display Profile can't be used as not all Displays are connected.";
|
||||||
btn_apply.Visible = false;
|
btn_apply.Visible = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -201,7 +201,7 @@ namespace HeliosPlus.UIForms
|
|||||||
// we don't have the profile stored yet
|
// we don't have the profile stored yet
|
||||||
_saveOrRenameMode = "save";
|
_saveOrRenameMode = "save";
|
||||||
btn_save_or_rename.Text = "Save As";
|
btn_save_or_rename.Text = "Save As";
|
||||||
lbl_profile_shown_subtitle.Text = "(Current Display Profile in use - UNSAVED)";
|
lbl_profile_shown_subtitle.Text = "The current Display configuration hasn't been saved as a Display Profile yet";
|
||||||
btn_apply.Visible = false;
|
btn_apply.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user