title: Converting simple C++ code to C# automatically
body: <p>I have a file in C++ containing constant definitions, I want to use the same definitions in a C# project. Since both projects are part of a bigger project, I want if there is a change (addition/deletion) in the C++ file it should get reflected in corresponding C# file too. I want to keep the 2 files in sync. I was wondering if there is a script/tool to do this.</p>
  
  <p>A reverse solution (C#-->C++) would also work.</p>
  
  <p>Clarification:</p>
  
  <p>Currently the code is: </p>
  
  <pre><code>//C++ 
      struct Colors{ 
           static const int Red = 100; //Custom Values are important 
           static const int Green = 101; } 
  //C#
  
  public enum Color{ Red = 100; Green =101; }
  </code></pre>
  
  <p>Now I want to have a single file so that any changes in C++ are reflected in C# (or other way around) so that I can have a single file across the projects for these constants.</p>
  
  <p>As you see, I want to map bunch of constants defined in a struct in C++ to a enum in C#. I want to make no/minimal changes in above expected definitions as there is other code dependent (in both projects) on the above structures (but might do it, if there's not a good way of accomplishing this in the current format)</p>