Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / September 2004

Tip: Looking for answers? Try searching our database.

HOWTO: Customize TOOLBOX in VS.2002

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SteveR - 02 Sep 2004 15:51 GMT
In my toolbox, I have created a customer tab called "Code Snippets".
As you might have guessed, "Code Snippets" contains a number of
resuable code snips that I would like to share with members of my
team.

In leiu of sharing the TOOLBOX.TBD file, I would like to create an
application that would do help me in sharing the contents of my "Code
Snippets" tab.

My application would work something like this.

1.  The app would prompt you for the name of the toolbox tab to
export.
2.  A list of all the items in the tab would be displayed.
3.  You would select the items you want to export.
4.  The exported items are written to an XML file.
5.  Next, the XML file can be shared with other team members.
6.  They will run the same application.  However, this time they would
choose to import the XML.  Selecting only the items they want.

I have looked at EnvDTE, but I am not sure if this is the right
approach.

Any thoughts would be appreciated.

Thanks.

Steve
Tim Farley - 30 Sep 2004 17:01 GMT
> In leiu of sharing the TOOLBOX.TBD file, I would like to create an
> application that would do help me in sharing the contents of my "Code
> Snippets" tab.

Yes, this is totally doable.  I would approach it as follows:

Use the wizard to create a new ADDIN for Visual Studio.

In the UISetup part of your OnConnection interface, I would use
AddNamedCommand() to create "export" and "import" commands.  (The wizard code
includes one command so you can crib from that).

I would add your "export" and "import" commands to the right-click menu for
the toolbox, seems like the most logical place to do it.  That would work
something like this:

(cmdExport is the return value from AddNamedCommand, app is your cached
pointer to the DTE object)

// Get the right-click menu for the toolbox
popupMenu = app.CommandBars["Toolbox Tab"];

Microsoft.Office.Core.CommandBarButton export =
(Microsoft.Office.Core.CommandBarButton)cmdExport.AddControl(popupMenu,
popupMenu.Controls.Count );
export.Style = MsoButtonStyle.msoButtonAutomatic;
export.BeginGroup = true;

(In the above case I'm adding it as the last item on the menu and putting it
into its own group).

In the QueryStatus and Exec, implement handlers for your export and import
commands.  (Again, you can crib from the example the wizard provides).  Of
course what UI you provide is up to you, it could be a dialog or whatever.

Hope that helps.

--Tim Farley

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.