diff options
author | Jeffrey Stedfast <jeff@xamarin.com> | 2015-11-18 01:27:33 +0300 |
---|---|---|
committer | Jeffrey Stedfast <jeff@xamarin.com> | 2015-11-18 01:27:33 +0300 |
commit | 70e242e33db5d64d51ce6b15ab460b9dc8107cb3 (patch) | |
tree | 7ddecbbb35eaca2c6dc15f5a70f16be3d8e3a096 /main/src/addins/WindowsPlatform | |
parent | 421656d1a776f1036be01a9ab11071c61516ec04 (diff) |
[core] Allow SelectFileDialog to select files & directories at the same time
Diffstat (limited to 'main/src/addins/WindowsPlatform')
3 files changed, 7 insertions, 7 deletions
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs index 75f333740b..c12413887f 100644 --- a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs +++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs @@ -55,7 +55,7 @@ namespace MonoDevelop.Platform var fileDialog = dialog as CommonOpenFileDialog;
if (fileDialog != null) {
fileDialog.Multiselect = data.SelectMultiple;
- if (data.Action == FileChooserAction.SelectFolder) {
+ if (data.Action == SelectFileDialogAction.SelectFolder) {
fileDialog.IsFolderPicker = true;
return;
}
@@ -86,7 +86,7 @@ namespace MonoDevelop.Platform return;
// FileDialog doesn't show the file extension when saving a file,
// so we try to look for the precise filter if none was specified.
- if (!string.IsNullOrEmpty (data.InitialFileName) && data.Action == FileChooserAction.Save && defExt == "*") {
+ if (!string.IsNullOrEmpty (data.InitialFileName) && data.Action == SelectFileDialogAction.Save && defExt == "*") {
string ext = Path.GetExtension (data.InitialFileName);
if (!string.IsNullOrEmpty (ext)) {
var pattern = "*" + ext;
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs index 51e84a743f..4d3f97a6ff 100644 --- a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs +++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs @@ -51,7 +51,7 @@ namespace MonoDevelop.Platform {
var parent = data.TransientFor ?? MessageService.RootWindow;
CommonFileDialog dialog;
- if (data.Action == FileChooserAction.Open) {
+ if (data.Action == SelectFileDialogAction.Open) {
dialog = new CustomCommonOpenFileDialog {
EnsureFileExists = true
};
@@ -65,7 +65,7 @@ namespace MonoDevelop.Platform var group = new CommonFileDialogGroupBox ("encoding", "Encoding:");
encodingCombo = new CustomCommonFileDialogComboBox ();
- BuildEncodingsCombo (encodingCombo, data.Action != FileChooserAction.Save, data.Encoding);
+ BuildEncodingsCombo (encodingCombo, data.Action != SelectFileDialogAction.Save, data.Encoding);
group.Items.Add (encodingCombo);
dialog.Controls.Add (group);
@@ -77,7 +77,7 @@ namespace MonoDevelop.Platform SizeToContent = SizeToContent.WidthAndHeight
};
if (dlg.ShowDialog ().Value) {
- BuildEncodingsCombo (encodingCombo, data.Action != FileChooserAction.Save, data.Encoding);
+ BuildEncodingsCombo (encodingCombo, data.Action != SelectFileDialogAction.Save, data.Encoding);
dialog.ApplyControlPropertyChange ("Items", encodingCombo);
}
}
@@ -86,7 +86,7 @@ namespace MonoDevelop.Platform CustomCommonFileDialogComboBox viewerCombo = null;
CommonFileDialogCheckBox closeSolution = null;
- if (data.ShowViewerSelector && data.Action == FileChooserAction.Open) {
+ if (data.ShowViewerSelector && data.Action == SelectFileDialogAction.Open) {
var group = new CommonFileDialogGroupBox ("openWith", "Open with:");
viewerCombo = new CustomCommonFileDialogComboBox {
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/SelectFileDialogHandler.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/SelectFileDialogHandler.cs index ec5123aded..bcd6b36049 100644 --- a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/SelectFileDialogHandler.cs +++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/SelectFileDialogHandler.cs @@ -44,7 +44,7 @@ namespace MonoDevelop.Platform var parent = data.TransientFor ?? MessageService.RootWindow;
CommonFileDialog dialog;
- if (data.Action == FileChooserAction.Open || data.Action == FileChooserAction.SelectFolder)
+ if ((data.Action & (SelectFileDialogAction.Open | SelectFileDialogAction.SelectFolder)) != 0)
dialog = new CustomCommonOpenFileDialog ();
else
dialog = new CommonSaveFileDialog ();
|