/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ namespace System.Diagnostics.CodeAnalysis; [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class ExperimentalAttribute : Attribute { public ExperimentalAttribute(string diagnosticId) => DiagnosticId = diagnosticId; public string DiagnosticId { get; } public string? UrlFormat { get; set; } } [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] internal sealed class NotNullWhenAttribute : Attribute { public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; public bool ReturnValue { get; } } [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] internal sealed class SetsRequiredMembersAttribute : Attribute; [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class StringSyntaxAttribute : Attribute { public const string Uri = nameof(Uri); public const string Regex = nameof(Regex); public StringSyntaxAttribute(string syntax) { Syntax = syntax; Arguments = []; } public StringSyntaxAttribute(string syntax, params object?[] arguments) { Syntax = syntax; Arguments = arguments; } public string Syntax { get; } public object?[] Arguments { get; } } [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] internal sealed class UnconditionalSuppressMessageAttribute : Attribute { public UnconditionalSuppressMessageAttribute(string category, string checkId) { Category = category; CheckId = checkId; } public string Category { get; } public string CheckId { get; } public string? Scope { get; set; } public string? Target { get; set; } public string? MessageId { get; set; } public string? Justification { get; set; } }