Files
archived-g-helper/app/WindowsDisplayAPI/Exceptions/ModeChangeException.cs
2024-02-16 15:55:37 +01:00

37 lines
1.1 KiB
C#

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; }
}
}