20 using System.Collections.Generic;
23 using System.Windows.Forms;
33 #region Public properties 47 public string Filter {
get;
set; }
51 #region Abstract methods 53 protected abstract FileDialog GetDialog(
65 FileDialog dlg = GetDialog(defaultString, filter);
66 dlg.Title = this.Caption;
67 if (String.IsNullOrEmpty(dlg.Filter))
69 if (!String.IsNullOrEmpty(Filter))
75 dlg.Filter = _messageContent.Filter;
78 if (dlg.ShowDialog(
new Win32Window()) == DialogResult.OK)
88 protected override void Invoke(
object parameter)
93 throw new ArgumentException(
94 "Expected Message with FileNameMessageContent, not " +
95 parameter.GetType().ToString());
97 _messageContent = args.Content;
98 string result = GetDialogResult(args.Content.Value, args.Content.Filter);
99 args.Content.Confirmed = !
string.IsNullOrEmpty(result);
100 if (args.Content.Confirmed)
102 args.Content.Value = result;
109 #region Private fields Provides access to the window handle of a WPF window or a Form or a custom handle.
Abstract base class for the ChooseFileSaveAction and ChooseFolderAction classes.
Base class for actions that use dialogs based on System.Windows.Forms.FileDialog. ...
override string GetDialogResult(string defaultString, string filter)
Displays an dialog to choose file or folder names.