forked from linkdotnet/BlogExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StringSyntaxAttribute.cs
32 lines (26 loc) · 1.08 KB
/
StringSyntaxAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#if !NET7_0_OR_GREATER
// The namespace is important
namespace System.Diagnostics.CodeAnalysis;
/// <summary>Fake version of the StringSyntaxAttribute, which was introduced in .NET 7</summary>
public sealed class StringSyntaxAttribute : Attribute
{
/// <summary>The syntax identifier for strings containing composite formats.</summary>
public const string CompositeFormat = nameof(CompositeFormat);
/// <summary>The syntax identifier for strings containing regular expressions.</summary>
public const string Regex = nameof(Regex);
/// <summary>The syntax identifier for strings containing date information.</summary>
public const string DateTimeFormat = nameof(DateTimeFormat);
/// <summary>
/// Initializes a new instance of the <see cref="StringSyntaxAttribute"/> class.
/// </summary>
public StringSyntaxAttribute(string syntax)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="StringSyntaxAttribute"/> class.
/// </summary>
public StringSyntaxAttribute(string syntax, params object?[] arguments)
{
}
}
#endif