Skip to content

Commit

Permalink
[NotNull] constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
iconstudio committed Oct 6, 2023
1 parent 7162bd6 commit 5efdaac
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Editor/TestEditor/Utilities/FilePickHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@
using Windows.Win32.Foundation;

using TestEditor.Editor;
using System.Diagnostics.CodeAnalysis;

namespace TestEditor.Utility
{
public static class FilePickHelper
{
internal static
IAsyncOperation<StorageFile>
OpenLoadPicker(Window window, IEnumerable<string> extentions)
OpenLoadPicker(Window window, [NotNull] IEnumerable<string> extentions)
{
var handle = WinRT.Interop.WindowNative.GetWindowHandle(window);

return OpenLoadPicker((HWND) handle, extentions);
}
internal static
IAsyncOperation<StorageFile>
OpenLoadPicker(Window window, params string[] extentions)
OpenLoadPicker(Window window, [NotNull] params string[] extentions)
{
var handle = WinRT.Interop.WindowNative.GetWindowHandle(window);

return OpenLoadPicker((HWND) handle, extentions);
}
internal static
IAsyncOperation<StorageFile>
OpenLoadPicker(HWND hwnd, IEnumerable<string> extentions)
OpenLoadPicker(HWND hwnd, [NotNull] IEnumerable<string> extentions)
{
FileOpenPicker picker = new()
{
Expand All @@ -46,7 +47,7 @@ internal static
}
internal static
IAsyncOperation<StorageFile>
OpenLoadPicker(HWND hwnd, params string[] extentions)
OpenLoadPicker(HWND hwnd, [NotNull] params string[] extentions)
{
FileOpenPicker picker = new()
{
Expand All @@ -65,15 +66,15 @@ internal static
}
internal static
IAsyncOperation<StorageFile>
OpenSavePicker(Window window, params KeyValuePair<string, IList<string>>[] extentions)
OpenSavePicker(Window window, [NotNull] params KeyValuePair<string, IList<string>>[] extentions)
{
var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(window);

return OpenSavePicker((HWND) hwnd, extentions);
}
internal static
IAsyncOperation<StorageFile>
OpenSavePicker(HWND hwnd, params KeyValuePair<string, IList<string>>[] extentions)
OpenSavePicker(HWND hwnd, [NotNull] params KeyValuePair<string, IList<string>>[] extentions)
{
FileSavePicker picker = new();
picker.FileTypeChoices.Clear();
Expand All @@ -88,15 +89,15 @@ internal static
}
internal static
IAsyncOperation<StorageFile>
OpenSavePicker(Window window, IEnumerable<KeyValuePair<string, IList<string>>> extentions)
OpenSavePicker(Window window, [NotNull] IEnumerable<KeyValuePair<string, IList<string>>> extentions)
{
var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(window);

return OpenSavePicker((HWND) hwnd, extentions);
}
internal static
IAsyncOperation<StorageFile>
OpenSavePicker(HWND hwnd, IEnumerable<KeyValuePair<string, IList<string>>> extentions)
OpenSavePicker(HWND hwnd, [NotNull] IEnumerable<KeyValuePair<string, IList<string>>> extentions)
{
FileSavePicker picker = new();
picker.FileTypeChoices.Clear();
Expand Down

0 comments on commit 5efdaac

Please sign in to comment.