Files
RobustToolbox/Robust.Client/UserInterface/DummyFileDialogManager.cs
T
PJB3005 4e7de2f272 File dialog fixes and improvements
File dialog requests can now specify the share and access mode they want out of the opened file. This means read-only access is now possible.

While doing this I noticed that the SDL3 backend had a memory leak *and* didn't match the behavior of the other backends. Cleaned up the code to avoid that.

In-engine commands that *can* specify read-only access on file open now do.
2025-05-24 16:38:01 +02:00

29 lines
877 B
C#

using System.IO;
using System.Threading.Tasks;
namespace Robust.Client.UserInterface
{
/// <summary>
/// Treats ever file dialog operation as cancelled.
/// </summary>
internal sealed class DummyFileDialogManager : IFileDialogManager
{
public Task<Stream?> OpenFile(
FileDialogFilters? filters = null,
FileAccess access = FileAccess.ReadWrite,
FileShare? share = null)
{
return Task.FromResult<Stream?>(null);
}
public Task<(Stream fileStream, bool alreadyExisted)?> SaveFile(
FileDialogFilters? filters = null,
bool truncate = true,
FileAccess access = FileAccess.ReadWrite,
FileShare share = FileShare.None)
{
return Task.FromResult<(Stream fileStream, bool alreadyExisted)?>(null);
}
}
}