Contents tagged with Visual Studio
-
My Personal Fonts and Colors Settings for Visual Studio 2005
After reproducing my old VS.Net 2003 settings (using a proportional font) on Visual Studio 2005 and playing around with features like bold fonts, I’ve finally settled on fonts and colors settings. Here’s a preview what source code looks like:
Download: FontsAndColors.vssettings.
When you import the settings using the “Import and Export Settings Wizard” (in the Tools menu), please do yourself a favor: Keep the default “Yes, save my current settings” and create a backup of your settings, so you can go back to your old fonts and colors if you want.
-
Code Snippet for Test Method
Name: Test Description: Test method for NUnit Shortcut: test Result: [Test]
public void TestName()
{
}Download: Test.snippet -
GhostDoc 1.9.1 (for Visual Studio 2005) Released
Version 1.9.1 is a bugfix release of GhostDoc for Visual Studio 2005 (download on the GhostDoc homepage).
The VB.Net support will remain experimental in this release, so it is turned off by default and you have to turn it on in the configuration dialog. A couple of issues (caused by small differences between the C# and the VB.Net CodeDOM) have been fixed, and things are looking good in general so I’m confident I can drop the experimental status pretty soon.
Important: When updating from 1.9.0, please uninstall 1.9.0, start Visual Studio once, exit and then install 1.9.1. If you have customized your configuration, please export it before uninstalling 1.9.0, then import it after installation of 1.9.1. All steps are explained in detail in the ReadMe.txt file in the ZIP archive.
ChangeLog:
- Fixed: Use of generics causing documentation not being generated.
- Fixed: Installation not possible if "My Documents" folder is on network drive/share.
- Fixed: VB.Net support: Inherited documentation causing either error messages or mixed up comments.
- Fixed: VB.Net support: Property accessors being treated as methods.
- Fixed: VB.Net support: Minor differences between C# and VB.Net CodeDOM causing trouble.
- Fixed: Some add-in issues (uninstallation, add-in manager)
- Changed: The add-in is no longer installed to a sub-folder of the AddIns directory. Instead, any location can be chosen now on the harddrive.
- Changed: In the generated comments, references to types ("<see cref="..." />) are now using the "T:" prefix that you may know from the inherited comments. This is to avoid the (new) warnings that Visual Studio 2005 is generating.
Thanks to Markus Hogsved for his detailed feedback on VB.Net support.
-
Code Snippet for Events
Name: Event Description: Code snippet for an event and the corresponding On... method Shortcut: event Result: public event EventHandler<EventArgs> EventRaised;
protected virtual void OnEventRaised( EventArgs e )
{
EventHandler<EventArgs> handler = this.EventRaised;
if (handler!= null) handler( this, e );
}Download: Event.snippet (Update 2005–11–23: Changed to make the “On...” method thread safe. Thanks Eric!
D’oh… I even wrote about this in January, but as thread safety wasn’t an issue in any of my code, I went back to the “old pattern” at some point, as it meant less typing. But a code snippet should of course use the correct pattern, right?) -
Second Place for GhostDoc in the Larkware Contest 2005!
[For my German readers: no, it’s not a mistake in the title – the first prize for GhostDoc means that I made the second place, as the first place gets the grand prize. I even googled it up, there doesn’t seem to be anything unusual about this usage of words]
[Everybody else: sorry, this is really not a joke, it’s confusing for us Germans and I had to explain it a couple of times today, including my parents on the phone]Okay, enough explanation, let’s get to the point: GhostDoc 1.9.0 (i.e. the Visual Studio 2005 version) made first prize (second place) in the Larkware contest 2005 and this means: I won stuff. Cool stuff. Oskar even emailed me and told me: “you won cool stuff!”. And lots of it. One little problem: somebody forgot to include the XXL package of extra time to try it all out ;-)
In related news, version 1.9.1 is in the works and should be out really soon. The new version will fix installation issues people had when their “My Documents” folder was moved to a network drive or share, and the problem that comments with a <see cref=”…” /> wouldn’t be generated in generic classes.
-
Code Snippet for Properties with Prefix Notation
As I wrote in previous blog posts, I still use prefix notation for private members, one reason being IntelliSense. If you’re like me, you may find these code snippets handy:
Name: Boolean Property Description: Code snippets for a boolean property. Shortcut: bp Result: private bool m_bMyProperty;
public bool MyProperty
{
get { return m_bMyProperty;}
set { m_bMyProperty = value;}
}
Name: Integer Property Description: Code snippets for an integer property. Shortcut: ip Result: private int m_nMyProperty;
public int MyProperty
{
get { return m_nMyProperty;}
set { m_nMyProperty = value;}
}
Name: Enum Property Description: Code snippets for an enum property. Shortcut: ep Result: private TheType m_eTheName;
public TheType TheName
{
get { return m_eTheName; }
set { m_eTheName = value; }
}
Name: Object Property Description: Code snippets for an object property. Shortcut: op Result: private TheType m_objTheName;
public TheType TheName
{
get { return m_objTheName;}
set { m_objTheName = value;}
}Download: Properties.snippet -
Code Snippet for Debugger.Break()
Name: Debugger Break Description: Inserts a call of System.Diagnostics.Debugger.Break() Shortcut: brk Download: DebuggerBreak.snippet