2013-02-13 54 views
0

我正在创建TFS的合并向导的副本以添加新功能。如何以编程方式操作挂起的更改窗口?

我已经与workspakce.Merge api合并。现在我需要一种以编程方式显示待处理更改 - 冲突窗口的方式。

我已经从PendingChangesExt像有IVsWindowFrame:

GetStatus status = sourceExplorer.Workspace.Merge(sourcePath, targetPath, versionFrom, versionTo, LockLevel.None, RecursionType.Full, MergeOptionsEx.None); 

    IVsWindowFrame frame = pendingChanges.VsWindowFrame; 
    frame.Show(); 

当我打电话展(),未决的改变窗口与结账文件刷新,但我需要在此屏幕选择最后一个按钮(冲突),以显示合并的冲突。

我该如何通过IVsWindowFrame在此屏幕上编程式地单击Conflict按钮?

+0

我找到了一个部分解决方案,但是我不能让冲突窗口出现!仅显示源未决更改... m_applicationObject.ExecuteCommand(“View.TfsPendingChanges”,“”); //刷新 m_applicationObject.Commands.Raise(“{FFE1131C-8EA1-4D05-9728-34AD4611BDA9}”,4808,ref customIn,ref customOut); //获得冲突 customOut = null; m_applicationObject.Commands.Raise(“{FFE1131C-8EA1-4D05-9728-34AD4611BDA9}”,4832,ref customIn,ref customOut); – Denny 2013-02-13 14:06:08

回答

1

我找到了解决方案与乍得树干的帮助:

public void refreshPendingChanges() 
{ 
    Object customIn = null; 
    Object customOut = null; 

    //Show TfsPendingChanges 
    m_applicationObject.ExecuteCommand("View.TfsPendingChanges", ""); 

    //Refresh 
    m_applicationObject.Commands.Raise("{FFE1131C-8EA1-4D05-9728-34AD4611BDA9}", 4808, ref customIn, ref customOut); 

    //Activate Source Explorer 
    m_applicationObject.DTE.Windows.Item("{99B8FA2F-AB90-4F57-9C32-949F146F1914}").Activate(); //I get this GUID recording a Macro. 
    //Show Conflicts 
    m_applicationObject.DTE.ExecuteCommand("File.TfsResumeConflictResolution"); 
} 

感谢乍得树干,那我说关于File.TfsResumeConflictResolution!

相关问题