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

Commit 17aebf8

Browse files
committed
Removed ConnectionManager.ConnectionCreated.
1 parent 6034643 commit 17aebf8

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

src/GitHub.Exports/Services/IConnectionManager.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@ public interface IConnectionManager
2222
/// </remarks>
2323
IReadOnlyObservableCollection<IConnection> Connections { get; }
2424

25-
/// <summary>
26-
/// Gets a callback that is called after a new <see cref="IConnection"/> is created but
27-
/// before it is added to <see cref="Connections"/>.
28-
/// </summary>
29-
/// <remarks>
30-
/// This is a hack and should be removed as soon as possible! It's needed because creating
31-
/// a RepositoryHost is async meaning that for a short time a connection can exist without
32-
/// a repository host, but other older parts of the code get confused by this. This callback
33-
/// allows RepositoryHosts to hook into the creation of the connection to make sure a host
34-
/// is available by the time the connection is made available.
35-
/// </remarks>
36-
Func<IConnection, Task> ConnectionCreated { get; set; }
37-
3825
/// <summary>
3926
/// Gets a connection with the specified host address.
4027
/// </summary>

src/GitHub.VisualStudio/Services/ConnectionManager.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ public ConnectionManager(
5252
/// <inheritdoc/>
5353
public IReadOnlyObservableCollection<IConnection> Connections => connections.Value;
5454

55-
public Func<IConnection, Task> ConnectionCreated { get; set; }
56-
5755
/// <inheritdoc/>
5856
public async Task<IConnection> GetConnection(HostAddress address)
5957
{
@@ -80,11 +78,6 @@ public async Task<IConnection> LogIn(HostAddress address, string userName, strin
8078
var user = await loginManager.Login(address, client, userName, password);
8179
var connection = new Connection(address, userName, user, null);
8280

83-
if (ConnectionCreated != null)
84-
{
85-
await ConnectionCreated(connection);
86-
}
87-
8881
conns.Add(connection);
8982
await SaveConnections();
9083
await usageTracker.IncrementLoginCount();
@@ -150,11 +143,6 @@ async Task LoadConnections(ObservableCollection<IConnection> result)
150143

151144
var connection = new Connection(c.HostAddress, c.UserName, user, error);
152145

153-
if (ConnectionCreated != null)
154-
{
155-
await ConnectionCreated(connection);
156-
}
157-
158146
result.Add(connection);
159147
await usageTracker.IncrementLoginCount();
160148
}

0 commit comments

Comments
 (0)