Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 52b81db

Browse files
committed
Let's not use hardcoded service IDs
1 parent faa44d9 commit 52b81db

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

src/GitHub.Exports/Services/IMenuProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace GitHub.VisualStudio
88
/// Container for static and dynamic visibility menus (context, toolbar, top, etc)
99
/// Get a reference to this via MEF and register the menus
1010
/// </summary>
11-
[Guid("76904E1A-9D58-41AB-8957-C23B9F50727B")]
11+
[Guid(Guids.MenuProviderId)]
1212
public interface IMenuProvider
1313
{
1414
/// <summary>

src/GitHub.Exports/Services/IUIProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
using System.ComponentModel.Composition.Hosting;
33
using GitHub.Models;
44
using GitHub.UI;
5-
using System.Windows.Controls;
65
using System.Runtime.InteropServices;
6+
using GitHub.VisualStudio;
77

88
namespace GitHub.Services
99
{
10-
[Guid("76909E1A-9D58-41AB-8957-C26B9550787B")]
10+
[Guid(Guids.GitHubServiceProviderId)]
1111
public interface IUIProvider : IServiceProvider
1212
{
1313
ExportProvider ExportProvider { get; }

src/GitHub.Exports/Settings/Guids.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ public static class Guids
88
public const string ImagesId = "27841f47-070a-46d6-90be-a5cbbfc724ac";
99
public const string MenuProviderId = "36FA083F-E0BE-418E-B42F-CB7623C55A00";
1010
public const string UsageTrackerId = "9362DD38-7E49-4B5D-9DE1-E843D4155716";
11+
public const string GitHubServiceProviderId = "76909E1A-9D58-41AB-8957-C26B9550787B";
12+
13+
// VisualStudio IDs
14+
public const string GitSccProviderId = "11B8E6D7-C08B-4385-B321-321078CDD1F8";
1115
}
1216
}

src/GitHub.TeamFoundation.14/Base/TeamExplorerServiceHolder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public IServiceProvider ServiceProvider
4848
serviceProvider = value;
4949
if (serviceProvider == null)
5050
return;
51-
GitUIContext = GitUIContext ?? UIContext.FromUIContextGuid(new Guid("11B8E6D7-C08B-4385-B321-321078CDD1F8"));
51+
GitUIContext = GitUIContext ?? UIContext.FromUIContextGuid(new Guid(Guids.GitSccProviderId));
5252
UIContextChanged(GitUIContext?.IsActive ?? false, false);
5353
}
5454
}
@@ -118,7 +118,7 @@ public void ClearServiceProvider(IServiceProvider provider)
118118

119119
public void Refresh()
120120
{
121-
GitUIContext = GitUIContext ?? UIContext.FromUIContextGuid(new Guid("11B8E6D7-C08B-4385-B321-321078CDD1F8"));
121+
GitUIContext = GitUIContext ?? UIContext.FromUIContextGuid(new Guid(Guids.GitSccProviderId));
122122
UIContextChanged(GitUIContext?.IsActive ?? false, true);
123123
}
124124

src/GitHub.VisualStudio/GitHubPackage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace GitHub.VisualStudio
2323
[Guid(GuidList.guidGitHubPkgString)]
2424
[ProvideMenuResource("Menus.ctmenu", 1)]
2525
// this is the Git service GUID, so we load whenever it loads
26-
[ProvideAutoLoad("11B8E6D7-C08B-4385-B321-321078CDD1F8")]
26+
[ProvideAutoLoad(Guids.GitSccProviderId)]
2727
[ProvideToolWindow(typeof(GitHubPane), Orientation = ToolWindowOrientation.Right, Style = VsDockStyle.Tabbed, Window = EnvDTE.Constants.vsWindowKindSolutionExplorer)]
2828
[ProvideOptionPage(typeof(OptionsPage), "GitHub for Visual Studio", "General", 0, 0, supportsAutomation: true)]
2929
public class GitHubPackage : AsyncPackage

0 commit comments

Comments
 (0)