SuppressMessageAttribute.Scope 屬性

定義

取得或設定與屬性相關的程式碼範圍。

public:
 property System::String ^ Scope { System::String ^ get(); void set(System::String ^ value); };
public string Scope { get; set; }
public string? Scope { get; set; }
member this.Scope : string with get, set
Public Property Scope As String

屬性值

與屬性相關的程式碼範圍。

備註

屬性 Scope 是選擇性自變數,指定屬性相關之元數據範圍。 下表顯示可能的值。

Description
"member" 隱藏成員的警告。
"module" 隱藏元件警告。 這是套用至整個專案的全域隱藏。
"namespace" 此範圍會隱藏命名空間本身的警告。 它不會針對命名空間內的型別隱藏警告。
"namespaceanddescendants" 隱藏命名空間及其所有子代符號中的警告。 舊版程式代碼分析會忽略此值。
"type" 針對類型隱藏警告。

針對 舊版程序代碼分析"resource" 也是有效的值。 如需範圍的詳細資訊,請參閱 隱藏程式代碼分析警告

適用於