Re: [Mono-dev] [PATCH] Use the correct type for S.D.Printing.PrintDocument.PrintController

2006-08-04 Thread Carlos Alberto Cortez
Hey,

I tried your sample with .Net 2.0, and got:

controller = System.Windows.Forms.PrintControllerWithStatusDialog

Probably in .Net 1.1 it's handled different (if you are using that
version, of course).

Carlos.

El mié, 02-08-2006 a las 07:45 -0400, Chris Toshok escribió:
 this doesn't work unless System.Windows.Forms is being used, it appears.
 
 The following test:
 
 using System;
 using System.Drawing;
 using System.Drawing.Printing;
 
 public class Foo {
   public static void Main (string[] args) {
 PrintDocument doc = new PrintDocument ();
 
 Console.WriteLine (controller = {0},
 doc.PrintController.GetType());
   }
 }
 
 outputs:
 
   controller = System.Drawing.Printing.StandardPrintController
 
 Chris
 
 On Wed, 2006-08-02 at 04:30 -0500, Carlos Alberto Cortez wrote:
  Hey,
  
  S.D.Printing.PrintDocument.PrintController has as default a new instance
  of S.W.F.PrintControllerWithStatusDialog, which is in SWF assembly. 
  
  The current code assigns a new instance of S.D.P.StandardPrintController
  to PrintDocument.PrintController, which isn't the right behaviour.
  
  The problem is that it's not a good idea to add System.Windows.Forms as
  a reference to the System.Drawing assembly IMHO. So, the approach is to
  load the SWD assembly using reflection and then cache the type .ctor.
  
  
  Also, PrintDocument.PrintController should be never null, and should get
  a new PrintControllerWithStatusDialog instance, just like .Net does.
  
  Carlos. 
 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Use the correct type for S.D.Printing.PrintDocument.PrintController

2006-08-04 Thread Chris Toshok
I ran into some issues when using the .net 2.0 sdk on windows.  For the
time being it's best to run the 1.1 sdk, since that's the behavior we're
trying to match.

Chris

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Use the correct type for S.D.Printing.PrintDocument.PrintController

2006-08-02 Thread Chris Toshok
this doesn't work unless System.Windows.Forms is being used, it appears.

The following test:

using System;
using System.Drawing;
using System.Drawing.Printing;

public class Foo {
  public static void Main (string[] args) {
PrintDocument doc = new PrintDocument ();

Console.WriteLine (controller = {0},
doc.PrintController.GetType());
  }
}

outputs:

controller = System.Drawing.Printing.StandardPrintController

Chris

On Wed, 2006-08-02 at 04:30 -0500, Carlos Alberto Cortez wrote:
 Hey,
 
 S.D.Printing.PrintDocument.PrintController has as default a new instance
 of S.W.F.PrintControllerWithStatusDialog, which is in SWF assembly. 
 
 The current code assigns a new instance of S.D.P.StandardPrintController
 to PrintDocument.PrintController, which isn't the right behaviour.
 
 The problem is that it's not a good idea to add System.Windows.Forms as
 a reference to the System.Drawing assembly IMHO. So, the approach is to
 load the SWD assembly using reflection and then cache the type .ctor.
 
 
 Also, PrintDocument.PrintController should be never null, and should get
 a new PrintControllerWithStatusDialog instance, just like .Net does.
 
 Carlos. 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Use the correct type for S.D.Printing.PrintDocument.PrintController

2006-08-02 Thread Robert Jordan
Hey,

Carlos Alberto Cortez wrote:
 + Assembly wf_assembly = Assembly.Load 
 (System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, 
 PublicKeyToken=b77a5c561934e089);

The version of the assembly is wrong.

Please use the constant `Consts.AssemblySystem_Windows_Forms' instead
of the hard coded assembly name.


Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Use the correct type for S.D.Printing.PrintDocument.PrintController

2006-08-02 Thread Carlos Alberto Cortez
Oh, that's perfect (I wasn't aware of that constant). 

Carlos.

El mié, 02-08-2006 a las 14:00 +0200, Robert Jordan escribió:
 Hey,
 
 Carlos Alberto Cortez wrote:
  +   Assembly wf_assembly = Assembly.Load 
  (System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, 
  PublicKeyToken=b77a5c561934e089);
 
 The version of the assembly is wrong.
 
 Please use the constant `Consts.AssemblySystem_Windows_Forms' instead
 of the hard coded assembly name.
 
 
 Robert
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list