|
1 |
| -#if TEAMEXPLORER15 |
2 |
| -// Microsoft.VisualStudio.Shell.Framework has an alias to avoid conflict with IAsyncServiceProvider |
3 |
| -extern alias SF15; |
4 |
| -using ServiceProgressData = SF15::Microsoft.VisualStudio.Shell.ServiceProgressData; |
5 |
| -#endif |
6 |
| - |
7 |
| -using System; |
8 |
| -using System.Threading; |
| 1 | +using System; |
9 | 2 | using System.Collections.Generic;
|
10 | 3 | using System.Diagnostics.CodeAnalysis;
|
11 | 4 | using System.ComponentModel.Composition;
|
@@ -90,22 +83,14 @@ public async Task Clone(
|
90 | 83 | await StartClonenOnConnectPageAsync(teamExplorer, cloneUrl, clonePath, recurseSubmodules);
|
91 | 84 | NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
|
92 | 85 | await WaitForCloneOnHomePageAsync(teamExplorer);
|
93 |
| -#elif TEAMEXPLORER15 |
94 |
| - var gitExt = serviceProvider.GetService<IGitActionsExt>(); |
95 |
| - var typedProgress = ((Progress<ServiceProgressData>)progress) ?? new Progress<ServiceProgressData>(); |
96 |
| - typedProgress.ProgressChanged += (s, e) => statusBar.Value.ShowMessage(e.ProgressText); |
97 |
| - var cloneTask = gitExt.CloneAsync(cloneUrl, clonePath, recurseSubmodules, default(CancellationToken), typedProgress); |
98 |
| - |
99 |
| - NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home |
100 |
| - await cloneTask; |
101 |
| -#elif TEAMEXPLORER16 |
| 86 | +#elif TEAMEXPLORER15 || TEAMEXPLORER16 |
102 | 87 | // The ServiceProgressData type is in a Visual Studio 2019 assembly that we don't currently have access to.
|
103 | 88 | // Using reflection to call the CloneAsync in order to avoid conflicts with the Visual Studio 2017 version.
|
104 | 89 | // Progress won't be displayed on the status bar, but it appears prominently on the Team Explorer Home view.
|
105 | 90 | var gitExt = serviceProvider.GetService<IGitActionsExt>();
|
106 | 91 | var cloneAsyncMethod = typeof(IGitActionsExt).GetMethod(nameof(IGitActionsExt.CloneAsync));
|
107 | 92 | Assumes.NotNull(cloneAsyncMethod);
|
108 |
| - var cloneParameters = new object[] { cloneUrl, clonePath, recurseSubmodules, default(CancellationToken), null }; |
| 93 | + var cloneParameters = new object[] { cloneUrl, clonePath, recurseSubmodules, default, null }; |
109 | 94 | var cloneTask = (Task)cloneAsyncMethod.Invoke(gitExt, cloneParameters);
|
110 | 95 |
|
111 | 96 | NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
|
|
0 commit comments