title: How to suppress code analysis messages for all type members?
body: <p>Let's say I have an enumeration of all currencies:</p>
  
  <pre><code>public enum CurrencyType
  {
      /// &lt;summary&gt;
      /// United Arab Emirates dirham
      /// &lt;/summary&gt;
      [EnumMember]
      AED = 784,
  
      /// &lt;summary&gt;
      /// Afghan afghani
      /// &lt;/summary&gt;
      [EnumMember]
      AFN = 971,
  
      /// &lt;summary&gt;
      /// Albanian lek
      /// &lt;/summary&gt;
      [EnumMember]
      ALL = 008,
  
      ...
  }
  </code></pre>
  
  <p>VS 2015 code analysis keeps complaining about 100 violations of <a href="https://msdn.microsoft.com/library/ms182240.aspx" rel="noreferrer">CA1709</a> for every individual member.</p>
  
  <p>This is an useful rule by itself, and I do not want to disable it; yet it is of not much help in this specific case, as <code>CurrencyType</code> is public and is used in a whole lot of other projects.</p>
  
  <p>I can suppress the message; however, VS only offers me to suppress it for every individual member - meaning that I'll have 100 <code>[SuppressMessage(...)]</code> lines, which will clutter the code.</p>
  
  <p>Is there any way to suppress all CA1709 for all <code>CurrencyType</code> members, while not suppressing it for all other code in this project, without having to write 100 <code>[SuppressMessage(...)]</code>?</p>
  
  <p>There is a <code>Scope</code> parameter of <code>SuppressMessageAttribute</code>, but the documentation is unclear on that one. I've tried placing both</p>
  
  <pre><code>[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Scope = "type", Justification = "Currency codes are defined in ISO standard.")]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Scope = "member", Justification = "Currency codes are defined in ISO standard.")]
  </code></pre>
  
  <p>on <code>CurrencyType</code> itself. Neither does work.</p>