diff --git a/src/ComputeSharp.D2D1/Properties/Polyfills/StringSyntaxAttribute.cs b/src/ComputeSharp.D2D1/Properties/Polyfills/StringSyntaxAttribute.cs new file mode 100644 index 00000000..02abeb35 --- /dev/null +++ b/src/ComputeSharp.D2D1/Properties/Polyfills/StringSyntaxAttribute.cs @@ -0,0 +1,42 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Diagnostics.CodeAnalysis; + +/// +/// Specifies the syntax used in a string. +/// +[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] +internal sealed class StringSyntaxAttribute : Attribute +{ + /// + /// Initializes the with the identifier of the syntax used. + /// + /// The syntax identifier. + public StringSyntaxAttribute(string syntax) + { + Syntax = syntax; + Arguments = Array.Empty(); + } + + /// + /// Initializes the with the identifier of the syntax used. + /// + /// The syntax identifier. + /// Optional arguments associated with the specific syntax employed. + public StringSyntaxAttribute(string syntax, params object?[] arguments) + { + Syntax = syntax; + Arguments = arguments; + } + + /// + /// Gets the identifier of the syntax used. + /// + public string Syntax { get; } + + /// + /// Optional arguments associated with the specific syntax employed. + /// + public object?[] Arguments { get; } +} \ No newline at end of file