SaveFileDialog doesn't behave properly. It was relying on a selection to be made in the FileView widget and was also not setting the name properly for Save mode. The attached diff fixes these issues.

Emery

Here's the diff:

Index: mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
===================================================================
--- mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs  (revision 59817)
+++ mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs  (working copy)
@@ -734,7 +734,7 @@

                void OnClickOpenSaveButton (object sender, EventArgs e)
                {
-                       if (mwfFileView.SelectedItems [0] != null) {
+                       if (fileDialogType == FileDialogType.OpenFileDialog && mwfFileView.SelectedItems [0] != null) {
                                string path = Path.Combine (currentDirectoryName, mwfFileView.SelectedItems [0].Text);
                                if (Directory.Exists (path)) {
                                        ChangeDirectory (null, path);
@@ -752,7 +752,7 @@
                                                        fileFromComboBox = Path.Combine (currentDirectoryName, fileFromComboBox);

                                                FileInfo fileInfo = new FileInfo (fileFromComboBox);
-                                               if (fileInfo.Exists)
+                                               if (fileInfo.Exists || fileDialogType == FileDialogType.SaveFileDialog)
                                                        currentFileName = fileFromComboBox;
                                                else {
                                                        DirectoryInfo dirInfo = new DirectoryInfo (fileFromComboBox);


--
Emery Conrad
Department of Mathematics
Virginia Tech
5076 Derring Hall
Blacksburg, VA 24061-0406
(540) 231-3324
_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to