ProjectProblemSuppressor 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表 SSDT 專案使用的問題抑制器。 ShouldSuppressProblem 方法可以傳遞至 ShouldSuppressProblem 來使用這個類別。
這會從根目錄中名稱符合 SuppressionFilename 的檔案 ("StaticCodeAnalysis.SuppressMessages.xml") 讀取隱藏項目資訊。
所有相對路徑都會相對於建構函式中定義的專案資料夾進行解析
public sealed class ProjectProblemSuppressor
type ProjectProblemSuppressor = class
Public NotInheritable Class ProjectProblemSuppressor
- 繼承
-
ProjectProblemSuppressor
欄位
SuppressionFilename |
專案內的訊息隱藏項目檔的預設檔案名稱。 |
屬性
ShouldSuppressProblem |
取得可用來使用的述詞 如果在期間發生任何錯誤 |
方法
AddSuppressedProblems(IEnumerable<SuppressedProblemInfo>) |
將 SuppressedProblemInfo 的一或多個執行個體加入至隱藏的問題集。 完整的隱藏問題集將立即寫出至支援的 XML 檔案。 |
CreateSuppressor(String, String) |
建立新的 ProjectProblemSuppressor。 |
CreateSuppressor(String) |
建立新的 ProjectProblemSuppressor。 |
GetSuppressedProblems() |
取得將隱藏的問題的詳細資訊。 具體而言,將傳回一組 SuppressedProblemInfo 物件,其定義要隱藏的規則的每個組合和隱藏規則的檔案名稱。 |
ResetSuppressedProblems() |
將隱藏的問題重設為預設狀態。 如果專案的 XML 隱藏檔案已存在,則會從該處重新載入狀態,否則會重設而不隱藏任何問題。 |
UnsuppressRulesFromFile(String) |
移除特定檔案名稱的所有問題隱藏項目指示詞。 要隱藏的更新問題集,將立即寫出至 備份 XML 檔案,其中描述對指定的檔案應該隱藏哪些規則。 |