Skip to content

Commit 915522f

Browse files
committed
Remove Async suffix
1 parent 63132ce commit 915522f

File tree

6 files changed

+60
-60
lines changed

6 files changed

+60
-60
lines changed

AssetRipper.NativeDialogs.Example/Program.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static async Task Main(string[] args)
1414
{
1515
if (arguments.AllowMultiple)
1616
{
17-
string[]? files = await OpenFileDialog.OpenFilesAsync();
17+
string[]? files = await OpenFileDialog.OpenFiles();
1818
if (files is null || files.Length == 0)
1919
{
2020
Console.WriteLine("No files selected.");
@@ -29,15 +29,15 @@ static async Task Main(string[] args)
2929
}
3030
else
3131
{
32-
string? file = await OpenFileDialog.OpenFileAsync();
32+
string? file = await OpenFileDialog.OpenFile();
3333
Print(file);
3434
}
3535
}
3636
else if (arguments.OpenFolder)
3737
{
3838
if (arguments.AllowMultiple)
3939
{
40-
string[]? folders = await OpenFolderDialog.OpenFoldersAsync();
40+
string[]? folders = await OpenFolderDialog.OpenFolders();
4141
if (folders is null || folders.Length == 0)
4242
{
4343
Console.WriteLine("No folders selected.");
@@ -52,18 +52,18 @@ static async Task Main(string[] args)
5252
}
5353
else
5454
{
55-
string? folder = await OpenFolderDialog.OpenFolderAsync();
55+
string? folder = await OpenFolderDialog.OpenFolder();
5656
Print(folder);
5757
}
5858
}
5959
else if (arguments.SaveFile)
6060
{
61-
string? file = await SaveFileDialog.SaveFileAsync();
61+
string? file = await SaveFileDialog.SaveFile();
6262
Print(file);
6363
}
6464
else if (arguments.Confirmation)
6565
{
66-
bool? result = await ConfirmationDialog.ConfirmAsync("Are you sure you want to proceed?", "Yes", "No");
66+
bool? result = await ConfirmationDialog.Confirm("Are you sure you want to proceed?", "Yes", "No");
6767
switch (result)
6868
{
6969
case true:
@@ -79,7 +79,7 @@ static async Task Main(string[] args)
7979
}
8080
else if (arguments.Message)
8181
{
82-
await MessageDialog.MessageAsync("This is a message dialog.", "OK");
82+
await MessageDialog.Message("This is a message dialog.", "OK");
8383
Console.WriteLine("Message dialog displayed.");
8484
}
8585
else

AssetRipper.NativeDialogs/ConfirmationDialog.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ public static class ConfirmationDialog
99
OperatingSystem.IsMacOS() ||
1010
(OperatingSystem.IsLinux() && Gtk.Global.IsSupported);
1111

12-
public static Task<bool?> ConfirmAsync(string message, string trueLabel, string falseLabel)
12+
public static Task<bool?> Confirm(string message, string trueLabel, string falseLabel)
1313
{
1414
if (OperatingSystem.IsWindows())
1515
{
16-
return ConfirmAsyncWindows();
16+
return ConfirmWindows();
1717
}
1818
else if (OperatingSystem.IsMacOS())
1919
{
20-
return ConfirmAsyncMacOS();
20+
return ConfirmMacOS();
2121
}
2222
else if (OperatingSystem.IsLinux())
2323
{
24-
return ConfirmAsyncLinux();
24+
return ConfirmLinux();
2525
}
2626
else
2727
{
@@ -30,19 +30,19 @@ public static class ConfirmationDialog
3030
}
3131

3232
[SupportedOSPlatform("windows")]
33-
private unsafe static Task<bool?> ConfirmAsyncWindows()
33+
private unsafe static Task<bool?> ConfirmWindows()
3434
{
3535
return Task.FromResult<bool?>(null);
3636
}
3737

3838
[SupportedOSPlatform("macos")]
39-
private static Task<bool?> ConfirmAsyncMacOS()
39+
private static Task<bool?> ConfirmMacOS()
4040
{
4141
return Task.FromResult<bool?>(null);
4242
}
4343

4444
[SupportedOSPlatform("linux")]
45-
private static Task<bool?> ConfirmAsyncLinux()
45+
private static Task<bool?> ConfirmLinux()
4646
{
4747
if (Gtk.Global.IsSupported)
4848
{

AssetRipper.NativeDialogs/MessageDialog.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ public static class MessageDialog
99
OperatingSystem.IsMacOS() ||
1010
(OperatingSystem.IsLinux() && Gtk.Global.IsSupported);
1111

12-
public static Task MessageAsync(string message, string label)
12+
public static Task Message(string message, string label)
1313
{
1414
if (OperatingSystem.IsWindows())
1515
{
16-
return MessageAsyncWindows();
16+
return MessageWindows();
1717
}
1818
else if (OperatingSystem.IsMacOS())
1919
{
20-
return MessageAsyncMacOS();
20+
return MessageMacOS();
2121
}
2222
else if (OperatingSystem.IsLinux())
2323
{
24-
return MessageAsyncLinux();
24+
return MessageLinux();
2525
}
2626
else
2727
{
@@ -30,19 +30,19 @@ public static Task MessageAsync(string message, string label)
3030
}
3131

3232
[SupportedOSPlatform("windows")]
33-
private unsafe static Task MessageAsyncWindows()
33+
private unsafe static Task MessageWindows()
3434
{
3535
return Task.CompletedTask;
3636
}
3737

3838
[SupportedOSPlatform("macos")]
39-
private static Task MessageAsyncMacOS()
39+
private static Task MessageMacOS()
4040
{
4141
return Task.CompletedTask;
4242
}
4343

4444
[SupportedOSPlatform("linux")]
45-
private static Task MessageAsyncLinux()
45+
private static Task MessageLinux()
4646
{
4747
if (Gtk.Global.IsSupported)
4848
{

AssetRipper.NativeDialogs/OpenFileDialog.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ public static class OpenFileDialog
1212
OperatingSystem.IsMacOS() ||
1313
(OperatingSystem.IsLinux() && Gtk.Global.IsSupported);
1414

15-
public static Task<string?> OpenFileAsync()
15+
public static Task<string?> OpenFile()
1616
{
1717
if (OperatingSystem.IsWindows())
1818
{
19-
return OpenFileAsyncWindows();
19+
return OpenFileWindows();
2020
}
2121
else if (OperatingSystem.IsMacOS())
2222
{
23-
return OpenFileAsyncMacOS();
23+
return OpenFileMacOS();
2424
}
2525
else if (OperatingSystem.IsLinux())
2626
{
27-
return OpenFileAsyncLinux();
27+
return OpenFileLinux();
2828
}
2929
else
3030
{
@@ -33,7 +33,7 @@ public static class OpenFileDialog
3333
}
3434

3535
[SupportedOSPlatform("windows")]
36-
private unsafe static Task<string?> OpenFileAsyncWindows()
36+
private unsafe static Task<string?> OpenFileWindows()
3737
{
3838
// https://learn.microsoft.com/en-us/windows/win32/api/commdlg/ns-commdlg-openfilenamew
3939

@@ -70,13 +70,13 @@ public static class OpenFileDialog
7070
}
7171

7272
[SupportedOSPlatform("macos")]
73-
private static Task<string?> OpenFileAsyncMacOS()
73+
private static Task<string?> OpenFileMacOS()
7474
{
7575
return ProcessExecutor.TryRun("osascript", "-e", "POSIX path of (choose file)");
7676
}
7777

7878
[SupportedOSPlatform("linux")]
79-
private static Task<string?> OpenFileAsyncLinux()
79+
private static Task<string?> OpenFileLinux()
8080
{
8181
if (Gtk.Global.IsSupported)
8282
{
@@ -111,19 +111,19 @@ public static class OpenFileDialog
111111
}
112112
}
113113

114-
public static Task<string[]?> OpenFilesAsync()
114+
public static Task<string[]?> OpenFiles()
115115
{
116116
if (OperatingSystem.IsWindows())
117117
{
118-
return OpenFilesAsyncWindows();
118+
return OpenFilesWindows();
119119
}
120120
else if (OperatingSystem.IsMacOS())
121121
{
122-
return OpenFilesAsyncMacOS();
122+
return OpenFilesMacOS();
123123
}
124124
else if (OperatingSystem.IsLinux())
125125
{
126-
return OpenFilesAsyncLinux();
126+
return OpenFilesLinux();
127127
}
128128
else
129129
{
@@ -132,7 +132,7 @@ public static class OpenFileDialog
132132
}
133133

134134
[SupportedOSPlatform("windows")]
135-
private unsafe static Task<string[]?> OpenFilesAsyncWindows()
135+
private unsafe static Task<string[]?> OpenFilesWindows()
136136
{
137137
// https://learn.microsoft.com/en-us/windows/win32/api/commdlg/ns-commdlg-openfilenamew
138138

@@ -186,7 +186,7 @@ public static class OpenFileDialog
186186
}
187187

188188
[SupportedOSPlatform("macos")]
189-
private static async Task<string[]?> OpenFilesAsyncMacOS()
189+
private static async Task<string[]?> OpenFilesMacOS()
190190
{
191191
ReadOnlySpan<string> arguments =
192192
[
@@ -207,10 +207,10 @@ public static class OpenFileDialog
207207
}
208208

209209
[SupportedOSPlatform("linux")]
210-
private static async Task<string[]?> OpenFilesAsyncLinux()
210+
private static async Task<string[]?> OpenFilesLinux()
211211
{
212212
// Todo: proper Linux implementation
213-
string? path = await OpenFileAsync();
213+
string? path = await OpenFile();
214214
if (string.IsNullOrEmpty(path))
215215
{
216216
return null; // User canceled the dialog

AssetRipper.NativeDialogs/OpenFolderDialog.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ public static class OpenFolderDialog
99
OperatingSystem.IsMacOS() ||
1010
(OperatingSystem.IsLinux() && Gtk.Global.IsSupported);
1111

12-
public static Task<string?> OpenFolderAsync()
12+
public static Task<string?> OpenFolder()
1313
{
1414
if (OperatingSystem.IsWindows())
1515
{
16-
return OpenFolderAsyncWindows();
16+
return OpenFolderWindows();
1717
}
1818
else if (OperatingSystem.IsMacOS())
1919
{
20-
return OpenFolderAsyncMacOS();
20+
return OpenFolderMacOS();
2121
}
2222
else if (OperatingSystem.IsLinux())
2323
{
24-
return OpenFolderAsyncLinux();
24+
return OpenFolderLinux();
2525
}
2626
else
2727
{
@@ -30,36 +30,36 @@ public static class OpenFolderDialog
3030
}
3131

3232
[SupportedOSPlatform("windows")]
33-
private unsafe static Task<string?> OpenFolderAsyncWindows()
33+
private unsafe static Task<string?> OpenFolderWindows()
3434
{
3535
return Task.FromResult<string?>(null);
3636
}
3737

3838
[SupportedOSPlatform("macos")]
39-
private static Task<string?> OpenFolderAsyncMacOS()
39+
private static Task<string?> OpenFolderMacOS()
4040
{
4141
return ProcessExecutor.TryRun("osascript", "-e", "POSIX path of (choose folder)");
4242
}
4343

4444
[SupportedOSPlatform("linux")]
45-
private static Task<string?> OpenFolderAsyncLinux()
45+
private static Task<string?> OpenFolderLinux()
4646
{
4747
return Task.FromResult<string?>(null);
4848
}
4949

50-
public static Task<string[]?> OpenFoldersAsync()
50+
public static Task<string[]?> OpenFolders()
5151
{
5252
if (OperatingSystem.IsWindows())
5353
{
54-
return OpenFoldersAsyncWindows();
54+
return OpenFoldersWindows();
5555
}
5656
else if (OperatingSystem.IsMacOS())
5757
{
58-
return OpenFoldersAsyncMacOS();
58+
return OpenFoldersMacOS();
5959
}
6060
else if (OperatingSystem.IsLinux())
6161
{
62-
return OpenFoldersAsyncLinux();
62+
return OpenFoldersLinux();
6363
}
6464
else
6565
{
@@ -68,10 +68,10 @@ public static class OpenFolderDialog
6868
}
6969

7070
[SupportedOSPlatform("windows")]
71-
private static async Task<string[]?> OpenFoldersAsyncWindows()
71+
private static async Task<string[]?> OpenFoldersWindows()
7272
{
7373
// Todo: proper Windows implementation
74-
string? path = await OpenFolderAsync();
74+
string? path = await OpenFolder();
7575
if (string.IsNullOrEmpty(path))
7676
{
7777
return null; // User canceled the dialog
@@ -80,10 +80,10 @@ public static class OpenFolderDialog
8080
}
8181

8282
[SupportedOSPlatform("macos")]
83-
private static async Task<string[]?> OpenFoldersAsyncMacOS()
83+
private static async Task<string[]?> OpenFoldersMacOS()
8484
{
8585
// Todo: proper Mac implementation
86-
string? path = await OpenFolderAsync();
86+
string? path = await OpenFolder();
8787
if (string.IsNullOrEmpty(path))
8888
{
8989
return null; // User canceled the dialog
@@ -92,10 +92,10 @@ public static class OpenFolderDialog
9292
}
9393

9494
[SupportedOSPlatform("linux")]
95-
private static async Task<string[]?> OpenFoldersAsyncLinux()
95+
private static async Task<string[]?> OpenFoldersLinux()
9696
{
9797
// Todo: proper Linux implementation
98-
string? path = await OpenFolderAsync();
98+
string? path = await OpenFolder();
9999
if (string.IsNullOrEmpty(path))
100100
{
101101
return null; // User canceled the dialog

0 commit comments

Comments
 (0)