Skip to content

Commit

Permalink
Cleanup compilation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Scepheo committed Jun 5, 2019
1 parent 9bdaf25 commit 5bfc23c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 30 deletions.
14 changes: 5 additions & 9 deletions src/GitMan/Clients/AzureClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,11 @@ private JsonDocument GetResponse(string path)
{
var uri = BuildUri(path);

using (var client = GetClient())
{
using (var response = client.GetAsync(uri).Result)
{
var json = response.Content.ReadAsStringAsync().Result;
var document = JsonDocument.Parse(json);
return document;
}
}
using var client = GetClient();
using var response = client.GetAsync(uri).Result;
var json = response.Content.ReadAsStringAsync().Result;
var document = JsonDocument.Parse(json);
return document;
}

public RemoteRepository[] GetRepositories()
Expand Down
14 changes: 5 additions & 9 deletions src/GitMan/Clients/GitHubClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,11 @@ private JsonDocument GetResponse(string path)
{
var uri = BuildUri(path);

using (var client = GetClient())
{
using (var response = client.GetAsync(uri).Result)
{
var json = response.Content.ReadAsStringAsync().Result;
var document = JsonDocument.Parse(json);
return document;
}
}
using var client = GetClient();
using var response = client.GetAsync(uri).Result;
var json = response.Content.ReadAsStringAsync().Result;
var document = JsonDocument.Parse(json);
return document;
}

public RemoteRepository[] GetRepositories()
Expand Down
18 changes: 6 additions & 12 deletions src/GitMan/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class Context : ApplicationContext
private readonly Settings _settings;
private readonly RepositoryAction[] _repositoryActions;

private static void EmptyHandler(object sender, EventArgs eventArgs) { }

public Context()
{
_icon = new NotifyIcon();
Expand Down Expand Up @@ -145,8 +147,6 @@ private MenuItem MakeAzureProviderItem(
var mergeOrder = 0;
var shortcut = Shortcut.None;

void onClick(object sender, EventArgs eventArgs) { }

void onPopup(object sender, EventArgs eventArgs)
{
var originalCursor = Cursor.Current;
Expand Down Expand Up @@ -175,16 +175,14 @@ void onPopup(object sender, EventArgs eventArgs)
Cursor.Current = originalCursor;
}

void onSelect(object sender, EventArgs eventArgs) { }

menuItem = new MenuItem(
mergeType,
mergeOrder,
shortcut,
name,
onClick,
EmptyHandler,
onPopup,
onSelect,
EmptyHandler,
dummyItems);

return menuItem;
Expand All @@ -204,8 +202,6 @@ private MenuItem MakeGitHubProviderItem(
var mergeOrder = 0;
var shortcut = Shortcut.None;

void onClick(object sender, EventArgs eventArgs) { }

void onPopup(object sender, EventArgs eventArgs)
{
var originalCursor = Cursor.Current;
Expand Down Expand Up @@ -233,16 +229,14 @@ void onPopup(object sender, EventArgs eventArgs)
Cursor.Current = originalCursor;
}

void onSelect(object sender, EventArgs eventArgs) { }

menuItem = new MenuItem(
mergeType,
mergeOrder,
shortcut,
name,
onClick,
EmptyHandler,
onPopup,
onSelect,
EmptyHandler,
dummyItems);

return menuItem;
Expand Down

0 comments on commit 5bfc23c

Please sign in to comment.