Files
RobustToolbox/Robust.Client/UserInterface/IFileDialogManager.cs
T
AcruidandGitHub 2183cd7ca1 Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
2021-02-10 23:27:19 -08:00

33 lines
1.1 KiB
C#

using System.IO;
using System.Threading.Tasks;
namespace Robust.Client.UserInterface
{
/// <summary>
/// Manager for opening of file dialogs.
/// </summary>
/// <remarks>
/// File dialogs are native to the OS being ran on.
/// All operations are asynchronous to prevent locking up the main thread while the user makes his pick.
/// </remarks>
public interface IFileDialogManager
{
/// <summary>
/// Open a file dialog used for opening a single file.
/// </summary>
/// <returns>
/// The file stream for the file the user opened.
/// <see langword="null" /> if the user cancelled the action.
/// </returns>
Task<Stream?> OpenFile(FileDialogFilters? filters = null);
/// <summary>
/// Open a file dialog used for saving a single file.
/// </summary>
/// <returns>
/// The file stream the user chose to save to, and whether the file already existed.
/// Null if the user cancelled the action.
/// </returns>
Task<(Stream fileStream, bool alreadyExisted)?> SaveFile();
}
}