properly set FileSetting.Mode from CustomOptionFile.DialogMode

This commit is contained in:
Michael Becker 2020-12-04 23:34:32 -05:00
parent 9b4e7b7ba4
commit 779e884e97
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -84,8 +84,13 @@ namespace UniversalEditor.UserInterface
else if (eo is CustomOptionFile)
{
CustomOptionFile option = (eo as CustomOptionFile);
// sg.Settings.Add(new FileSetting(option.Title, option.DefaultValue));
sg.Settings.Add(new FileSetting(option.PropertyName, option.Title, (string)option.GetValue()));
FileSetting fs = new FileSetting(option.PropertyName, option.Title, (string)option.GetValue());
switch (option.DialogMode)
{
case CustomOptionFileDialogMode.Open: fs.Mode = FileDialogMode.Open; break;
case CustomOptionFileDialogMode.Save: fs.Mode = FileDialogMode.Save; break;
}
sg.Settings.Add(fs);
}
else if (eo is CustomOptionGroup)
{