Click here to Skip to main content
11,706,639 members (34,222 online)
Click here to Skip to main content

Regions Add-In for VS.NET 2003

, 11 Feb 2005 298.9K 4.6K 127
Rate this:
Please Sign up or sign in to vote.
Create an add-in for VS.NET 2003 to create regions.

Sample Image

Introduction

I find I spend a lot more time than I would like adding newly created functions to existing regions or new regions. So for myself and anyone else like me, I have developed this add-in.

Using the code

Two new commands are added to the context menu in the code window, when there is code selected.

Add To New Region will create a new Region, using the text supplied from a dialog, around the selected code.

Add To Existing Region will show a dialog allowing you to select which region the code should be added to. You can also use this function to create a sub-region by ticking the checkbox.

V2.0

I have added a couple of new features.

The Region Explorer

This is a tool window that can be docked or floating, just like the Solutions Explorer and other VS tool windows.

  • Shows the position of regions in the opened document.
  • Can be used to 'jump' to a region that is not visible in the current document view.
  • Can be used to paste text from the clipboard to a region.
  • Can be used to add text to a region via drag'n'drop.

The Region Explorer is not available and will be empty, if the current active editor window is a Design View or any tool window type (e.g. Start Page, XML, etc...).

Use the Region Explorer command on the View menu to show, and the close button of the control to hide.

Setup Dialog

Also in v2 is a setup dialog to allow some flexibility in the way the add-in is configured. This setup can be accessed from the Tools menu or from the button on the Region Explorer.

Points of Interest

This version should work for C# and VB in VS.NET 2003.

It has not been tested under VS.NET 2002, but it will at least need the registry entries changing from:

HKEY_LOCAL_MACHINE\
 SOFTWARE\
   Microsoft\
     VisualStudio\
       7.1\
         AddIns\
           RegionsAddIn.Connect

to probably:

HKEY_LOCAL_MACHINE\
  SOFTWARE\
    Microsoft\
      VisualStudio\
        7.0\
          AddIns\
            RegionsAddIn.Connect,

although this is only supposition on my part.

Important

If the v1.x version was previously installed, it should be removed using the following process, before installing v2.0.

  • Close VS.NET.
  • Uninstall v1.x from Add/Remove Programs.
  • Open VS.NET (you may get a message declaring that VS.NET cannot load the add-in; this is fine, we want VS.NET to remove all its references to this add-in).
  • Load a project, and select some code. Right click, select 'Add To New Region'. (You may get a message declaring that VS.NET cannot load the add-in; this is fine, we want VS.NET to remove all its references to this add-in.) Now do the same for the 'Add To Existing Region' command.
  • Close VS.NET.
  • Install v2 of the add-in, and continue as normal.

History

  • 08/06/2004 - First release.
  • 15/06/2004 - v1.1. Updated code to fix bugs identified by 0siris, and Alex Kucherenko. Also, added check to stop any region that is spanned by the selection from being displayed in dialog.
  • 06/02/2005 - v2.0. Major rewrite to fix reported bugs and to add new features.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

JWT
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

Comments and Discussions

 
QuestionVS2010 Version??? Pin
tonyhilliard10-Aug-10 3:43
membertonyhilliard10-Aug-10 3:43 
AnswerRe: VS2010 Version??? Pin
Zot Williams11-Apr-11 9:58
memberZot Williams11-Apr-11 9:58 
AnswerRe: VS2010 Version??? Pin
MLansdaal19-Sep-11 8:36
memberMLansdaal19-Sep-11 8:36 
GeneralRe: VS2010 Version??? Pin
Member 390226619-Dec-11 3:41
memberMember 390226619-Dec-11 3:41 
GeneralPerformance problem - read this first before you download if you have a large file Pin
Richard Hollis11-Mar-09 2:27
memberRichard Hollis11-Mar-09 2:27 
AnswerNot visible under Vista - Semi-Solution Pin
DaveyM6910-Sep-08 8:18
memberDaveyM6910-Sep-08 8:18 
Generalcrash when opening property page (fix included) Pin
Rob Siklos26-Aug-08 3:54
memberRob Siklos26-Aug-08 3:54 
Generalposition of Region Explorer lost on VS restart Pin
Rob Siklos22-Aug-08 6:32
memberRob Siklos22-Aug-08 6:32 
GeneralUpgrade: Regions Add-In for VS.NET 2005 and VS.NET 2008 [modified] Pin
janyou21-Apr-08 23:27
memberjanyou21-Apr-08 23:27 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 and VS.NET 2008 Pin
peervanrees20-May-08 0:08
memberpeervanrees20-May-08 0:08 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 and VS.NET 2008 Pin
petert14018-Jun-08 2:26
memberpetert14018-Jun-08 2:26 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 and VS.NET 2008 Pin
petert140118-Jun-08 1:22
memberpetert140118-Jun-08 1:22 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 and VS.NET 2008 Pin
petert140120-Jun-08 20:03
memberpetert140120-Jun-08 20:03 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 and VS.NET 2008 Pin
fdsfatboy16-Jul-08 6:07
memberfdsfatboy16-Jul-08 6:07 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 and VS.NET 2008 Pin
Roberto Silver21-Jun-11 3:28
memberRoberto Silver21-Jun-11 3:28 
QuestionMicrosoft Visual Studio 2008 Updates? Pin
mejax25-Nov-07 22:17
membermejax25-Nov-07 22:17 
GeneralRegionAddin Pin
HSD715-May-07 8:36
memberHSD715-May-07 8:36 
GeneralRe: RegionAddin Pin
MLansdaal16-May-07 9:41
memberMLansdaal16-May-07 9:41 
GeneralRe: RegionAddin Pin
HSD716-May-07 14:26
memberHSD716-May-07 14:26 
GeneralREGIONS Pin
stixoffire15-Mar-07 12:36
memberstixoffire15-Mar-07 12:36 
Generalinstall problem... Pin
smith5677-Dec-06 13:55
membersmith5677-Dec-06 13:55 
GeneralRe: install problem... Pin
hahnl25-Jan-07 3:00
memberhahnl25-Jan-07 3:00 
GeneralBUG found! (and FIX) Pin
Silbär11-Oct-06 22:44
memberSilbär11-Oct-06 22:44 
GeneralUse with VS2005 - Working (mostly!) Pin
FinishedOnTime13-Apr-06 9:21
memberFinishedOnTime13-Apr-06 9:21 
GeneralRe: Use with VS2005 - Working (mostly!) Pin
M.Lansdaal20-Apr-06 9:53
memberM.Lansdaal20-Apr-06 9:53 
GeneralRe: Use with VS2005 - Working (mostly!) Pin
FinishedOnTime11-Jun-06 4:50
memberFinishedOnTime11-Jun-06 4:50 
QuestionRe: Use with VS2005 - Working (mostly!) Pin
DalePres13-Nov-06 12:07
memberDalePres13-Nov-06 12:07 
AnswerRe: Use with VS2005 - Working (mostly!) Pin
M.Lansdaal13-Nov-06 12:11
memberM.Lansdaal13-Nov-06 12:11 
QuestionRe: Use with VS2005 - Working (mostly!) Pin
tparker15-Jun-06 3:56
membertparker15-Jun-06 3:56 
AnswerRe: Use with VS2005 - Working (mostly!) Pin
M.Lansdaal19-Jun-06 9:44
memberM.Lansdaal19-Jun-06 9:44 
GeneralTwo things that would make the addIn indispensable Pin
marc25uk9-Mar-06 19:05
membermarc25uk9-Mar-06 19:05 
GeneralRe: Two things that would make the addIn indispensable Pin
M.Lansdaal19-Apr-06 9:48
memberM.Lansdaal19-Apr-06 9:48 
GeneralUpgrade: Regions Add-In for VS.NET 2005 [modified] Pin
janyou18-Jan-06 21:51
memberjanyou18-Jan-06 21:51 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 Pin
thorinside25-Jan-06 7:15
memberthorinside25-Jan-06 7:15 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 Pin
bailes1-Feb-06 14:06
memberbailes1-Feb-06 14:06 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 Pin
janyou5-Feb-06 14:29
memberjanyou5-Feb-06 14:29 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 Pin
M.Lansdaal22-Feb-06 9:51
memberM.Lansdaal22-Feb-06 9:51 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 Pin
XIUnin22-Feb-06 5:33
memberXIUnin22-Feb-06 5:33 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 Pin
janyou22-Feb-06 17:41
memberjanyou22-Feb-06 17:41 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 Pin
vl950t22-Jul-07 2:06
membervl950t22-Jul-07 2:06 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 Pin
MikeHamilton26-Sep-07 11:43
memberMikeHamilton26-Sep-07 11:43 
GeneralRe: Upgrade: Regions Add-In for VS.NET 2005 Pin
SteveMets9-Jan-08 9:07
memberSteveMets9-Jan-08 9:07 
QuestionIs there a version for VS 2005? Pin
Hardy26-Dec-05 8:24
memberHardy26-Dec-05 8:24 
AnswerRe: Is there a version for VS 2005? Pin
S Sansanwal8-Jan-06 14:39
memberS Sansanwal8-Jan-06 14:39 
GeneralRe: Is there a version for VS 2005? Pin
byangas3-Apr-06 10:13
memberbyangas3-Apr-06 10:13 
QuestionHow do we rename/remove templates Pin
nelsonjm8-Dec-05 5:51
membernelsonjm8-Dec-05 5:51 
AnswerRe: How do we rename/remove templates Pin
JWT10-Dec-05 1:30
memberJWT10-Dec-05 1:30 
QuestionProblems with shortcuts Pin
Ricardo Mendes2-Dec-05 5:14
memberRicardo Mendes2-Dec-05 5:14 
AnswerRe: Problems with shortcuts Pin
JWT10-Dec-05 1:21
memberJWT10-Dec-05 1:21 
QuestionSupport for VS.NET 2005? Pin
M.Lansdaal5-Oct-05 15:28
memberM.Lansdaal5-Oct-05 15:28 

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 | Terms of Use | Mobile
Web04 | 2.8.150819.1 | Last Updated 11 Feb 2005
Article Copyright 2004 by JWT
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid