Author: aolk
Date: 2006-11-09 20:15:58 -0500 (Thu, 09 Nov 2006)
New Revision: 67658

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-10  Alexander Olk  <[EMAIL PROTECTED]>

        * FileDialog.cs: Always return the value for FilterIndex that
          was set. Internally convert it to values that make sense.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-11-10 01:10:38 UTC (rev 67657)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-11-10 01:15:58 UTC (rev 67658)
@@ -1,3 +1,8 @@
+2006-11-10  Alexander Olk  <[EMAIL PROTECTED]>
+
+       * FileDialog.cs: Always return the value for FilterIndex that
+         was set. Internally convert it to values that make sense.
+
 2006-11-10  Everaldo Canuto  <[EMAIL PROTECTED]>
        
        * ThemeWin32Classic.cs: Fix drowp down arrow borders.

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-10 01:10:38 UTC (rev 67657)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs    
2006-11-10 01:15:58 UTC (rev 67658)
@@ -59,6 +59,7 @@
                private string[] fileNames;
                private string filter = "";
                private int filterIndex = 1;
+               private int setFilterIndex = 1;
                private string initialDirectory = String.Empty;
                private bool restoreDirectory = false;
                private bool showHelp = false;
@@ -501,12 +502,17 @@
                [DefaultValue(1)]
                public int FilterIndex {
                        get {
-                               return filterIndex;
+                               return setFilterIndex;
                        }
                        
                        set {
-                               filterIndex = value;
+                               setFilterIndex = value;
                                
+                               if (value < 1)
+                                       filterIndex = 1;
+                               else
+                                       filterIndex = value;
+                               
                                SelectFilter ();
                        }
                }
@@ -594,7 +600,7 @@
                        dereferenceLinks = true;
                        FileName = String.Empty;
                        Filter = String.Empty;
-                       filterIndex = 1;
+                       FilterIndex = 1;
                        initialDirectory = String.Empty;
                        restoreDirectory = false;
                        ShowHelp = false;
@@ -703,15 +709,15 @@
                
                private void SelectFilter ()
                {
-                       if (mwfFileView.FilterArrayList == null || FilterIndex 
> mwfFileView.FilterArrayList.Count)
+                       if (mwfFileView.FilterArrayList == null || filterIndex 
> mwfFileView.FilterArrayList.Count)
                                return;
                        
                        do_not_call_OnSelectedIndexChangedFileTypeComboBox = 
true;
                        fileTypeComboBox.BeginUpdate ();
-                       fileTypeComboBox.SelectedIndex = FilterIndex - 1;
+                       fileTypeComboBox.SelectedIndex = filterIndex - 1;
                        fileTypeComboBox.EndUpdate ();
                        
-                       mwfFileView.FilterIndex = FilterIndex;
+                       mwfFileView.FilterIndex = filterIndex;
                }
                
                private bool SetFileName (string fname)
@@ -1026,13 +1032,13 @@
                        }
                        
                        if (filters.Count > 0 && FilterIndex <= filters.Count)
-                               fileTypeComboBox.SelectedIndex = FilterIndex - 
1;
+                               fileTypeComboBox.SelectedIndex = filterIndex - 
1;
                        
                        fileTypeComboBox.EndUpdate ();
                        
                        mwfFileView.FilterArrayList = filters;
                        
-                       mwfFileView.FilterIndex = FilterIndex;
+                       mwfFileView.FilterIndex = filterIndex;
                }
                
                private void ResizeAndRelocateForHelpOrReadOnly ()

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

Reply via email to