// #pragma warning disable #nullable enable annotations // 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. /// [global::System.AttributeUsage( global::System.AttributeTargets.Parameter | global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public sealed class StringSyntaxAttribute : global::System.Attribute { /// /// Initializes the with the identifier of the syntax used. /// /// The syntax identifier. public StringSyntaxAttribute(string syntax) { Syntax = syntax; Arguments = new object?[0]; } /// 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; } /// The syntax identifier for strings containing composite formats for string formatting. public const string CompositeFormat = nameof(CompositeFormat); /// The syntax identifier for strings containing date format specifiers. public const string DateOnlyFormat = nameof(DateOnlyFormat); /// The syntax identifier for strings containing date and time format specifiers. public const string DateTimeFormat = nameof(DateTimeFormat); /// The syntax identifier for strings containing format specifiers. public const string EnumFormat = nameof(EnumFormat); /// The syntax identifier for strings containing format specifiers. public const string GuidFormat = nameof(GuidFormat); /// The syntax identifier for strings containing JavaScript Object Notation (JSON). public const string Json = nameof(Json); /// The syntax identifier for strings containing numeric format specifiers. public const string NumericFormat = nameof(NumericFormat); /// The syntax identifier for strings containing regular expressions. public const string Regex = nameof(Regex); /// The syntax identifier for strings containing time format specifiers. public const string TimeOnlyFormat = nameof(TimeOnlyFormat); /// The syntax identifier for strings containing format specifiers. public const string TimeSpanFormat = nameof(TimeSpanFormat); /// The syntax identifier for strings containing URIs. public const string Uri = nameof(Uri); /// The syntax identifier for strings containing XML. public const string Xml = nameof(Xml); } }