I would like to write an extension to Visual Studio that allows me to add additional UI elements to the existing code review window. This Stack Overflow question appears to define exactly what I would like to do. But the answer does not explain how this would be achieved while suggesting that it can be.
If you want to disable section in page, please refer to the following code.
Microsoft.TeamFoundation.Controls.ITeamExplorer teamExplorer;
Microsoft.TeamFoundation.Controls.ITeamExplorerPage page;
teamExplorer = this.ServiceProvider.GetService(typeof(Microsoft.TeamFoundation.Controls.ITeamExplorer))
as Microsoft.TeamFoundation.Controls.ITeamExplorer;
page = teamExplorer.CurrentPage;
var sections = page.PageContent;
Type type = typeof(System.Windows.Documents.Hyperlink);
FieldInfo f1 = page.PageContent.GetType().GetField("linkCancelDecline", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static);
PropertyInfo pinfo = sections.GetType().GetProperty("IsEnabled");
pinfo.SetValue(sections, false, null);
sections.GetType().GetProperty("IsEnabled").GetValue(sections, null);
If you want to add sections to pages, please refer to the following link, which provide related code.
https://binary-stuff.com/post/getting-start-with-a-team-explorer-plugin-for-vs-2013-part-4 https://github.com/jakobehn/GitFlow.VS/tree/master/TeamExplorer.Common