-
Notifications
You must be signed in to change notification settings - Fork 446
/
Copy pathUnconditionalSuppressMessageAttribute.cs
52 lines (46 loc) · 1.59 KB
/
UnconditionalSuppressMessageAttribute.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#if NETSTANDARD2_1
namespace System.Diagnostics.CodeAnalysis
{
/// <summary>
/// 表示一个用于取消对代码分析器规则的警告的特性
/// </summary>
[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
sealed class UnconditionalSuppressMessageAttribute : Attribute
{
/// <summary>
/// 获取或设置警告的类别
/// </summary>
public string Category { get; }
/// <summary>
/// 获取或设置要取消的检查标识符
/// </summary>
public string CheckId { get; }
/// <summary>
/// 获取或设置取消警告的理由
/// </summary>
public string? Justification { get; set; }
/// <summary>
/// 获取或设置消息的标识符
/// </summary>
public string? MessageId { get; set; }
/// <summary>
/// 获取或设置取消警告的范围
/// </summary>
public string? Scope { get; set; }
/// <summary>
/// 获取或设置取消警告的目标
/// </summary>
public string? Target { get; set; }
/// <summary>
/// 初始化 <see cref="UnconditionalSuppressMessageAttribute"/> 类的新实例
/// </summary>
/// <param name="category">警告的类别</param>
/// <param name="checkId">要取消的检查标识符</param>
public UnconditionalSuppressMessageAttribute(string category, string checkId)
{
this.Category = category;
this.CheckId = checkId;
}
}
}
#endif