簡體   English   中英

以編程方式開放源代碼管理資源管理器

[英]Open Source Control Explorer programmatically

我想以編程方式打開“源代碼管理資源管理器”工具窗口,但是找不到任何文檔。

ToolWindowPane window = this.FindToolWindow(typeof(**SourceControlExplorer**), 0, true);
if (null == window || null == window.Frame)
{
    throw new NotSupportedException("Not found");
}

有人可以告訴我類型嗎?

我不認為SourceControlExplorer具有托管類型定義。 但是,工具窗口guid在Microsoft.VisualStudio命名空間中定義為:

VSConstants.StandardToolWindows.SourceControlExplorer

Package方法沒有帶有Guid的重載,但是您可以按如下所示從IVsUIShell接口輕松調用相同的功能方向:

IVsUIShell vsShell = (IVsUIShell)Package.GetGlobalService(typeof(SVsUIShell));
Guid guidToolWindow = VSConstants.StandardToolWindows.SourceControlExplorer;
IVsWindowFrame pFrame = null;
vsShell.FindToolWindow(0, ref guidToolWindow, out pFrame);
if (pFrame!=null)
   pFrame.Show();

真誠的

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM