March, 2011 Archives
Mar
56 useless buttons in your IDE
by Mikael Lundin in Programming
When did you last click a button in those toolbars in Visual Studio? Been a while, huh? Isn’t it time to give that space over to more code screen space?
You simply remove the toolbars by right click and deselect all checked. Don’t worry, you’re already using keyboard shortcuts for those things that you have up there. And if not .. here’s a short reminder.
Standard toolbar
| # | Name | Keyboard shortcut |
|---|---|---|
| 1 | New Project | Ctrl + Shift + N |
| 2 | Add New Item | Ctrl + Shift + A |
| 3 | Open File | Ctrl + O |
| 4 | Save File | Ctrl + S |
| 5 | Save All | Ctrl + Shift + S |
| 6 | Cut | Ctrl + X |
| 7 | Copy | Ctrl + C |
| 8 | Paste | Ctrl + V |
| 9 | Undo | Ctrl + Z |
| 10 | Redo | Ctrl + Y |
| 11 | Navigate Backward | Ctrl + - |
| 12 | Navigate Forward | Ctrl + Shift + - |
| 13 | Start Debugging | F5 |
| 14 | Solution Configurations | |
| 15 | Find in Files | Ctrl + Shift + F |
| 16 | Find | Ctrl + “ |
| 17 | Solution Explorer | Ctrl + W, S |
| 18 | Properties Window | Ctrl + W, P |
| 19 | Team Explorer | Ctrl + W, M |
| 20 | Object Browser | Ctrl + W, J |
| 21 | Toolbox | Ctrl + W, X |
| 22 | Start Page | |
| 23 | Extension Manager | |
| 24 | Command Window (other windows) | Ctrl + W, A |
Build toolbar
| # | Name | Keyboard shortcut |
|---|---|---|
| 25 | Build Project | Shift + F6 |
| 26 | Build Solution | F6 |
| 27 | Cancel | Ctrl + Break |
Debug toolbar
| # | Name | Keyboard shortcut |
|---|---|---|
| 28 | Start Debugging | F5 |
| 29 | Break All | Ctrl + Alt + Break |
| 30 | Stop Debugging | Shift + F5 |
| 31 | Restart | Ctrl + Shift + F5 |
| 32 | Show Next Statement | Alt + Num * |
| 33 | Step Into | F11 |
| 34 | Step Over | F10 |
| 35 | Step Out | Shift + F11 |
| 36 | Search for this line in IntelliTrace | |
| 37 | Hexadecimal Display | |
| 38 | Show Threads in Source | |
| 39 | Breakpoints | Ctrl + D, B |
Text toolbar
| # | Name | Keyboard shortcut |
|---|---|---|
| 40 | Display Object Member List | Ctrl + K, L |
| 41 | Display Parameter Info | Ctrl + K, P |
| 42 | Display Quick Info | Ctrl + K, I |
| 43 | Display Word Completion | Ctrl + K, W |
| 44 | Toggle Suggestion And Standard Completion Mode | |
| 45 | Decrease Indent | Shift + Tab |
| 46 | Increase Indent | Tab |
| 47 | Comment Out Selection | Ctrl + K, Ctrl + C |
| 48 | Uncomment Selection | Ctrl + K, Ctrl + U |
| 49 | Display Quick Info | Ctrl + K, I |
| 50 | Toggle Bookmark | Ctrl + B, T |
| 51 | Goto Previous Bookmark | Ctrl + B, P |
| 52 | Goto Next Bookmark | Ctrl + B, N |
| 53 | Goto Previous Bookmark in Folder | |
| 54 | Goto Next Bookmark in Folder | |
| 55 | Goto Previous Bookmark in document | |
| 56 | Goto Next Bookmark in document | |
| 57 | Clear All Bookmarks | Ctrl + B, C |
And remember, you can change any keyboard shortcut that you’re not comfortable with.
Mar
Mar
Book review: Being Geek by Michael Lopp
by Mikael Lundin in Other
Michael Lopp, famous for the blog Rands in Repose has written a book with the title Being Geek – The Software Developer Career Handbook. I’ve read it through and found it easy to read, humorous and full of first hand knowledge about the software industry.
Being Geek
Michael Lopp has written two excellent blog posts the nerd handbook and managing nerds that made me buy this book. Sadly, these two contributions to the book are the only one that is strictly about being a geek. The rest of the book is mostly about managing people, which is not very surprising as it seems Michael Lopp spent most of his career as a manager.
It’s ok. It’s just not what I expected from this book.
The Software Developer Career Handbook
I will give it to the author, that he fulfills the subtitle of this book. First hand experience of how to become a great asset in a software company. How you should read other people around you, and how you should handle management. Yes, I knew all of this before I read the book, because I’ve read similar books in the same subject but it was great to get a more personal twitch on it, than most other books will give you.
The good, the bad and the ugly
This is a fun and easy to read book. It is something for the hammock a warm summer day. It is not a book that you should base your daily decisions on, but some stories that you could bring along with you.
The ugly part of this book, is that you feel deceived by the title. I where expecting more anecdotes about geeks and being geek.
Mar
Custom ConfigurationSection from System.Configuration
by Mikael Lundin in Programming
Sometimes we forget about System.Configuration. This is plain when you find a project with its custom configuration xml parsing techniques. Maybe we all need to be reminded about System.Configuration.
Say you want configuration that looks like this.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="fileCopy" type="LiteMedia.ExampleConfiguration.Configuration.SectionHandler, LiteMedia.ExampleConfiguration"/>
</configSections>
<fileCopy>
<source>
<directory path="C:\Temp1" />
<directory path="C:\Temp2" />
</source>
<destination>
<directory path="D:\Temp1" />
<directory path="D:\Temp2" />
</destination>
</fileCopy>
</configuration>
Let’s start by the inner most element, directory. This is a class that inherits from System.Configuration.ConfigurationElement. Each property decorated with the ConfigurationPropertyAttribute is an attribute on the configuration element.
public class Directory : ConfigurationElement
{
private const string PathIdentifier = "path";
[ConfigurationProperty(PathIdentifier)]
public string Path
{
get { return (string)this[PathIdentifier]; }
set { this[PathIdentifier] = value; }
}
}
We need a configuration element that can hold a list of other configuration elements. This needs to inherit from System.Configuration.ConfigurationElementCollection. There are some more work involved telling the collection what inner element to expect.
[ConfigurationCollection(typeof(Directory),
CollectionType = ConfigurationElementCollectionType.BasicMap,
AddItemName = AddItemNameIdentifier)]
public class Directories : ConfigurationElementCollection
{
public const string AddItemNameIdentifier = "directory";
public override ConfigurationElementCollectionType CollectionType
{
get { return ConfigurationElementCollectionType.BasicMap; }
}
protected override string ElementName
{
get { return AddItemNameIdentifier; }
}
public void Add(Directory directory)
{
BaseAdd(directory);
}
protected override ConfigurationElement CreateNewElement()
{
return new Directory();
}
protected override object GetElementKey(ConfigurationElement element)
{
var instance = (Directory)element;
return instance.Path;
}
}
Finally we can create the holder element, the ConfigurationSection. We reference the section from the <configSection> in the App.config file and from here we reach the rest of the configuration. Our configuration section is very simple.
public class SectionHandler : ConfigurationSection
{
private const string SourceIdentifier = "source";
private const string DestinationIdentifier = "destination";
[ConfigurationProperty(SourceIdentifier)]
public Directories Source
{
get { return (Directories)this[SourceIdentifier]; }
set { this[SourceIdentifier] = value; }
}
[ConfigurationProperty(DestinationIdentifier)]
public Directories Destination
{
get { return (Directories)this[DestinationIdentifier]; }
set { this[SourceIdentifier] = value; }
}
}
Some test program to make sure that it works.
public static void Main(string[] args)
{
var configuration = (SectionHandler)ConfigurationManager.GetSection("fileCopy");
Console.WriteLine("SOURCE DIRECTORIES");
foreach (Directory directory in configuration.Source)
{
Console.WriteLine(directory.Path);
}
Console.WriteLine("DESTINATION DIRECTORIES");
foreach (Directory directory in configuration.Destination)
{
Console.WriteLine(directory.Path);
}
Console.ReadLine();
}
You can download the code sample as a zip archive from here.







