title: Refactoring repeated If statement blocks
body: <p>I have some code that I'm trying to rewrite. The code is designed to be "generic", in that it can be used by many different callers that require different "work flows". It goes something like this:</p>
  
  <pre><code>string globalA;
  int globalB;
  bool globalC;
  // Lots more globals in various shapes and forms
  
  void TheOneAndOnlyMethod(XmlBasedConfig config) {
  
      // Set all of the globals based on XML configuration
      // ...
  
      if (globalA.Length &gt; 0)
          // Do something relating to functionality 'a'
      }
  
      if (globalB &gt; 0) {
          // Do something relating to functionality 'b'
      }
  
      if (globalC) {
          // You get the idea
      }
  }
  </code></pre>
  
  <p>Some callers will have globalA and globalB set, therefore doing whatever is in the related if blocks. Other callers will have a myriad of other settings to do whatever they need to do. Callers are basically just an XML file with settings.</p>
  
  <p>Maintaining/modifying this code is a <strong>big</strong> pain. I know there must be a cleaner, simpler, less <em>brain-exploding</em> way to do this!   </p>