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

Commit 553e575

Browse files
committed
Use consts for URLs and Guids.
1 parent 440a7a4 commit 553e575

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/GitHub.App/Info/GitHubUrls.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,10 @@ public static string Billing(this IAccount account)
9494
: string.Format(CultureInfo.InvariantCulture,
9595
GitHub + "/organizations/{0}/settings/billing", account.Login);
9696
}
97+
98+
/// <summary>
99+
/// The URL for the GitHub for Visual Studio documentation.
100+
/// </summary>
101+
public const string Documentation = "https://visualstudio.github.com/docs";
97102
}
98103
}

src/GitHub.Exports/Settings/Guids.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ public static class Guids
1212
public const string GitHubServiceProviderId = "76909E1A-9D58-41AB-8957-C26B9550787B";
1313
public const string StartPagePackageId = "3b764d23-faf7-486f-94c7-b3accc44a70e";
1414
public const string CodeContainerProviderId = "6CE146CB-EF57-4F2C-A93F-5BA685317660";
15+
public const string TeamExplorerWelcomeMessage = "C529627F-8AA6-4FDB-82EB-4BFB7DB753C3";
1516

1617
// VisualStudio IDs
1718
public const string GitSccProviderId = "11B8E6D7-C08B-4385-B321-321078CDD1F8";
19+
public const string TeamExplorerInstall3rdPartyGitTools = "DF785C7C-8454-4836-9686-D1C4A01D0BB9";
1820
}
1921
}

src/GitHub.TeamFoundation.14/Home/GitHubHomeSection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using GitHub.VisualStudio.UI;
1717
using GitHub.Settings;
1818
using System.Windows.Threading;
19+
using GitHub.Info;
1920

2021
namespace GitHub.VisualStudio.TeamExplorer.Home
2122
{
@@ -25,7 +26,6 @@ public class GitHubHomeSection : TeamExplorerSectionBase, IGitHubHomeSection
2526
{
2627
public const string GitHubHomeSectionId = "72008232-2104-4FA0-A189-61B0C6F91198";
2728
const string TrainingUrl = "https://services.github.com/on-demand/windows/visual-studio";
28-
const string DocsUrl = "https://visualstudio.github.com/docs";
2929

3030
readonly IVisualStudioBrowser visualStudioBrowser;
3131
readonly ITeamExplorerServices teamExplorerServices;
@@ -76,7 +76,7 @@ public GitHubHomeSection(IGitHubServiceProvider serviceProvider,
7676

7777
bool IsGitToolsMessageVisible()
7878
{
79-
return teamExplorerServices.IsNotificationVisible(new Guid("DF785C7C-8454-4836-9686-D1C4A01D0BB9"));
79+
return teamExplorerServices.IsNotificationVisible(new Guid(Guids.TeamExplorerInstall3rdPartyGitTools));
8080
}
8181

8282
protected async override void RepoChanged(bool changed)
@@ -149,7 +149,7 @@ void DoOpenOnGitHub()
149149

150150
void ShowWelcomeMessage()
151151
{
152-
var welcomeMessageGuid = new Guid("C529627F-8AA6-4FDB-82EB-4BFB7DB753C3");
152+
var welcomeMessageGuid = new Guid(Guids.TeamExplorerWelcomeMessage);
153153
teamExplorerServices.ShowMessage(
154154
Resources.TeamExplorerWelcomeMessage,
155155
new RelayCommand(o =>
@@ -163,7 +163,7 @@ void ShowWelcomeMessage()
163163
usageTracker.IncrementWelcomeTrainingClicks().Forget();
164164
break;
165165
case "show-docs":
166-
visualStudioBrowser.OpenUrl(new Uri(DocsUrl));
166+
visualStudioBrowser.OpenUrl(new Uri(GitHubUrls.Documentation));
167167
usageTracker.IncrementWelcomeDocsClicks().Forget();
168168
break;
169169
case "dont-show-again":

src/GitHub.VisualStudio/UI/Views/GitHubPaneViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using System.Reactive.Linq;
1717
using System.Threading.Tasks;
1818
using System.Windows.Input;
19-
19+
using GitHub.Info;
2020

2121
namespace GitHub.VisualStudio.UI.Views
2222
{
@@ -132,7 +132,7 @@ public override void Initialize(IServiceProvider serviceProvider)
132132
() => true,
133133
() =>
134134
{
135-
browser.OpenUrl(new Uri("https://visualstudio.github.com/docs"));
135+
browser.OpenUrl(new Uri(GitHubUrls.Documentation));
136136
usageTracker.IncrementGitHubPaneHelpClicks().Forget();
137137
},
138138
true);

0 commit comments

Comments
 (0)