title: Automatically rename class to match file name
body: <p>I have a class <code>A</code> in file <code>B.cs</code>. Now I want to rename this class to match the file name (<code>B</code>).  </p>
  
  <p>Is there a refactoring or context action in VS or ReSharper which <strong>automatically</strong> can do this renaming for me <strong>without typing in the new name</strong> matching file name?  </p>
  
  <h2>Example</h2>
  
  <p><strong>Before renaming:</strong> </p>
  
  <p>File B.cs:</p>
  
  <pre><code>class A {}
  </code></pre>
  
  <p><strong>After automatically renaming:</strong>  </p>
  
  <p>File B.cs:</p>
  
  <pre><code>class B{}
  </code></pre>
  
  <h2>Update</h2>
  
  <p>The <strong>opposite</strong> (automatically rename file to match class name) <strong>is not an option</strong> because all these file renamings are implemented as DELETE+ADD. But then I <strong>would lose change history</strong> of that file in Perforce because all VS-Plug-ins for VS-Perforce-connection do not support <em>move/add+move/delete</em> actions for renaming.</p>