Any way to surround code block with Curly Braces {} in VS2008?

后端 未结 8 2080
-上瘾入骨i
-上瘾入骨i 2020-12-13 12:42

I always find myself needing to enclose a block of code in curly braces { }, but unfortunately that isn\'t included in the C# surround code snippets, which

相关标签:
8条回答
  • 2020-12-13 13:18

    In ReSharper 4.5, curly braces are included as one of the built-in 'Surround Templates':

    1. Select the text that you want curly braces around.
    2. ReSharper -> Code -> Surround With... -> {}

      or

      ALT + R -> C -> S -> 7

      or

      Ctrl+E, U -> 7 (Visual Studio scheme)

      or

      Ctrl+Alt+J -> 7 (ReSharper 2.x/IDEA scheme)

    0 讨论(0)
  • 2020-12-13 13:19

    Make your own custom code snippet for doing that. You can use snippy to create your own http://blogs.msdn.com/gusperez/articles/93681.aspx or just use an XML editor to create one.

    Put the file in My Documents\Visual Studio XXXX\Code Snippets\C#\My Code Snippets

    0 讨论(0)
提交回复
热议问题