Author: aolk
Date: 2006-03-23 10:18:15 -0500 (Thu, 23 Mar 2006)
New Revision: 58361
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
Log:
2006-03-23 Alexander Olk <[EMAIL PROTECTED]>
* FileDialog.cs: Make FileDialog remember which directory it was in
last in the same execution.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-03-23 14:56:16 UTC (rev 58360)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-03-23 15:18:15 UTC (rev 58361)
@@ -1,3 +1,8 @@
+2006-03-23 Alexander Olk <[EMAIL PROTECTED]>
+
+ * FileDialog.cs: Make FileDialog remember which directory it was in
+ last in the same execution.
+
2006-03-22 Mike Kestner <[EMAIL PROTECTED]>
* FileDialog.cs: make the DropDownMenu on the toolbar display
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
2006-03-23 14:56:16 UTC (rev 58360)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
2006-03-23 15:18:15 UTC (rev 58361)
@@ -116,6 +116,9 @@
internal FileFilter fileFilter;
+ private string last_dir_when_opened_or_saved = "";
+ private string start_dir;
+
internal FileDialog ()
{
fileTypeComboBox = new ComboBox ();
@@ -355,7 +358,7 @@
readonlyCheckBox.CheckedChanged += new EventHandler
(OnCheckCheckChanged);
- ChangeDirectory (null, currentDirectoryName);
+ start_dir = currentDirectoryName;
}
[DefaultValue(true)]
@@ -496,6 +499,7 @@
set {
if (Directory.Exists (value)) {
initialDirectory = value;
+ start_dir = value;
ChangeDirectory (null,
initialDirectory);
}
@@ -623,6 +627,11 @@
{
form.Refresh ();
+ if (last_dir_when_opened_or_saved != String.Empty)
+ ChangeDirectory (null,
last_dir_when_opened_or_saved);
+ else
+ ChangeDirectory (null, start_dir);
+
fileNameComboBox.Select ();
return true;
@@ -877,6 +886,11 @@
if (restoreDirectory)
currentDirectoryName = restoreDirectoryString;
+ if (current_special_case != String.Empty)
+ last_dir_when_opened_or_saved =
current_special_case;
+ else
+ last_dir_when_opened_or_saved =
currentDirectoryName;
+
CancelEventArgs cancelEventArgs = new CancelEventArgs
();
cancelEventArgs.Cancel = false;
@@ -1078,6 +1092,8 @@
} else {
currentDirectoryName = path_or_special_case;
+ current_special_case = "";
+
currentDirectoryInfo = new DirectoryInfo
(path_or_special_case);
mwfFileView.UpdateFileView
(currentDirectoryInfo);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches