You do not need Resharper for this. You can use the “surround with” with a custom snippet.
Then you can select your text with Ctrl + K, Ctrl + S and select the snippet {} in the custom snippet. In order to create such a snippet :
- Create a “.snippet” file containing the content below
- Go to the snippet manager (Tools > Code Snippets Manager)
- Click import and select the file you just created
Use the following snippet :
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>{}</Title>
<Shortcut>{}</Shortcut>
<Description>Code snippet for {}</Description>
<Author>Alexandre</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Code Language="csharp">
<![CDATA[{
$selected$ $end$
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>