public string SaveFile(string title, string initialDirectory, string defaultFileName = null, DialogFilterPair filter = null, IntPtr?owner = null) { var builder = new CommonSaveDialogBuilder() .Initialize(title, initialDirectory) .SetDefaults(defaultFileName, filter.ExtensionsList) .AddFilter(filter); return(Save(builder, owner)); }
public string Save(CommonSaveDialogBuilder builder, IntPtr?owner = null) { string result = null; using (var dialog = builder.Dialog) { if (dialog.ShowDialog(GetOwnerHandle(owner)) == CommonFileDialogResult.Ok) { result = dialog.FileName; } } return(result); }
public string Save(CommonSaveDialogBuilder builder) { string result = null; using (var dialog = builder.Dialog) { if (dialog.ShowDialog() == CommonFileDialogResult.Ok) { result = dialog.FileName; } } return(result); }
public string SaveFile(string title, string initialDirectory, string defaultFileName, DialogFilterPair filter) { var builder = new CommonSaveDialogBuilder() .Initialize(title, initialDirectory) .SetDefaults(defaultFileName, filter.ExtensionsList) .AddFilter(filter); string result = null; using (var dialog = builder.Build()) { if (dialog.ShowDialog() == CommonFileDialogResult.Ok) { result = dialog.FileName; } } return(result); }