mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-06 17:58:05 +02:00
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.
29 lines
877 B
C#
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);
|
|
}
|
|
}
|
|
}
|