次の方法で共有


SuppressMessageAttribute Constructor

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Initializes a new instance of the SuppressMessageAttribute class, specifying the category of the static analysis tool and the identifier for an analysis rule.

Namespace:  System.Diagnostics.CodeAnalysis
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Sub New ( _
    category As String, _
    checkId As String _
)
public SuppressMessageAttribute(
    string category,
    string checkId
)

Parameters

  • checkId
    Type: System.String
    The identifier of the analysis tool rule the attribute applies to.

Remarks

The category parameter value is specific to the analysis tool and categorizes the rule identified by the checkId parameter. When concatenated, the two parameters form a unique identifier for the rule.

NoteNote:

The preprocessor symbol "CODE_ANALYSIS" must be defined for this attribute to be effective. The absence of the preprocessor symbol results in the attribute not being applied.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.