Skip to content

Commit 28b5fe6

Browse files
gave92Marco Gavelli
authored andcommitted
Place classes in project structure
1 parent 2c3243d commit 28b5fe6

File tree

8 files changed

+634
-634
lines changed

8 files changed

+634
-634
lines changed

src/Files.App/Extensions/StringExtensions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ public static string WithEnding(this string str, string ending)
5555
return result;
5656
}
5757

58+
/// <summary>
59+
/// Compares two strings for equality, but assumes that null string is equal to an empty string.
60+
/// </summary>
61+
public static bool NullableEqualTo(this string original, string other,
62+
StringComparison stringComparison = StringComparison.Ordinal) => string.IsNullOrEmpty(original)
63+
? string.IsNullOrEmpty(other)
64+
: original.Equals(other, stringComparison);
65+
5866
private static readonly ResourceMap resourcesTree = new ResourceManager().MainResourceMap.TryGetSubtree("Resources");
5967

6068
private static readonly ConcurrentDictionary<string, string> cachedResources = new();

src/Files.App/Terminal/WebView2Extensions.cs renamed to src/Files.App/Extensions/WebView2Extensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using System.Text;
1010
using Windows.Foundation;
1111

12-
namespace Files.App.UserControls
12+
namespace Files.App.Extensions
1313
{
1414
/// <summary>
1515
/// Code modified from https://gist.github.com/mqudsi/ceb4ecee76eb4c32238a438664783480
@@ -146,7 +146,7 @@ public static async Task AddWebAllowedObject<T>(this WebView2 webview, string na
146146
var awaiter = resultType.GetMethod(nameof(Task.GetAwaiter));
147147
if (awaiter is object)
148148
{
149-
task = (dynamic)result;
149+
task = result;
150150
}
151151
}
152152
if (task is object)

0 commit comments

Comments
 (0)