title: Using Roslyn to parse/transform/generate code: am I aiming too high, or too low?
body: <p><em>(What I'm trying to do is work around the <a href="https://stackoverflow.com/q/783934">Application.Settings/MVVM</a> problem by generating an interface and wrapper class from the vs-generated settings file.)</em></p>
  
  <p>What I'd like to do is:</p>
  
  <ul>
  <li>Parse a class declaration from file</li>
  <li>Generate an interface declaration based on just the (non static) properties of the class</li>
  <li>Generate a wrapper class which implements this interface, takes an instance of the original class in the constructor, and 'pipes' all the properties through to the instance.</li>
  <li>Generate another class which implements the interface directly.</li>
  </ul>
  
  <p>My question is two-fold: </p>
  
  <ul>
  <li>Am I barking up the wrong tree? Would I be better off using Code-Dom, T4, Regex(!) for this, or part of this? (I don't mind a bit of extra work, as this is mostly a learning experience.)</li>
  <li>If Roslyn is the way to go, which bit of it should I be looking at? I was kind of naively hoping that there would be some way of walking the tree and spitting out just the bits that I want, but I'm having trouble getting my head round whether/how to use the SyntaxRewriter to do it, or whether to use a fluent-style construction, querying the source multiple times for the bits I need.</li>
  </ul>
  
  <p><em>If you want to comment on the MVVM aspect you can, but that's not the main thrust of the question :)</em></p>