Add InvalidExecutionContextException.MemberName

このコミットが含まれているのは:
Sergio Pedri committed 2023-03-09 22:07:47 +01:00
1 親 4aa05ed0a0
コミット 99b2020dba
1ファイル変更
+10 -4
+10 -4
ファイルの表示
@@ -3,16 +3,22 @@ using System;
namespace ComputeSharp.Exceptions;
/// <summary>
/// A custom <see cref="InvalidOperationException"/> that indicates when an HLSL-only API is called from C#
/// A custom <see cref="InvalidOperationException"/> that indicates when an HLSL-only API is called from C#.
/// </summary>
public sealed class InvalidExecutionContextException : InvalidOperationException
{
/// <summary>
/// Creates a new <see cref="InvalidExecutionContextException"/> instance.
/// </summary>
/// <param name="name">The name of the caller API.</param>
internal InvalidExecutionContextException(string name)
: base($"The API {name} can only be used from within an HLSL shader.")
/// <param name="memberName">The member name of the caller API.</param>
internal InvalidExecutionContextException(string memberName)
: base($"The API {memberName} can only be used from within an HLSL shader.")
{
MemberName = memberName;
}
/// <summary>
/// The name of the member that was incorrectly invoked.
/// </summary>
public string MemberName { get; }
}