mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-14 03:33:48 +00:00
Added file type filtering to file selection dialogs (#442)
This commit is contained in:
1 parent
437ea2c243
commit
10dc03f33b
6 files changed
+83
-22
No files matched your search
@@ -0,0 +1,18 @@
|
||||
// ReSharper disable NotAccessedPositionalProperty.Global
|
||||
namespace AIStudio.Tools.Rust;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a file type filter for file selection dialogs.
|
||||
/// </summary>
|
||||
/// <param name="FilterName">The name of the filter.</param>
|
||||
/// <param name="FilterExtensions">The file extensions associated with the filter.</param>
|
||||
public readonly record struct FileTypeFilter(string FilterName, string[] FilterExtensions)
|
||||
{
|
||||
public static FileTypeFilter PDF => new("PDF Files", ["pdf"]);
|
||||
|
||||
public static FileTypeFilter Text => new("Text Files", ["txt", "md"]);
|
||||
|
||||
public static FileTypeFilter AllOffice => new("All Office Files", ["docx", "xlsx", "pptx", "doc", "xls", "ppt", "pdf"]);
|
||||
|
||||
public static FileTypeFilter AllImages => new("All Image Files", ["jpg", "jpeg", "png", "gif", "bmp", "tiff"]);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace AIStudio.Tools.Rust;
|
||||
|
||||
public sealed class SelectFileOptions
|
||||
{
|
||||
public required string Title { get; init; }
|
||||
|
||||
public PreviousFile? PreviousFile { get; init; }
|
||||
|
||||
public FileTypeFilter? Filter { get; init; }
|
||||
}
|
||||
Reference in new issue
Block a user