Lately I have been doing some work on extending Team System. Therefore I installed the Visual Studio SDK that now also contains the Team System Extensibility kit. In this kit you can find a lot of samples on how to embrace and extend Team System. One of the samples contains code to learn more about extending the project Creation wizard and adding your own nodes to a team project in the Team Explorer. It appeared to me that the sample code for extending the project explorer in this sample is not working. When you create a project based on the provided sample template a team project gets created that has an additional node in the team explorer called “Sample Plugin”.
This node should be expandable so it shows the additional links you provided during project creation. But this is broken. The code provided did not include a late change on the team explorer implementation and therefore the node is not expandable. to make it work again you need to modify the sample code a little bit. Below you can find the change I have made to fix the problem.
The file VsPkg.cs contains the definition for the different node types used in the explorer. You can find the following code for the Root node:
public class TEPluginRoot : RootNode
{
public TEPluginRoot(string path) : base(path){}
public override string PropertiesClassName
{
get
{
return “Plugin Root”;
}
}
}
The fix you need to apply is to add an override for the Icons property. See code below:
public override System.Windows.Forms.ImageList Icons
{
get
{
return new System.Windows.Forms.ImageList();
}
}
Now the nodes are expandable again.
I want to thank Ravi Terala (a developer on the Team Explorer) for helping me out here. I though I would share this subtle change, because without help from him I could not make it work myself.