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

后端 未结 8 2102
-上瘾入骨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:12

    Edit: This turns out to be part of DxCore, from DevExpress. Leaving here so others notice, but basically I was wrong wrong wrong. To make this particular menu go away you disable it in the 'add ins' dialog; unloading devexpress from their own menu just unloads CodeRush/Refactor, not the base support libraries.

    The is (not!) a built in way to do it. I don't know if you can bind a key to it or not. Also, this embed doesn't do anything if you only select one line, so it probably won't work right if your stuff is on one line after the "if".

    1. Select the block
    2. Right Click
    3. Choose "Embed Selection"
    4. Choose "Block {}"

    Note: I have DexExpress installed, but this menu is there even when it isn't loaded, and I could swear it is there even when it isn't installed. However, if I am mistaken...

    This honestly seems like something that would be best to ask r# for, a user contrib perhaps?

提交回复
热议问题