Répondre

0

Si vous souhaitez désactiver la section dans la page, veuillez vous référer au code suivant.

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); 

Si vous souhaitez ajouter des sections aux pages, veuillez vous reporter au lien suivant, qui fournit le code associé.

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

+0

Merci le premier lien répond à la question. – Noel