This commit is contained in:
Glorou 2026-02-09 10:38:14 -05:00
parent 78912c1552
commit 332d0d0cf5
2 changed files with 4 additions and 4 deletions

View file

@ -648,7 +648,6 @@ public partial class FileDialog
private void AddFileNameInSelection(string name, bool setLastSelection)
{
this.selectedFileNames.Add(name);
this.SelectionChanged(this, this.GetFilePathName());
if (this.selectedFileNames.Count == 1)
{
this.fileNameBuffer = name;
@ -657,7 +656,7 @@ public partial class FileDialog
{
this.fileNameBuffer = $"{this.selectedFileNames.Count} files Selected";
}
this.SelectionChanged(this, this.GetFilePathName());
if (setLastSelection)
{
this.lastSelectedFileName = name;

View file

@ -27,12 +27,13 @@ public class FileDialogManager
#pragma warning restore SA1401
#pragma warning restore SA1201
public event EventHandler<string>? SelectionChanged;
private FileDialog? dialog;
private Action<bool, string>? callback;
private Action<bool, List<string>>? multiCallback;
private string savedPath = ".";
public event EventHandler<string>? SelectionChanged;
/// <summary>
/// Create a dialog which selects an already existing folder.
@ -184,7 +185,7 @@ public class FileDialogManager
return this.dialog?.GetCurrentPath();
}
private void OnSelectionChange(object sender, string path) => this.SelectionChanged(sender, path);
private void OnSelectionChange(object sender, string path) => this.SelectionChanged?.Invoke(sender, path);
private void SetDialog(
string id,