Domanda

I want to suppress CA1709: Identifiers should be cased correctly, on public class IDd. For example i want to use IDd as correct word. But i can't. I tried everything at code analysis dictionary:

<?xml version="1.0" encoding="utf-8"?>
<Dictionary>
  <Words>
    <Unrecognized>
      <Word></Word>
    </Unrecognized>
    <Recognized>
      <Word>d</Word>
      <Word>IDd</Word>
    </Recognized>
        <Deprecated>
            <Term PreferredAlternate=""></Term>
        </Deprecated>
        <Compound>
            <Term CompoundAlternate="IDd">IDd</Term>
        </Compound>
    <DiscreteExceptions>
      <Term>IDd</Term>
    </DiscreteExceptions>
  </Words>
  <Acronyms>
    <CasingExceptions>
      <Acronym>IDd</Acronym>
      <Acronym>ID</Acronym>
      <Acronym>d</Acronym>
    </CasingExceptions>
  </Acronyms>
</Dictionary>

But nothing helps me to add this work as correct with that case. What would you advise?

È stato utile?

Soluzione

The problem here is the "Dd", not the full "IDd", which is what the message of the CA1709 violation should be showing.

This can be addressed quite adding "dd" to the dictionary as a recognized word if you consider to be an actual word:

<?xml version="1.0" encoding="utf-8" ?>
<Dictionary>
    <Words>
        <Recognized>
            <Word>dd</Word>
        </Recognized>
    </Words>
</Dictionary>

or by adding it as an acronym casing exception if you do not consider it to be a word by still want to use pascal casing:

<?xml version="1.0" encoding="utf-8" ?>
<Dictionary>
    <Acronyms>
        <CasingExceptions>
            <Acronym>Dd</Acronym>
        </CasingExceptions>
    </Acronyms>
</Dictionary>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top