Add AutoConstructorBehaviorAttribute type

このコミットが含まれているのは:
Sergio Pedri committed 2022-08-08 15:45:44 +02:00
1 親 ef4834be94
コミット 5a93bc23eb
2ファイル変更
+36

検索条件に一致するファイルはありません

+12
ファイルの表示
@@ -0,0 +1,12 @@
namespace ComputeSharp;
/// <summary>
/// Indicates the behavior of fields annotated with <see cref="AutoConstructorBehaviorAttribute"/>.
/// </summary>
internal enum AutoConstructorBehavior
{
/// <summary>
/// Causes <see cref="AutoConstructorAttribute"/> to ignore fields and set their values to <see langword="default"/>.
/// </summary>
IgnoreAndSetToDefault
}
+24
ファイルの表示
@@ -0,0 +1,24 @@
using System;
namespace ComputeSharp;
/// <summary>
/// An attribute that indicates that a target shader type should get an automatic constructor for all fields.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
internal sealed class AutoConstructorBehaviorAttribute : Attribute
{
/// <summary>
/// Creates a new <see cref="AutoConstructorBehaviorAttribute"/> instance with the specified parameters.
/// </summary>
/// <param name="behavior">The <see cref="AutoConstructorBehavior"/> value for the current instance.</param>
public AutoConstructorBehaviorAttribute(AutoConstructorBehavior behavior)
{
Behavior = behavior;
}
/// <summary>
/// Gets the <see cref="AutoConstructorBehavior"/> value for the current instance.
/// </summary>
public AutoConstructorBehavior Behavior { get; }
}