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

Commit fe9b3f2

Browse files
jcansdaleStanleyGoldman
authored andcommitted
Remove redundant ShowNotification
The view already handles this, showing: "Repository created successfully".
1 parent e4e574d commit fe9b3f2

File tree

1 file changed

+8
-62
lines changed

1 file changed

+8
-62
lines changed

src/GitHub.VisualStudio.16/Sync/PublishSection.cs

Lines changed: 8 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
1-
/*
2-
* Copyright (c) Microsoft Corporation. All rights reserved. This code released
3-
* under the terms of the Microsoft Limited Public License (MS-LPL).
4-
*/
5-
using System;
1+
using System;
62
using System.ComponentModel;
7-
using System.Globalization;
3+
using System.ComponentModel.Composition.Hosting;
4+
using System.Linq;
85
using System.Reactive.Linq;
6+
using System.Windows;
97
using System.Windows.Input;
108
using GitHub.Factories;
11-
using GitHub.Models;
129
using GitHub.Primitives;
1310
using GitHub.ViewModels.TeamExplorer;
11+
using GitHub.VisualStudio;
1412
using Microsoft.TeamFoundation.Controls;
1513
using Microsoft.VisualStudio.ComponentModelHost;
16-
using GitHub.VisualStudio;
17-
using GitHub.VisualStudio.UI;
18-
using Microsoft.VisualStudio.Threading;
1914
using ReactiveUI;
20-
using Task = System.Threading.Tasks.Task;
21-
using Microsoft.VisualStudio.Shell;
22-
using System.ComponentModel.Composition.Hosting;
23-
using System.Windows;
2415

2516
namespace Microsoft.TeamExplorerSample.Sync
2617
{
@@ -88,21 +79,18 @@ public override void Initialize(object sender, SectionInitializeEventArgs e)
8879

8980
void ShowPublishDialog()
9081
{
91-
var exportProvide = GetExportProvider();
82+
var exportProvider = GetExportProvider();
9283

93-
var factory = exportProvide.GetExportedValue<IViewViewModelFactory>();
94-
var viewModel = exportProvide.GetExportedValue<IRepositoryPublishViewModel>();
84+
var factory = exportProvider.GetExportedValue<IViewViewModelFactory>();
85+
var viewModel = exportProvider.GetExportedValue<IRepositoryPublishViewModel>();
9586

9687
var busy = viewModel.WhenAnyValue(x => x.IsBusy).Subscribe(x => IsBusy = x);
97-
9888
var completed = viewModel.PublishRepository
9989
.Where(x => x == ProgressState.Success)
10090
.Subscribe(_ =>
10191
{
10292
var teamExplorer = ServiceProvider.GetService(typeof(ITeamExplorer)) as ITeamExplorer;
10393
teamExplorer?.NavigateToPage(new Guid(TeamExplorerPageIds.Home), null);
104-
105-
// HandleCreatedRepo(ActiveRepo);
10694
});
10795

10896
var view = factory.CreateView<IRepositoryPublishViewModel>();
@@ -130,48 +118,6 @@ ExportProvider GetExportProvider()
130118
return compositionContainer;
131119
}
132120

133-
void HandleCreatedRepo(LocalRepositoryModel newrepo)
134-
{
135-
var msg = String.Format(CultureInfo.CurrentCulture, Constants.Notification_RepoCreated, newrepo.Name, newrepo.CloneUrl);
136-
msg += " " + String.Format(CultureInfo.CurrentCulture, Constants.Notification_CreateNewProject, newrepo.LocalPath);
137-
ShowNotification(newrepo, msg);
138-
}
139-
140-
private void ShowNotification(LocalRepositoryModel newrepo, string msg)
141-
{
142-
// var teServices = ServiceProvider.TryGetService<ITeamExplorerServices>();
143-
//
144-
// teServices.ClearNotifications();
145-
// teServices.ShowMessage(
146-
// msg,
147-
// new RelayCommand(o =>
148-
// {
149-
// var str = o.ToString();
150-
// /* the prefix is the action to perform:
151-
// * u: launch browser with url
152-
// * c: launch create new project dialog
153-
// * o: launch open existing project dialog
154-
// */
155-
// var prefix = str.Substring(0, 2);
156-
// if (prefix == "u:")
157-
// OpenInBrowser(ServiceProvider.TryGetService<IVisualStudioBrowser>(), new Uri(str.Substring(2)));
158-
// else if (prefix == "o:")
159-
// {
160-
// if (ErrorHandler.Succeeded(ServiceProvider.GetSolution().OpenSolutionViaDlg(str.Substring(2), 1)))
161-
// ServiceProvider.TryGetService<ITeamExplorer>()?.NavigateToPage(new Guid(TeamExplorerPageIds.Home), null);
162-
// }
163-
// else if (prefix == "c:")
164-
// {
165-
// var vsGitServices = ServiceProvider.TryGetService<IVSGitServices>();
166-
// vsGitServices.SetDefaultProjectPath(newrepo.LocalPath);
167-
// if (ErrorHandler.Succeeded(ServiceProvider.GetSolution().CreateNewProjectViaDlg(null, null, 0)))
168-
// ServiceProvider.TryGetService<ITeamExplorer>()?.NavigateToPage(new Guid(TeamExplorerPageIds.Home), null);
169-
// }
170-
// })
171-
// );
172-
}
173-
174-
175121
void Section_PropertyChanged(object sender, PropertyChangedEventArgs e)
176122
{
177123
switch (e.PropertyName)

0 commit comments

Comments
 (0)