Author: aolk
Date: 2006-11-17 15:35:16 -0500 (Fri, 17 Nov 2006)
New Revision: 68095
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
Log:
2006-11-17 Alexander Olk <[EMAIL PROTECTED]>
* FileDialog.cs: Trim all filters, otherwise DirInfo.GetFiles
can't handle those filters. (Fixes bug #79961)
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-11-17 20:33:16 UTC (rev 68094)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-11-17 20:35:16 UTC (rev 68095)
@@ -1,3 +1,8 @@
+2006-11-17 Alexander Olk <[EMAIL PROTECTED]>
+
+ * FileDialog.cs: Trim all filters, otherwise DirInfo.GetFiles
+ can't handle those filters. (Fixes bug #79961)
+
2006-11-17 Chris Toshok <[EMAIL PROTECTED]>
[ fixes the exit/crashes associated with #79835. it's clearly
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
2006-11-17 20:33:16 UTC (rev 68094)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
2006-11-17 20:35:16 UTC (rev 68095)
@@ -1808,8 +1808,9 @@
private void SplitFilters (string filter)
{
string[] split = filter.Split (new char [] {';'});
-
- filters.AddRange (split);
+ foreach (string s in split) {
+ filters.Add (s.Trim ());
+ }
}
}
#endregion
@@ -2900,6 +2901,7 @@
protected string currentTopFolder = String.Empty;
protected FSEntry currentFolderFSEntry = null;
protected FSEntry currentTopFolderFSEntry = null;
+ private FileInfoComparer fileInfoComparer = new
FileInfoComparer ();
public FSEntry ChangeDirectory (string folder)
{
@@ -3064,6 +3066,8 @@
} else {
foreach (string s in filters)
files.AddRange
(dirinfo.GetFiles (s));
+
+ files.Sort (fileInfoComparer);
}
} catch (Exception) {}
@@ -3129,6 +3133,13 @@
return fs;
}
+ internal class FileInfoComparer : IComparer
+ {
+ public int Compare (object fileInfo1, object fileInfo2)
+ {
+ return String.Compare
(((FileInfo)fileInfo1).Name, ((FileInfo)fileInfo2).Name);
+ }
+ }
protected abstract FSEntry GetDesktopFSEntry ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches