Merge pull request #495 from Sergio0694/dev/invalid-execution-context-exception-tweaks

Add InvalidExecutionContextException.MemberName
このコミットが含まれているのは:
Sergio Pedri authored and GitHub committed 2023-03-09 23:08:48 +01:00
コミット c9a5051e7f
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; }
}