Posts tagged Visual Studio
Remove and Sort Those Ugly “using-Statements”
Mar 3rd
Visual Studio 2008 has lots of goodies in it, like LINQ syntax, CSS editing, and testing tools. There’s a lesser-known feature which I really appreciate though – the “Remove and Sort Usings” command in the C# editor.
You activate the command by placing your cursor over the using statements and clicking on the right mouse-button.
Writing Custom Exception Classes the Quick Way
Feb 15th
Until recently I thought this was a well-known feature. After demonstrating it a few times, I found out it wasn’t.
A long time ago, in an cubicle far, far away, someone created the .Net Framework. To cut a long story short, they simultaneously produced guidelines for creating Exception classes, which you should always use or face having your fingernails pulled out with a staple-gun.
The guidelines state:
“Use the common constructors shown in the following code example when creating exception classes. “
[C#]
public class XxxException : ApplicationException
{
public XxxException() {… }
public XxxException(string message) {… }
public XxxException(string message, Exception inner) {… }
public XxxException(SerializationInfo info, StreamingContext context) {…}
}
.Net Source Code Now Available
Jan 17th
Scott Guthrie has just announced that the source code for the .Net framework has just been made available for reference use.
It will be particularly useful to see how the controls in ASP.Net and Windows Forms have been done.
Detailed instructions for how to set it up are here.
One caveat: it’s not available for the Express editions of Visual Studio. Shame! I was just starting to have some fun with them too.