Skip to content

Commit 1f07a09

Browse files
authored
Merge pull request #239 from ptr727/develop
Develop
2 parents 34cda89 + 0cab30e commit 1f07a09

26 files changed

+34
-31
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ root = true
1515

1616
# Defaults
1717
[*]
18-
charset = utf-8-bom
18+
charset = utf-8
1919
end_of_line = crlf
2020
indent_size = 4
2121
indent_style = space

Sandbox/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Diagnostics;
1+
using System.Diagnostics;
22
using System.IO;
33
using System.Reflection;
44
using InsaneGenius.Utilities;

Utilities/CommandLineEx.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22

33
namespace InsaneGenius.Utilities;
44

Utilities/ConsoleEx.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Globalization;
33
using System.Threading;
44

Utilities/Download.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.IO;
33
using System.Net.Http;
44
using System.Net.Http.Headers;
@@ -15,8 +15,11 @@ public static bool GetContentInfo(Uri uri, out long size, out DateTime modifiedT
1515
try
1616
{
1717
// Send GET to URL
18-
using HttpResponseMessage httpResponse = GetHttpClient().GetAsync(uri).Result;
19-
_ = httpResponse.EnsureSuccessStatusCode();
18+
using HttpResponseMessage httpResponse = GetHttpClient()
19+
.GetAsync(uri)
20+
.GetAwaiter()
21+
.GetResult()
22+
.EnsureSuccessStatusCode();
2023

2124
// Get response
2225
size = (long)httpResponse.Content.Headers.ContentLength;
@@ -36,7 +39,7 @@ public static bool DownloadFile(Uri uri, string fileName)
3639
try
3740
{
3841
// Get HTTP stream
39-
Stream httpStream = GetHttpClient().GetStreamAsync(uri).Result;
42+
Stream httpStream = GetHttpClient().GetStreamAsync(uri).GetAwaiter().GetResult();
4043

4144
// Get file stream
4245
using FileStream fileStream = File.OpenWrite(fileName);
@@ -58,7 +61,7 @@ public static bool DownloadString(Uri uri, out string value)
5861
value = null;
5962
try
6063
{
61-
value = GetHttpClient().GetStringAsync(uri).Result;
64+
value = GetHttpClient().GetStringAsync(uri).GetAwaiter().GetResult();
6265
}
6366
catch (Exception e)
6467
when (LogOptions.Logger.LogAndHandle(e, MethodBase.GetCurrentMethod()?.Name))

Utilities/Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using Serilog;
33

44
namespace InsaneGenius.Utilities;

Utilities/FileEx.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Linq;

Utilities/FileExOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Threading;
1+
using System.Threading;
22

33
namespace InsaneGenius.Utilities;
44

Utilities/Format.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22

33
namespace InsaneGenius.Utilities;
44

Utilities/Iso6392.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics;
44
using System.IO;

0 commit comments

Comments
 (0)