2016-12-13 3 views
0

Visual Studio 2015拡張機能でサービスIPendingChangesExtを取得しようとしましたが、チームエクスプローラ - [変更を保留中]ウィンドウの関連作業項目にアクセスしました。しかし、それはいつもヌルを返します。Visual Studio 2015 get IPendingChangesExt

私は私のパッケージのクラスでのコード行でそれを試してみました:

object temp = this.GetService(typeof(Microsoft.TeamFoundation.VersionControl.Controls.Extensibility.IPendingChangesExt)); 

誰もが、それはnullを返しますなぜアイデアを持っていましたか?それは他のインタフェースに置き換えられましたか、それとも別のものに置き換えられましたか?

もう1つの質問:Visual Studio 2015で使用可能なすべてのサービスを含むリストが存在しますか?

よろしく、 マック

+0

使用しているTFSのバージョンはどれですか?あなたの環境でTFS2015を使用していますか? –

+0

現時点ではTFS2013を使用しています。しかし、私たちは2017年の初めに変更が必要です。 – Muck

答えて

0

我々は唯一のVisual Studio 2013年にIPendingChangesExtインスタンスを取得することができ、我々はこのように、Microsoft.TeamFoundation.Controls.ITeamExplorer経由IPendingChangesExtインスタンスを取得することができます。

Microsoft.TeamFoundation.Controls .ITeamExplorer teamExplorer;

teamExplorer = base.GetService(typeof(Microsoft.TeamFoundation.Controls.ITeamExplorer)) 
        as Microsoft.TeamFoundation.Controls.ITeamExplorer; 


    var teamExplorerPage = teamExplorer.NavigateToPage(new Guid(Microsoft.TeamFoundation.Controls.TeamExplorerPageIds.PendingChanges), null); 

    var pendingChangesExt = teamExplorerPage.GetExtensibilityService(
        typeof(Microsoft.TeamFoundation.VersionControl.Controls.Extensibility.IPendingChangesExt)) 
        as Microsoft.TeamFoundation.VersionControl.Controls.Extensibility.IPendingChangesExt;