How to wrap a set of already written functions in try-catch ?

Maybe there are some automation tools? I’ll have to do this manually for a long time.

    1 answer 1

    You can use the function Surround with

    1. Mark the code with the key combination: SHIFT + CTRL + A
    2. Press CTRL + K, CTRL+S
    3. Enter T
    4. And press Tab or Enter . And the code will be wrapped in a try/catc h block. Actually it turns out quickly, try it.

    Or look towards AOP and use libraries like PostSharp . Also saw an extension for the studio, but I do not remember the name.

    • And what should have happened in the first paragraph? I have this combination opens the window to add a new item. Of course, you can just select the code, but I wonder what was going to happen. Later, I noticed, the key combinations on different versions of the studio may differ. - v.slobodzian