Author: jackson
Date: 2007-02-16 15:33:51 -0500 (Fri, 16 Feb 2007)
New Revision: 73044

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
Log:

        * FileDialog.cs: After changing the name of the folder, we have
        * to
        make sure that it is created, or that we pop up an error because
        it already exists.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-02-16 20:32:08 UTC (rev 73043)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-02-16 20:33:51 UTC (rev 73044)
@@ -1,6 +1,9 @@
 2007-02-16  Jackson Harper  <[EMAIL PROTECTED]>
 
        * ListView.cs: Make AfterLabelEdit work correctly.
+       * FileDialog.cs: After changing the name of the folder, we have to
+       make sure that it is created, or that we pop up an error because
+       it already exists.
 
 2007-02-16  Jackson Harper  <[EMAIL PROTECTED]>
 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs    
2007-02-16 20:32:08 UTC (rev 73043)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs    
2007-02-16 20:33:51 UTC (rev 73044)
@@ -2569,7 +2569,30 @@
                                        break;
                        }
                }
+
                
+               protected override void OnAfterLabelEdit (LabelEditEventArgs e)
+               {
+                       base.OnAfterLabelEdit (e);
+
+                       // no changes were made
+                       if (Items [e.Item].Text == e.Label)
+                               return;
+
+                       string folder;
+                       
+                       if (currentFolderFSEntry.RealName != null)
+                               folder = currentFolderFSEntry.RealName;
+                       else
+                               folder = currentFolder;
+                       folder = Path.Combine (folder, e.Label);
+
+                       if (!vfs.CreateFolder (folder)) {
+                               e.CancelEdit = true;
+                               // We should really attempt to restart editing 
here
+                       }
+               }
+
                private void UpdateMenuItems (MenuItem senderMenuItem)
                {
                        menuItemView.MenuItems 
[previousCheckedMenuItemIndex].Checked = false;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to