We will be undergoing scheduled maintenance on May 20th, 2013 at 02:00 GMT.
The Visual Studio environment gives you a functionality that you need to be aware of. This is not really a C# functionality, it comes to us through the Visual Studio Integrated Development Environment. But it's a very neat tool that you can use especially when you're trying to troubleshoot code or when you're trying to work with certain parts of code and that is and you'll notice these little boxes out here on the left side of the code. We can expand and collapse this code and this stuff is done for us automatically. For example, you'll notice that this entire Namespace, if I click this little button, it collapses all that code up and these little three buttons out here, if I mouse over it, it'll show me what it looks like. How cool is that? And then I can expand it back and so this particular class, I can click that and shrink that entire class. But I can come out here and look and see what's in the class, and then for example, this particular, let's do this one. This Button Click Handler which is really the same as a method in most cases. I can compress just that or collapse just that, and then I can mouse over the Ellipses out here, the 3 periods and I can see the code that's inside there. Now this is huge because as I create my own later, you know, Private Void Add this. So I create my own method out here and you'll notice that it's automatically given this thing okay? And then I'll just put some Comments, add code later right here. Then I can collapse this, come over this and I can see that all I've got is Add code later. So you can see that I could collapse all of my methods, so that I just see the names here, and then just by mousing over, I can see what code I'm looking for. Something else you can do when you're troubleshooting and you're trying to look for problems in your code, you're trying to debug. Once I know that this is working properly I can simply collapse it and then I can come back and check this later and say, okay, now this was working right, I can collapse it. Then of course, anytime I want to, I can get it back. Now notice I can right-click here and I can work with some of this stuff on Outlining. You notice, I can toggle Outlining, toggle All Outlining, and this will get it all back open for me. So lots you can do with this and again this is not really a C Sharp feature, it's a feature of the Visual Studio Integrated Development Environment. But it can really be handy when your code gets a little more complex than what I've got right here.
| Course: | Microsoft C# 2010 |
| Author: | Mark Long |
| SKU: | 34306 |
| ISBN: | 978-1-61866-037-4 |
| Release Date: | 2012-03-19 |
| Duration: | 8.5 hrs / 105 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |