зеркало из https://github.com/github/VisualStudio.git
Add a loader for external packages
Add a way to load external packages that are included in the vsix and expose the IUIProvider as a global service, so those packages can make use of our services. Load the StartPage package if we're running on Dev15 Preview 4
This commit is contained in:
Родитель
d9d394d15f
Коммит
e11d832e15
|
@ -16,3 +16,6 @@
|
||||||
[submodule "script"]
|
[submodule "script"]
|
||||||
path = script
|
path = script
|
||||||
url = https://github.com/github/VisualStudioBuildScripts
|
url = https://github.com/github/VisualStudioBuildScripts
|
||||||
|
[submodule "submodules/externalpackages/StartPage"]
|
||||||
|
path = submodules/externalpackages/StartPage
|
||||||
|
url = https://github.com/editor-tools/StartPage.git
|
||||||
|
|
|
@ -22,6 +22,7 @@ using Rothko;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using GitHub.Collections;
|
using GitHub.Collections;
|
||||||
using GitHub.UI;
|
using GitHub.UI;
|
||||||
|
using GitHub.Extensions.Reactive;
|
||||||
|
|
||||||
namespace GitHub.ViewModels
|
namespace GitHub.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -157,7 +158,11 @@ namespace GitHub.ViewModels
|
||||||
operatingSystem.Directory.CreateDirectory(BaseRepositoryPath);
|
operatingSystem.Directory.CreateDirectory(BaseRepositoryPath);
|
||||||
|
|
||||||
return cloneService.CloneRepository(repository.CloneUrl, repository.Name, BaseRepositoryPath)
|
return cloneService.CloneRepository(repository.CloneUrl, repository.Name, BaseRepositoryPath)
|
||||||
.Do(_ => this.usageTracker.IncrementCloneCount());
|
.ContinueAfter(() =>
|
||||||
|
{
|
||||||
|
usageTracker.IncrementCloneCount();
|
||||||
|
return Observable.Return(Unit.Default);
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.SelectMany(_ => _)
|
.SelectMany(_ => _)
|
||||||
.Catch<Unit, Exception>(e =>
|
.Catch<Unit, Exception>(e =>
|
||||||
|
|
|
@ -153,6 +153,7 @@
|
||||||
<DependentUpon>IPackageSettings.tt</DependentUpon>
|
<DependentUpon>IPackageSettings.tt</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Settings\GitHubConnectSectionState.cs" />
|
<Compile Include="Settings\GitHubConnectSectionState.cs" />
|
||||||
|
<Compile Include="Settings\Guids.cs" />
|
||||||
<Compile Include="Settings\PullRequestListUIState.cs" />
|
<Compile Include="Settings\PullRequestListUIState.cs" />
|
||||||
<Compile Include="Settings\RepositoryUIState.cs" />
|
<Compile Include="Settings\RepositoryUIState.cs" />
|
||||||
<Compile Include="Settings\UIState.cs" />
|
<Compile Include="Settings\UIState.cs" />
|
||||||
|
|
|
@ -7,6 +7,8 @@ using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.VisualStudio.Shell;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace GitHub.Helpers
|
namespace GitHub.Helpers
|
||||||
{
|
{
|
||||||
|
@ -47,13 +49,15 @@ namespace GitHub.Helpers
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var name = new AssemblyName(e.Name);
|
var requestedName = e.Name.TrimSuffix(".dll", StringComparison.OrdinalIgnoreCase);
|
||||||
if (!ourAssemblies.Contains(name.Name))
|
var name = new AssemblyName(requestedName).Name;
|
||||||
|
if (!ourAssemblies.Contains(name))
|
||||||
return null;
|
return null;
|
||||||
var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||||
var filename = Path.Combine(path, name.Name + ".dll");
|
var filename = Path.Combine(path, name + ".dll");
|
||||||
if (!File.Exists(filename))
|
if (!File.Exists(filename))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return Assembly.LoadFrom(filename);
|
return Assembly.LoadFrom(filename);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
@ -3,9 +3,11 @@ using System.ComponentModel.Composition.Hosting;
|
||||||
using GitHub.Models;
|
using GitHub.Models;
|
||||||
using GitHub.UI;
|
using GitHub.UI;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace GitHub.Services
|
namespace GitHub.Services
|
||||||
{
|
{
|
||||||
|
[Guid("76909E1A-9D58-41AB-8957-C26B9550787B")]
|
||||||
public interface IUIProvider : IServiceProvider
|
public interface IUIProvider : IServiceProvider
|
||||||
{
|
{
|
||||||
ExportProvider ExportProvider { get; }
|
ExportProvider ExportProvider { get; }
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace GitHub.VisualStudio
|
||||||
|
{
|
||||||
|
public static class Guids
|
||||||
|
{
|
||||||
|
public const string PackageId = "c3d3dc68-c977-411f-b3e8-03b0dccf7dfc";
|
||||||
|
public const string ImagesId = "27841f47-070a-46d6-90be-a5cbbfc724ac";
|
||||||
|
}
|
||||||
|
}
|
|
@ -107,12 +107,26 @@
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
<Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
|
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<HintPath>..\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
<Reference Include="Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Immutable.14.0.14.3.25407\lib\net45\Microsoft.VisualStudio.Shell.Immutable.14.0.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="Microsoft.VisualStudio.Text.Logic, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
<Reference Include="Microsoft.VisualStudio.Text.Logic, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="Microsoft.VisualStudio.Text.UI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
<Reference Include="Microsoft.VisualStudio.Text.UI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="Microsoft.VisualStudio.OLE.Interop" />
|
|
||||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop" />
|
|
||||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0" />
|
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0" />
|
||||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0" />
|
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0" />
|
||||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0" />
|
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0" />
|
||||||
|
@ -123,10 +137,12 @@
|
||||||
<EmbedInteropTypes>true</EmbedInteropTypes>
|
<EmbedInteropTypes>true</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.VisualStudio.Text.UI.Wpf, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
<Reference Include="Microsoft.VisualStudio.Text.UI.Wpf, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="Microsoft.VisualStudio.TextManager.Interop" />
|
|
||||||
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0" />
|
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0" />
|
||||||
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0" />
|
|
||||||
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.12.0" />
|
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.12.0" />
|
||||||
|
<Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<HintPath>..\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
|
@ -234,7 +250,7 @@
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Settings\PackageSettings.cs" />
|
<Compile Include="Settings\PackageSettings.cs" />
|
||||||
<Compile Include="Settings\Settings.cs" />
|
<Compile Include="Settings\Guids.cs" />
|
||||||
<Compile Include="GlobalSuppressions.cs" />
|
<Compile Include="GlobalSuppressions.cs" />
|
||||||
<Compile Include="GitHubPackage.cs" />
|
<Compile Include="GitHubPackage.cs" />
|
||||||
<Compile Include="PkgCmdID.cs" />
|
<Compile Include="PkgCmdID.cs" />
|
||||||
|
@ -547,14 +563,14 @@
|
||||||
<Project>{161dbf01-1dbf-4b00-8551-c5c00f26720d}</Project>
|
<Project>{161dbf01-1dbf-4b00-8551-c5c00f26720d}</Project>
|
||||||
<Name>GitHub.TeamFoundation.14</Name>
|
<Name>GitHub.TeamFoundation.14</Name>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bDebugSymbolsProjectOutputGroup%3bBuiltProjectOutputGroup%3bBuiltProjectOutputGroupDependencies%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>
|
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;GetCopyToOutputDirectoryItems;DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIX>
|
||||||
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup%3b</IncludeOutputGroupsInVSIXLocalOnly>
|
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup%3b</IncludeOutputGroupsInVSIXLocalOnly>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\GitHub.TeamFoundation.15\GitHub.TeamFoundation.15.csproj">
|
<ProjectReference Include="..\GitHub.TeamFoundation.15\GitHub.TeamFoundation.15.csproj">
|
||||||
<Project>{161dbf01-1dbf-4b00-8551-c5c00f26720e}</Project>
|
<Project>{161dbf01-1dbf-4b00-8551-c5c00f26720e}</Project>
|
||||||
<Name>GitHub.TeamFoundation.15</Name>
|
<Name>GitHub.TeamFoundation.15</Name>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bDebugSymbolsProjectOutputGroup%3bBuiltProjectOutputGroup%3bBuiltProjectOutputGroupDependencies%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>
|
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;GetCopyToOutputDirectoryItems;DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIX>
|
||||||
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup%3b</IncludeOutputGroupsInVSIXLocalOnly>
|
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup%3b</IncludeOutputGroupsInVSIXLocalOnly>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\GitHub.UI.Reactive\GitHub.UI.Reactive.csproj">
|
<ProjectReference Include="..\GitHub.UI.Reactive\GitHub.UI.Reactive.csproj">
|
||||||
|
@ -589,6 +605,23 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
|
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="..\..\submodules\externalpackages\StartPage\build\GitHub.StartPage.pkgdef">
|
||||||
|
<Link>GitHub.StartPage.pkgdef</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<IncludeInVSIX>true</IncludeInVSIX>
|
||||||
|
</Content>
|
||||||
|
<Content Include="..\..\submodules\externalpackages\StartPage\build\GitHub.StartPage.dll">
|
||||||
|
<Link>GitHub.StartPage.dll</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<IncludeInVSIX>true</IncludeInVSIX>
|
||||||
|
</Content>
|
||||||
|
<Content Include="..\..\submodules\externalpackages\StartPage\build\GitHub.StartPage.pdb">
|
||||||
|
<Link>GitHub.StartPage.pdb</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<IncludeInVSIX>true</IncludeInVSIX>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<UseCodebase>true</UseCodebase>
|
<UseCodebase>true</UseCodebase>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
@ -1,32 +1,26 @@
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.Composition;
|
using System.ComponentModel.Composition;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using GitHub.Extensions;
|
using GitHub.Extensions;
|
||||||
using GitHub.Models;
|
using GitHub.Models;
|
||||||
using GitHub.Primitives;
|
|
||||||
using GitHub.Services;
|
using GitHub.Services;
|
||||||
using GitHub.UI;
|
|
||||||
using GitHub.VisualStudio.Base;
|
|
||||||
using GitHub.VisualStudio.UI;
|
using GitHub.VisualStudio.UI;
|
||||||
using Microsoft.VisualStudio;
|
using Microsoft.VisualStudio;
|
||||||
using Microsoft.VisualStudio.Shell;
|
using Microsoft.VisualStudio.Shell;
|
||||||
using Microsoft.VisualStudio.Shell.Interop;
|
using Microsoft.VisualStudio.Shell.Interop;
|
||||||
using Octokit;
|
using Octokit;
|
||||||
using GitHub.Helpers;
|
using GitHub.Helpers;
|
||||||
|
using System.ComponentModel.Design;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Threading;
|
||||||
|
using tasks = System.Threading.Tasks;
|
||||||
|
|
||||||
namespace GitHub.VisualStudio
|
namespace GitHub.VisualStudio
|
||||||
{
|
{
|
||||||
[PackageRegistration(UseManagedResourcesOnly = true)]
|
[PackageRegistration(UseManagedResourcesOnly = true)]
|
||||||
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
|
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
|
||||||
[Guid(GuidList.guidGitHubPkgString)]
|
[Guid(GuidList.guidGitHubPkgString)]
|
||||||
//[ProvideBindingPath]
|
|
||||||
[ProvideMenuResource("Menus.ctmenu", 1)]
|
[ProvideMenuResource("Menus.ctmenu", 1)]
|
||||||
//[ProvideAutoLoad(UIContextGuids.NoSolution)]
|
|
||||||
// this is the Git service GUID, so we load whenever it loads
|
// this is the Git service GUID, so we load whenever it loads
|
||||||
[ProvideAutoLoad("11B8E6D7-C08B-4385-B321-321078CDD1F8")]
|
[ProvideAutoLoad("11B8E6D7-C08B-4385-B321-321078CDD1F8")]
|
||||||
[ProvideToolWindow(typeof(GitHubPane), Orientation = ToolWindowOrientation.Right, Style = VsDockStyle.Tabbed, Window = EnvDTE.Constants.vsWindowKindSolutionExplorer)]
|
[ProvideToolWindow(typeof(GitHubPane), Orientation = ToolWindowOrientation.Right, Style = VsDockStyle.Tabbed, Window = EnvDTE.Constants.vsWindowKindSolutionExplorer)]
|
||||||
|
@ -80,4 +74,60 @@ namespace GitHub.VisualStudio
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
|
||||||
|
[ProvideService(typeof(IUIProvider), IsAsyncQueryable = true)]
|
||||||
|
[ProvideAutoLoad(UIContextGuids.NoSolution)]
|
||||||
|
[ProvideAutoLoad(UIContextGuids.SolutionExists)]
|
||||||
|
[Guid("D5CE1488-DEDE-426D-9E5B-BFCCFBE33E53")]
|
||||||
|
public sealed class ServiceProviderPackage : AsyncPackage
|
||||||
|
{
|
||||||
|
static Version vsversion;
|
||||||
|
public static Version VSVersion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (vsversion == null)
|
||||||
|
{
|
||||||
|
var asm = typeof(ITaskList).Assembly;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// this will return Microsoft.VisualStudio.Shell.Immutable.14.0 in VS15
|
||||||
|
// but Microsoft.VisualStudio.Shell.Framework in Dev15
|
||||||
|
var vinfo = FileVersionInfo.GetVersionInfo(asm.Location);
|
||||||
|
vsversion = new Version(vinfo.FileMajorPart, vinfo.FileMinorPart, vinfo.FileBuildPart, vinfo.FilePrivatePart);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// something wrong, fallback to assembly version
|
||||||
|
vsversion = asm.GetName().Version;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return vsversion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
|
||||||
|
{
|
||||||
|
AddService(typeof(IUIProvider), CreateService, true);
|
||||||
|
|
||||||
|
// Load the start page package only for Dev15 Preview 4
|
||||||
|
if (VSVersion.Major == 15 && VSVersion.Build == 25618)
|
||||||
|
{
|
||||||
|
var shell = await GetServiceAsync(typeof(SVsShell)) as IVsShell;
|
||||||
|
IVsPackage startPagePackage;
|
||||||
|
if (ErrorHandler.Failed(shell?.LoadPackage(new Guid("3b764d23-faf7-486f-94c7-b3accc44a70d"), out startPagePackage) ?? -1))
|
||||||
|
{
|
||||||
|
// ¯\_(ツ)_/¯
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.Task<object> CreateService(IAsyncServiceContainer container, CancellationToken cancellationToken, Type serviceType)
|
||||||
|
{
|
||||||
|
AssemblyResolver.InitializeAssemblyResolver();
|
||||||
|
var ret = Services.ComponentModel.DefaultExportProvider.GetExportedValueOrDefault<IUIProvider>();
|
||||||
|
return tasks.Task.FromResult((object)ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
// Guids.cs
|
using System;
|
||||||
// MUST match guids.h
|
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
namespace GitHub.VisualStudio
|
namespace GitHub.VisualStudio
|
||||||
{
|
{
|
||||||
|
@ -11,10 +8,10 @@ namespace GitHub.VisualStudio
|
||||||
public const string guidGitHubCmdSetString = "c4c91892-8881-4588-a5d9-b41e8f540f5a";
|
public const string guidGitHubCmdSetString = "c4c91892-8881-4588-a5d9-b41e8f540f5a";
|
||||||
public const string guidGitHubToolbarCmdSetString = "C5F1193E-F300-41B3-B4C4-5A703DD3C1C6";
|
public const string guidGitHubToolbarCmdSetString = "C5F1193E-F300-41B3-B4C4-5A703DD3C1C6";
|
||||||
public const string guidContextMenuSetString = "31057D08-8C3C-4C5B-9F91-8682EA08EC27";
|
public const string guidContextMenuSetString = "31057D08-8C3C-4C5B-9F91-8682EA08EC27";
|
||||||
|
public const string guidImageMoniker = "27841f47-070a-46d6-90be-a5cbbfc724ac";
|
||||||
|
|
||||||
public static readonly Guid guidGitHubCmdSet = new Guid(guidGitHubCmdSetString);
|
public static readonly Guid guidGitHubCmdSet = new Guid(guidGitHubCmdSetString);
|
||||||
public static readonly Guid guidGitHubToolbarCmdSet = new Guid(guidGitHubToolbarCmdSetString);
|
public static readonly Guid guidGitHubToolbarCmdSet = new Guid(guidGitHubToolbarCmdSetString);
|
||||||
|
|
||||||
public static readonly Guid guidContextMenuSet = new Guid(guidContextMenuSetString);
|
public static readonly Guid guidContextMenuSet = new Guid(guidContextMenuSetString);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,6 +4,11 @@
|
||||||
<package id="Fody" version="1.28.0" targetFramework="net45" developmentDependency="true" />
|
<package id="Fody" version="1.28.0" targetFramework="net45" developmentDependency="true" />
|
||||||
<package id="LibGit2Sharp" version="0.22.0" targetFramework="net461" />
|
<package id="LibGit2Sharp" version="0.22.0" targetFramework="net461" />
|
||||||
<package id="LibGit2Sharp.NativeBinaries" version="1.0.129" targetFramework="net461" />
|
<package id="LibGit2Sharp.NativeBinaries" version="1.0.129" targetFramework="net461" />
|
||||||
|
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6070" targetFramework="net461" />
|
||||||
|
<package id="Microsoft.VisualStudio.Shell.Immutable.11.0" version="11.0.50727" targetFramework="net461" />
|
||||||
|
<package id="Microsoft.VisualStudio.Shell.Immutable.14.0" version="14.3.25407" targetFramework="net461" />
|
||||||
|
<package id="Microsoft.VisualStudio.Shell.Interop" version="7.10.6071" targetFramework="net461" />
|
||||||
|
<package id="Microsoft.VisualStudio.TextManager.Interop" version="7.10.6070" targetFramework="net461" />
|
||||||
<package id="Microsoft.VSSDK.Vsixsigntool" version="14.1.24720" targetFramework="net45" />
|
<package id="Microsoft.VSSDK.Vsixsigntool" version="14.1.24720" targetFramework="net45" />
|
||||||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
|
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
|
||||||
<package id="NLog" version="3.1.0" targetFramework="net45" />
|
<package id="NLog" version="3.1.0" targetFramework="net45" />
|
||||||
|
|
|
@ -28,5 +28,6 @@
|
||||||
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.App" Path="|GitHub.App|" />
|
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.App" Path="|GitHub.App|" />
|
||||||
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.TeamFoundation.14" Path="|GitHub.TeamFoundation.14|" />
|
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.TeamFoundation.14" Path="|GitHub.TeamFoundation.14|" />
|
||||||
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.TeamFoundation.15" Path="|GitHub.TeamFoundation.15|" />
|
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="GitHub.TeamFoundation.15" Path="|GitHub.TeamFoundation.15|" />
|
||||||
|
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="File" Path="GitHub.StartPage.pkgdef" />
|
||||||
</Assets>
|
</Assets>
|
||||||
</PackageManifest>
|
</PackageManifest>
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit ca4724e943f1d20ec335432d9cfd1f6a1682410e
|
Загрузка…
Ссылка в новой задаче