mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Gamma Init
This commit is contained in:
18
app/WindowsDisplayAPI/Exceptions/DuplicateModeException.cs
Normal file
18
app/WindowsDisplayAPI/Exceptions/DuplicateModeException.cs
Normal 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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
32
app/WindowsDisplayAPI/Exceptions/InvalidDisplayException.cs
Normal file
32
app/WindowsDisplayAPI/Exceptions/InvalidDisplayException.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
18
app/WindowsDisplayAPI/Exceptions/InvalidEDIDInformation.cs
Normal file
18
app/WindowsDisplayAPI/Exceptions/InvalidEDIDInformation.cs
Normal 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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
25
app/WindowsDisplayAPI/Exceptions/MissingDisplayException.cs
Normal file
25
app/WindowsDisplayAPI/Exceptions/MissingDisplayException.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
26
app/WindowsDisplayAPI/Exceptions/MissingModeException.cs
Normal file
26
app/WindowsDisplayAPI/Exceptions/MissingModeException.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
37
app/WindowsDisplayAPI/Exceptions/ModeChangeException.cs
Normal file
37
app/WindowsDisplayAPI/Exceptions/ModeChangeException.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
18
app/WindowsDisplayAPI/Exceptions/NotACloneMemberException.cs
Normal file
18
app/WindowsDisplayAPI/Exceptions/NotACloneMemberException.cs
Normal 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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/WindowsDisplayAPI/Exceptions/PathChangeException.cs
Normal file
27
app/WindowsDisplayAPI/Exceptions/PathChangeException.cs
Normal 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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user