Discover the "surround with" feature, a special form of code snippet, one that knows how to wrap an existing chunk of code without destroying it in the process. See how the majority of the C# native snippets can work as surround-with snippets.
- In this video I'll look at the Surround With feature.…It is really a special form of code snippets,…one that knows how to wrap an existing chunk of code…without destroying it in the process.…I'll start by showing you the region surround with.…You may have seen it in another video in this course.…I move to line 8 and type in #region,…and then a label.…Then at the bottom of the section that I want to collapse…I type in #endregion.…Now I've got an outline section.…On line 8 I can click on the minus sign to collapse that…and see the content of my label.…
I can also hover over this to see the content…and then when I'm ready I can come back over here,…click on the plus sign, and expand that section.…Now that wasn't very hard to enter this.…I just had to do a little bit of typing on line 8,…and a little bit of typing on line 16.…But there is another way using a snippet.…Now remember that not all the snippets can do this.…I'll select the text and then I'll right click…and choose Surround With.…What has happened is Visual Studio has went out…
- Exploring the code editor window and default settings
- Commenting code
- Using hover tips and IntelliSense
- Tracking changes
- Refactoring code
- Formatting and arranging code
- Navigating and inspecting code
- Using the Task List
- Working with snippets and smart tags
Skill Level Beginner
ASP.NET MVC 5 Essential Trainingwith Michael Sullivan3h 40m Intermediate
1. Work with Code Editors
2. Format Your Code
3. Navigate and Inspect Code
4. Tools for Enhancing Your Coding Sessions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.