category: [ Visual Studio ] tags: [ Getting Started ] [ Plugins ] [ Team Explorer ] [ Visual Studio ] [ Visual Studio Plugin ]
created: 09 Jan 2014 @ 13:12 modified: 24 Apr 2017 @ 13:57
In Getting start with a Team Explorer Plugin for VS 2013 Part 1 we setup a base to start extending Team Explorer, this post assumes you have already have the base project setup.
Creating a new Team Explorer Navigation Item
Add a new const to the GuidList class (in the Guids file) like below
Add any image (to be used as the icon) to the Resources.resx file and call it SampleImage like below
Create a class called SampleTeamExplorerNavigationItem and replace the contents with code below
Note how we used the GuidList.sampleTeamExplorerNavigationItem guid string that we created in the TeamExplorerNavigationItem attribute, we also specified a priority of 100 saying that this navigation item should be high up on the list of navigation items. We specified in the Execute method that we want to see a message box to make sure our the event is being fired, we'll change this at a later stage, we also set some basic properties for the display of our button including the image we added earlier. If you run the project you will see in the Team Explorer that our Sample Button is visible.
Note when you click the button the message box displays as expected.
In the Getting start with a Team Explorer Plugin for VS 2013 Part 3 we will be creating a new Team Explorer Page and then changing our Execute method to navigate to this page.
Gordon Beeming works at Nologo Studios in the sunny city of Durban, South Africa. He is the Lead for the Data and Services Team and has a strong focus on Developer Efficiencies and R&D. When he's not hacking away at a keyboard in Visual Studio he'll generally be relaxing with his family or hitting the black top getting in some mileage. He is a Visual Studio ALM Ranger and Visual Studio ALM MVP.