Click here to Skip to main content
Click here to Skip to main content

Visual Studio Project MRU List Editor II

, 6 Jun 2008
Rate this:
Please Sign up or sign in to vote.
Improving Josh Beach's Visual Studio Project List editor

Note: For Visual Studio 2008 support and other improvements, please see this update by nelveticus.

Screenshot - vsProjectListEditor.png

Overview

Josh Beach has written a nice little tool to manage the "Recent projects" list in Visual Studio. It allows to edit the "recent projects" list for the start page of Visual Studio. I added the following features:

  • Select the Visual Studio version you work with (see the drop down list above)
  • "Kill Zombies" - removes all entries that don't exist anymore on disk
  • "Kill Zombies & Projects" - remove all files that don't exist on disk, and everything that doesn't end in ".sln"
  • "Explore", browsing to the current selection in explorer
  • Changed the save handling to work together with version switching

I wanted to submit this as an update to Josh's article, but unfortunately he doesn't seem to be active on this site anymore.

The Code

Don't look at it, the stuff I added is horrible. Smile | :)

This is a straightforward C# WinForms application, with all the logic in the Forms class. The list of projects is read from the registry, you can change the position in the list and add and remove items, and write back to the registry (all Josh's code). The dropdown selects the registry from which the information is read and can easily be configured.

TaggedString

The only class that might be of slight interest on an otherwise boring Sunday afternoon is TaggedString which provides the Text/Tag separation for ListBox and ComboBox items, too.

The good citizen rule for feeding UI controls is to keep representation separate from the data. WinForms offers in most places a Tag member where the caller can attach a reference to the actual data.

Unlike most WinForms controls, the ListBox and ComboBox don't offer a separate Tag for its items. Rather, it accepts a collection of objects, and displays the result of ToString() as item text. (This looks like sloppiness to me, but who knows?)

TaggedString associates a string (to be displayed) with a Tag (the object associated with the listbox / combobox item) like so:

   public class TaggedString<T>
   {
      string m_title;
      T m_tag;

      public TaggedString(string title, T tag)
      {
         m_title = title;
         m_tag = tag;
      }

      public override string ToString() { return m_title; }

      public T Tag { get { return m_tag; } }
   }

The Project List Editor stores the registry path in the tag, so it's using a TaggedString<string> like this:

  cbDevStudioVersion.Items.Add(
       new PH.Util.TaggedString<string>(
         "2005", // the string to display
         @"Software\Microsoft\VisualStudio\8.0\ProjectMRUList")); // the associated data

This is by far the shortest time I spent on an article - I hope you like it anyway.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

peterchen
Klippel
Germany Germany
Peter is tired of being called "Mr. Chen", even so certain individuals insist on it. No, he's not chinese.
 
Peter has seen lots of boxes you youngsters wouldn't even accept as calculators. He is proud of having visited the insides of a 16 Bit Machine.
 
In his spare time he ponders new ways of turning groceries into biohazards, or tries to coax South American officials to add some stamps to his passport.
 
Beyond these trivialities Peter works for Klippel[^], a small german company that wants to make mankind happier by selling them novel loudspeaker measurement equipment.
 

Where are you from?[^]



Please, if you are using one of my articles for anything, just leave me a comment. Seeing that this stuff is actually useful to someone is what keeps me posting and updating them.
Should you happen to not like it, tell me, too

Comments and Discussions

 
GeneralNew version PinmemberNelviticus8-May-08 0:31 
GeneralRe: New version Pinmemberpeterchen8-May-08 20:31 
GeneralRe: New version PinmemberNelviticus8-May-08 22:09 
GeneralVS 2008 support and ToolTips [modified] PinmemberNelviticus26-Feb-08 23:35 
GeneralRe: VS 2008 support and ToolTips PinmemberDennis Micheelsen7-May-08 22:59 
GeneralC# 2005 Express support Pinmemberpeterchen4-Jan-08 3:32 
GeneralGood one PinmemberMushq18-Aug-07 3:30 
Thanks Smile | :)
I think it would look very nice if there is a tool tip for each button.
 
Best Regards,
Mushq
 
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan

GeneralVS Add-in Pinmemberfilipk22-Apr-07 12:32 
GeneralRe: VS Add-in Pinmemberpeterchen22-Apr-07 22:55 
GeneralOnly show solutions PinprotectorMarc Clifton20-Apr-07 2:30 
GeneralRe: Only show solutions Pinmemberpeterchen20-Apr-07 5:07 
GeneralRe: Only show solutions PinprotectorMarc Clifton20-Apr-07 5:10 
GeneralRe: Only show solutions Pinmemberpeterchen20-Apr-07 11:45 
GeneralRe: Only show solutions Pinmemberaxelriet20-Apr-07 6:16 
GeneralRe: Only show solutions Pinmemberpeterchen21-Apr-07 3:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140718.1 | Last Updated 7 Jun 2008
Article Copyright 2007 by peterchen
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid