Author: calberto
Date: 2007-10-06 22:56:07 -0400 (Sat, 06 Oct 2007)
New Revision: 87043

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs
Log:
        * FolderBrowserDialog.cs: When running on Windows,
        try to detect paths such "C:" and add Path.DirectorySeparatorChar,
        since we must match both "C:" and "C:\" forms. A little hackish, but
        works.
        Fixes #325247.

2007-10-07  Carlos Alberto Cortez <[EMAIL PROTECTED]>



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-10-07 02:22:22 UTC (rev 87042)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-10-07 02:56:07 UTC (rev 87043)
@@ -1,5 +1,13 @@
 2007-10-07  Carlos Alberto Cortez <[EMAIL PROTECTED]>
 
+       * FolderBrowserDialog.cs: When running on Windows,
+       try to detect paths such "C:" and add Path.DirectorySeparatorChar,
+       since we must match both "C:" and "C:\" forms. A little hackish, but
+       works.
+       Fixes #325247.
+
+2007-10-07  Carlos Alberto Cortez <[EMAIL PROTECTED]>
+
        * ListView.cs: When calling EndEdit (after editing an item),
        create a new instance of LabelEditEventArgs to keep clean the fields
        in case we get a new call to BeginEdit; also do Application.DoEvents

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs
   2007-10-07 02:22:22 UTC (rev 87042)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs
   2007-10-07 02:56:07 UTC (rev 87043)
@@ -484,6 +484,8 @@
                                        Stack stack = new Stack ();
                                        
                                        string path_cut = path.Substring (0, 
path.LastIndexOf (Path.DirectorySeparatorChar));
+                                       if (!XplatUI.RunningOnUnix && 
path_cut.Length == 2)
+                                               path_cut += 
Path.DirectorySeparatorChar;
                                        
                                        while (node == null && path_cut.Length 
> 0) {
                                                node = FindPathInNodes 
(path_cut, Nodes);
@@ -540,6 +542,13 @@
                        
                        private FBTreeNode FindPathInNodes (string path, 
TreeNodeCollection nodes)
                        {
+                               // On Windows the devices can be passed as C: 
yet match
+                               // the C:\ form
+                               //
+                               // Hackish, but works
+                               if (!XplatUI.RunningOnUnix && path.Length == 2)
+                                       path += Path.DirectorySeparatorChar;
+
                                foreach (TreeNode node in nodes) {
                                        FBTreeNode fbnode = node as FBTreeNode;
                                        

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

Reply via email to