| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="FileDialogResult.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System.Collections.Generic; |
| | | 8 | | |
| | | 9 | | namespace MyNet.UI.Dialogs.FileDialogs; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Represents the result of a file dialog operation, including whether the operation was canceled and the list of selec |
| | | 13 | | /// </summary> |
| | | 14 | | public sealed class FileDialogResult |
| | | 15 | | { |
| | | 16 | | /// <summary> |
| | | 17 | | /// Gets a value indicating whether the file dialog operation was canceled by the user. If true, no files were selec |
| | | 18 | | /// </summary> |
| | | 19 | | public bool IsCancelled { get; init; } |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// Gets the list of file paths selected by the user in the file dialog. This list is empty if the operation was can |
| | | 23 | | /// </summary> |
| | | 24 | | public IReadOnlyList<string> Files { get; init; } = []; |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Gets the first file path from the list of selected files, or null if no files were selected. This is a convenien |
| | | 28 | | /// </summary> |
| | 6 | 29 | | public string? Filename => Files.Count > 0 ? Files[0] : null; |
| | | 30 | | } |
| | | 31 | | |