Click here to Skip to main content
6,292,426 members and growing! (11,301 online)
Email Password   helpLost your password?
Languages » C# » Utilities     Beginner License: The Code Project Open License (CPOL)

Visual Studio Project MRU List Editor II

By peterchen

Improving Josh Beach's Visual Studio Project List editor
C# 2.0, Windows, .NET 2.0VS.NET2003, VS2005, Dev
Posted:19 Apr 2007
Updated:6 Jun 2008
Views:17,149
Bookmarked:15 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
13 votes for this article.
Popularity: 4.61 Rating: 4.14 out of 5
2 votes, 15.4%
1
1 vote, 7.7%
2

3
3 votes, 23.1%
4
7 votes, 53.8%
5

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. :)

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


Member
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.

He recently started blogging about hisFirst Real C# Project[^] (a.k.a. "get it done"). Musing how this changes development for him or in general, tidbits he discovered, and else.

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
Occupation: Software Developer (Senior)
Company: Klippel
Location: Germany Germany

Other popular C# articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 15 of 15 (Total in Forum: 15) (Refresh)FirstPrevNext
GeneralNew version PinmemberNelviticus1:31 8 May '08  
GeneralRe: New version Pinsupporterpeterchen21:31 8 May '08  
GeneralRe: New version PinmemberNelviticus23:09 8 May '08  
GeneralVS 2008 support and ToolTips [modified] PinmemberNelviticus0:35 27 Feb '08  
GeneralRe: VS 2008 support and ToolTips PinmemberDennis Micheelsen23:59 7 May '08  
GeneralC# 2005 Express support Pinsupporterpeterchen4:32 4 Jan '08  
GeneralGood one PinmemberMushq4:30 18 Aug '07  
GeneralVS Add-in Pinmemberfilipk13:32 22 Apr '07  
GeneralRe: VS Add-in Pinsupporterpeterchen23:55 22 Apr '07  
GeneralOnly show solutions PinsupporterMarc Clifton3:30 20 Apr '07  
GeneralRe: Only show solutions Pinsupporterpeterchen6:07 20 Apr '07  
GeneralRe: Only show solutions PinsupporterMarc Clifton6:10 20 Apr '07  
GeneralRe: Only show solutions Pinsupporterpeterchen12:45 20 Apr '07  
GeneralRe: Only show solutions Pinmemberaxelriet7:16 20 Apr '07  
GeneralRe: Only show solutions Pinsupporterpeterchen4:15 21 Apr '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 6 Jun 2008
Editor: Deeksha Shenoy
Copyright 2007 by peterchen
Everything else Copyright © CodeProject, 1999-2009
Web11 | Advertise on the Code Project