Gamma Init

This commit is contained in:
Serge
2024-02-16 15:55:37 +01:00
parent 42a598f177
commit cf84fa0616
103 changed files with 7907 additions and 41 deletions

View File

@@ -0,0 +1,18 @@
using System;
namespace WindowsDisplayAPI.Exceptions
{
/// <summary>
/// Represents errors that occurs because of two similar but not identical path or path target
/// </summary>
public class DuplicateModeException : Exception
{
/// <summary>
/// Creates a new DuplicateModeException exception
/// </summary>
/// <param name="message">The human readable message of the exception</param>
public DuplicateModeException(string message) : base(message)
{
}
}
}

View File

@@ -0,0 +1,32 @@
using System;
namespace WindowsDisplayAPI.Exceptions
{
/// <summary>
/// Represents errors that occurs because of an invalid display instance
/// </summary>
public class InvalidDisplayException : Exception
{
/// <summary>
/// Creates a new InvalidDisplayException
/// </summary>
/// <param name="displayPath">The path of invalidated display device</param>
public InvalidDisplayException(string displayPath)
{
DisplayPath = displayPath;
}
/// <summary>
/// Creates a new InvalidDisplayException
/// </summary>
public InvalidDisplayException() : this(null)
{
}
/// <summary>
/// Gets the path of the display device
/// </summary>
public string DisplayPath { get; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
namespace WindowsDisplayAPI.Exceptions
{
/// <summary>
/// Represents errors that occurs because of missing or invalid EDID information
/// </summary>
public class InvalidEDIDInformation : Exception
{
/// <summary>
/// Creates a new InvalidEDIDInformation exception
/// </summary>
/// <param name="message">The human readable message of the exception</param>
public InvalidEDIDInformation(string message) : base(message)
{
}
}
}

View File

@@ -0,0 +1,18 @@
using System;
namespace WindowsDisplayAPI.Exceptions
{
/// <summary>
/// Represents errors that occurs because of missing or invalid registry address information
/// </summary>
public class InvalidRegistryAddressException : Exception
{
/// <summary>
/// Creates a new InvalidRegistryAddressException exception
/// </summary>
/// <param name="message">The human readable message of the exception</param>
public InvalidRegistryAddressException(string message) : base(message)
{
}
}
}

View File

@@ -0,0 +1,25 @@
using System;
namespace WindowsDisplayAPI.Exceptions
{
/// <summary>
/// Represents errors that occurs because of a missing display
/// </summary>
public class MissingDisplayException : Exception
{
/// <summary>
/// Creates a new MissingDisplayException
/// </summary>
/// <param name="displayPath">The path of missing display device</param>
/// <param name="message">The human readable message of the exception</param>
public MissingDisplayException(string message, string displayPath) : base(message)
{
DisplayPath = displayPath;
}
/// <summary>
/// Gets the path of the display device
/// </summary>
public string DisplayPath { get; }
}
}

View File

@@ -0,0 +1,26 @@
using System;
using WindowsDisplayAPI.Native.DisplayConfig;
namespace WindowsDisplayAPI.Exceptions
{
/// <summary>
/// Represents errors that occurs because of missing mode information
/// </summary>
public class MissingModeException : Exception
{
/// <summary>
/// Creates a new MissingModeException
/// </summary>
/// <param name="missingModeType">The missing mode type</param>
/// <param name="message">The human readable message of the exception</param>
public MissingModeException(string message, DisplayConfigModeInfoType missingModeType) : base(message)
{
MissingModeType = missingModeType;
}
/// <summary>
/// Gets the missing mode type
/// </summary>
public DisplayConfigModeInfoType MissingModeType { get; }
}
}

View File

@@ -0,0 +1,37 @@
using System;
using WindowsDisplayAPI.Native.DeviceContext;
namespace WindowsDisplayAPI.Exceptions
{
/// <summary>
/// Represents errors that occurs during a mode change request
/// </summary>
public class ModeChangeException : Exception
{
/// <summary>
/// Creates a new ModeChangeException
/// </summary>
/// <param name="device">The device responsible for the mode change</param>
/// <param name="errorCode">The error code</param>
/// <param name="message">The human readable message of the exception</param>
public ModeChangeException(
string message,
DisplayDevice device,
ChangeDisplaySettingsExResults errorCode
) : base(message)
{
Device = device;
ErrorCode = errorCode;
}
/// <summary>
/// Gets the display device responsible for the mode change
/// </summary>
public DisplayDevice Device { get; }
/// <summary>
/// Gets the error code
/// </summary>
public ChangeDisplaySettingsExResults ErrorCode { get; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
namespace WindowsDisplayAPI.Exceptions
{
/// <summary>
/// Represents errors that occurs because of not being in a valid clone group
/// </summary>
public class NotACloneMemberException : Exception
{
/// <summary>
/// Creates a new NotACloneMemberException
/// </summary>
/// <param name="message">The human readable message of the exception</param>
public NotACloneMemberException(string message) : base(message)
{
}
}
}

View File

@@ -0,0 +1,27 @@
using System;
namespace WindowsDisplayAPI.Exceptions
{
/// <summary>
/// Represents errors that occurs because of an invalid path request
/// </summary>
public class PathChangeException : Exception
{
/// <summary>
/// Creates a new PathChangeException
/// </summary>
/// <param name="message">The human readable message of the exception</param>
public PathChangeException(string message) : base(message)
{
}
/// <summary>
/// Creates a new PathChangeException
/// </summary>
/// <param name="message">The human readable message of the exception</param>
/// <param name="innerException">The inner causing exception</param>
public PathChangeException(string message, Exception innerException) : base(message, innerException)
{
}
}
}

View File

@@ -0,0 +1,33 @@
using System;
using WindowsDisplayAPI.Native.Structures;
namespace WindowsDisplayAPI.Exceptions
{
/// <summary>
/// Represents errors that occurs because of path target being inavailable
/// </summary>
public class TargetNotAvailableException : Exception
{
/// <summary>
/// Creates a new TargetNotAvailableException
/// </summary>
/// <param name="message">The human readable message of the exception</param>
/// <param name="adapterId">The driving adapter's identification</param>
/// <param name="targetId">The target identification number</param>
public TargetNotAvailableException(string message, LUID adapterId, uint targetId) : base(message)
{
AdapterId = adapterId;
TargetId = targetId;
}
/// <summary>
/// Gets the driving adapter's identification
/// </summary>
public LUID AdapterId { get; }
/// <summary>
/// Gets the target's identification number
/// </summary>
public uint TargetId { get; }
}
}