Author: andreia
Date: 2008-02-06 12:01:40 -0500 (Wed, 06 Feb 2008)
New Revision: 95041

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs
Log:
* PrintControllerWithStatusDialog.cs: Set PrintFileName value through
reflection only on 1.1, this property is public on system.drawing on 2.0.
Fixed #359247

2008-02-06  Andreia Gaita <[EMAIL PROTECTED]>

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-02-06 16:32:10 UTC (rev 95040)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-02-06 17:01:40 UTC (rev 95041)
@@ -1,3 +1,9 @@
+2008-02-06  Andreia Gaita <[EMAIL PROTECTED]>
+
+       * PrintControllerWithStatusDialog.cs: Set PrintFileName value through
+       reflection only on 1.1, this property is public on system.drawing on 
2.0.
+       Fixed #359247
+
 2008-02-06  Andreia Gaita  <[EMAIL PROTECTED]>
        
        * WebBrowser.cs: Do a normal page refresh by default.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs
       2008-02-06 16:32:10 UTC (rev 95040)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs
       2008-02-06 17:01:40 UTC (rev 95041)
@@ -79,9 +79,16 @@
 
                void Set_PrinterSettings_PrintFileName (PrinterSettings 
settings, string filename)
                {
-                       PropertyInfo PrintFileName = typeof 
(PrinterSettings).GetProperty ("PrintFileName", BindingFlags.NonPublic | 
BindingFlags.Instance);
-
-                       PrintFileName.SetValue (settings, filename, null);
+                       #if NET_2_0
+                               settings.PrintFileName = filename;
+                       #else
+                       
+                               PropertyInfo printFileName = typeof 
(PrinterSettings).GetProperty ("PrintFileName", BindingFlags.NonPublic | 
BindingFlags.Instance);
+                               if (printFileName == null) {
+                                       throw new Exception ("Unable to set 
filename to print");
+                               }
+                               printFileName.SetValue (settings, filename, 
null);
+                       #endif
                }
 
                public override void OnStartPrint(PrintDocument document, 
PrintEventArgs e) {

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

Reply via email to