Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,437 @@
2009-07-08 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* PaperSource.cs: Implement RawKind.
Fixes the remaining bits of #507739.
2009-07-08 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* PaperSize.cs: Implement support for RawKind.
Patch by Andy Hume (andyhume32@yahoo.co.uk).
Fixes part of #507739.
2009-07-07 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* PaperSize.cs: Actually implement RawKind by retrieving and setting
the kind field.
2008-11-01 Sebastien Pouliot <sebastien@ximian.com>
* PrintingServicesUnix.cs: Fix potential crash on 64bit OS. Gendarme
rule for checking IntPtr has been updated to cover this case as well
2008-10-12 Sebastien Pouliot <sebastien@ximian.com>
* PaperSize.cs, PreviewPrintController.cs, PrinterSettings.cs,
PrintingPermissionAttribute.cs, PrintingPermission.cs: Remove unneeded
field initialization to their default values.
[Found using Gendarme AvoidUnneededFieldInitializationRule]
2008-02-10 Sebastien Pouliot <sebastien@ximian.com>
* PrintingServicesUnix.cs: Fix AvoidToStringOnStringsRule found
using Gendarme.
2007-12-10 Andreia Gaita <avidigal@novell.com>
* PrintingServicesWin32.cs: Add enumeration flag to get remote
printers as well as locally connected ones. Fixes #325258
2007-06-30 Gert Driesen <drieseng@users.sourceforge.net>
* Margins.cs: Overloaded operators are 2.0 only.
2007-05-29 Sebastien Pouliot <sebastien@ximian.com>
* Margins.cs: Implement missing == and != operators (MoMA reports them
but they were not included in the class status pages). Fix property
setters (to check value), reduced code duplication and changed
GetHashCode to be less CPU intensive.
2007-05-24 Gert Driesen <drieseng@users.sourceforge.net>
* PrintingServicesWin32.cs: Pass 0 as mode to DocumentProperties to
obtain the size of the buffer required to hold the DEVMODE structure.
Fixes bug #81723.
2007-05-23 Sebastien Pouliot <sebastien@ximian.com>
* PreviewPrintController.cs: Reduce bitmap size and avoid scaling the
print preview (fix bug #80765). Patch from Vladimir Dimitrov.
* PrintingServicesUnix.cs: Reorder calculation to avoid loss of
precision in integer division. Use printer resolution for Cairo
fallback. Patch from Vladimir Dimitrov.
2007-03-13 Andreia Gaita <avidigal@novell.com>
* PrintingServices.cs: Add missing static method SysPrn.GetPrintDialogInfo
for SWF to call up printing dialogues.
2007-02-21 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix.cs: Report an error in the console if there is
a problem opening the printer.
2007-02-21 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix.cs: don't free up pointers unnecessarily (doh)
2007-02-21 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix.cs: add checks and try blocks to make sure
things don't blow up if we try to double free anything (not that
we're trying to do anything like that :p )
2007-02-21 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix.cs: fix a double-free bug
2007-02-20 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix.cs: Fix leak caused by not calling cupsFreeDests
on certain codepaths. Fix return value of cupsFreeDests to void.
2007-02-20 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix.cs: Correct missing static initialization
of loaded printers hashtable, unit tests were failing (oops :p)
2007-02-17 Marek (please complete)
* PrintPreviewController, InvalidPrinterException:
Remove warnings
2007-02-16 Andreia Gaita <avidigal@novell.com>
Redesign how and when cups gets called to minimize
p/invokes, implements caching of printers and printer
settings as per calberto's patch - #79822, plotter detection,
duplex, fixes for image disposing, code modularization,
misc. fixes.
* PageSettings.cs: Check and ignore null setter values on
paper sizes, sources and resolutions.
* PaperSize.cs: Add default paper size flag
* PaperSource.cs: Add default paper source flag, minor code
beautification
* PrinterSettings.cs: Add duplex and plotter implementation,
modify calls to PrintingServices to support caching, add
a printer capabilities list to store specific printer options -
only loaded with cups, for now. Move the internal list classes
to the end of the code so as not to clutter.
* PrintingServices.cs: Separate the PrintingServices class in 2 -
PrintingServices and GlobalPrintingServices (see calberto's patch
in #79822). The PrintingServices class is where all the methods
caching information reside, the GlobalPrintingServices methods do
no caching.
The cached information resides on the Printer class, added to the
SysPrn class.
* PrintingServicesUnix.cs: Big rewrite.
- Essentially, redesigned and modularized the code to minimize cups
calls. Then, applied the caching so all the cups calls are reduced
to a minimum, by loading a list of printers onto a hashtable, then
loading the settings of the chosen printer and saving that in the
hashtable all in one go.
- Also, fixes for loading the proper default values of the printer,
which are stored in it's global options;
- Modularization of cups/ppd loading methods (LoadPrinterOptions,
LoadOptionList, OpenPrinter, ClosePrinter) so we don't repeat
cups/ppd loading loops everywhere.
- Proper disposing of pointers and structures, calling the proper
cups free calls.
- Add duplex support
* PrintingServicesWin32.cs: IsPrinterValid is no longer caching the value,
since it should be supporting global caching as well, though that is not
yet complete on win32. Implements plotter detection support, and changes for
the new PrinterSettings/GlobalPrinterSettings structure. Some minor changes
the code to minimize p/invoke calls (load the printer sources and sizes
before accessing the collections)
* StandardPrintController.cs: PrinterSettings/GlobalPrinterSettings structure
changes
2007-02-09 Sebastien Pouliot <sebastien@ximian.com>
* PrintingServicesUnix.cs: Ensure we free the original pointer in
GetAlternativeDefaultPrinter (not the one used for iteration).
2007-01-19 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix.cs: Add is_default flag check for
detecting default printer when cupsGetDefault doesn't return
valid values (mainly ubuntu). Fixes #80198, #80519
2007-01-09 Sebastien Pouliot <sebastien@ximian.com>
* PrintingServices.cs: Unify platform detection code.
2006-12-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* PrintingServicesUnix.cs: Add "landscape" option
when using PaperSettings.Landscape set to true. Also
swap the width and height for the postscript file.
2006-12-01 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix: Proper size structure use for 64 bit
support.
2006-12-01 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix: *properly* check return value from
cupsGetDefault. If there are no default printers set,
check if there are installed printers, and use that.
Hopefully fixes #79835
2006-12-01 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix: check return value from cupsGetDefault.
Hopefully fixes #79835
2006-12-01 Jordi Mas i Hernandez <jordimash@gmail.com>
* PrintingServicesWin32.cs: Fixes paper sizes reading. The POINT
structure is 8 bytes long not 4. This fixes margins calculations
(based on the paper size) that were badly broken.
2006-11-28 Andreia Gaita <avidigal@novell.com>
* PageSettings.cs:
- internal member name changes to help
out with intelisense.
- Use internal members directly instead of using
corresponding properties so that exceptions are not thrown
* PrintingServicesWin32:
- Only return DefaultPrinter if it is actually valid. This
is because Win32GetDefaultPrinter returns a printer name
even if PrintSpooler is stopped (which should behave the
same way as if there are no printers installed)
- Do not try to allocate if EnumPrinters returns 0
2006-11-25 Jordi Mas i Hernandez <jordimash@gmail.com>
* PrintingServicesUnix.cs: Implements GetPrintDialogInfo
2006-11-24 Carlos Alberto Cortez <calberto.cortez@gmail.com>
Initial support for PageSettings (color, copies, collate,
and media size).
* StandardPrintController.cs: Pass PrintDocument.PageSettings to
create the Graphics object (althought PageSettings
contains a PrinterSettings and vice versa, PrintDocument
can contain non-related PrinterSettings and PageSettings objects).
* PrintingServices.cs: Likewise.
* PrintingServicesWin32.cs: Likewise.
* PrintingServicesUnix.cs: Likewise. Also use cupsParseOptions
to pass printing options when calling cupsPrintFile. Use "Custom"
as name for custom pages without associated name (Laxmark printers
have this problem, causing a nullref exc). Add GetPaperKind () method
to retrieve and set the right PaperKind value for PaperSize, instead
of using PaperKind.Custom for all page sizes. Finally save
PageSettings in DOCINFO to use it later.
* PrintDocument.cs: Clone PrinterSettings.PageSettings
instead of creating a new one (this avoid creating an additional
PrinterSettings instance).
2006-11-17 Andreia Gaita <avidigal@novell.com>
* PrintingServicesWin32.cs: fix another dumb typo -
check proper return value from printer validity call
2006-11-16 Chris Toshok <toshok@ximian.com>
* PreviewPrintController.cs: fix typo - don't throw
InvalidPrinterException when it wasn't supposed to be.
2006-11-16 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* PrintDocument.cs: Use QueryPageSettingsEventArgs.PageSettings
in PrintPageEventArgs, instead of using the default one (mimic
.Net behaviour).
* PageSettings.cs: Implement Clone the right way (intead of using
the default page settings).
2006-11-14 Andreia Gaita <avidigal@novell.com>
Fixes #79835, implements PrinterSettings.IsValid, throws proper
InvalidPrinterException with differentiated messages.
* PrintingServices.cs: Declares IsPrinterValid to enable easy checking
if printer name is a valid printer
* PrintingServicesWin32.cs: Implements IsPrinterValid, caches
last assigned printer name and if it is valid to speed up next calls.
* PrintingServicesUnix.cs: Implements IsPrinterValid, caches
last assigned printer name and if it is valid to speed up next calls.
* PageSettings.cs:
- throw InvalidPrinterException in the properties,
according to the docs: Color, Landscape, PaperSize, PaperSource,
PrinterResolution
- change the private fields above to internal, so that in the
constructor we can access them without triggering the exceptions
if there are no printers installed
* PrinterSettings.cs: Implement IsValid to call IsPrinterValid
implemented above
* PreviewPrintController.cs: throw InvalidPrinterException on
StartPrint() if there's no valid printer configured
* InvalidPrinterException.cs: New private GetMessage() to customize
printer error message, used by constructor
2006-09-27 Jordi Mas i Hernandez <jordimash@gmail.com>
* PrintingServicesUnix.cs: Implements LoadPrinterPaperSources member,
simplifies GetPaperSizeName and loads paper source and size defaults
2006-09-27 Jordi Mas i Hernandez <jordimash@gmail.com>
* PrintingServices.cs: Add LoadPrinterPaperSources member
* PrintingServicesWin32.cs: Implements LoadPrinterPaperSources and
reads the default paper source and size.
* PrintingServicesUnix.cs: Add stub LoadPrinterPaperSources member
* PrinterSettings.cs: Implements PaperSourceCollection property and
makes default paper source and size from the system.
2006-08-02 Chris Toshok <toshok@ximian.com>
* PreviewPrintController.cs: scale the Graphics context we pass
back from OnStartPage such that the preview looks the way the
printed output will.
2006-07-28 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* PrintDocument.cs: When null is passed to PrinterSettings,
it should be set to a new PrinterSettings instance, and should never
be null.
* PrinterSettings.cs: Default value for Copies should be 1. Also
add a space in the ToString method, to correctly show the printer
info.
2006-07-26 Chris Toshok <toshok@ximian.com>
* PrinterSettings.cs: expose PrintFileName in the 1.1 case as an
internal property, so we can get at it from MWF.
* PrintingServicesUnix.cs: handle print to file, and also remove
the temp file after sending the data to the printer. fix some
dllimports to match the rest of system.drawing.
* PreviewPrintController.cs: implement this (warning, it'll eat
all your memory until we get a real Metafile implementation, as
we're storing bitmaps).
* PrintDocument.cs: shift the graphics context stuff around a bit
in Print(), so that the events after OnStartPrint are passed the
graphics context the controller created there, and we use the
return value of OnStartPage to do all drawing.
2006-05-20 Jordi Mas i Hernandez <jordimash@gmail.com>
* PrintingServices.cs: GetPrintDialogInfo definition
* PrintingServicesWin32.cs GetPrintDialogInfo implementation
* PrintingServicesUnix.cs: GetPrintDialogInfo stub
2006-04-14 Jordi Mas i Hernandez <jordimash@gmail.com>
* PrintingServicesUnix.cs: Replace cupsGetPrinters deprecated API call
2006-04-13 Jordi Mas i Hernandez <jordimash@gmail.com>
* PrintingServicesUnix.cs: Checks if cups is installed
* PrinterSettings.cs: PrintToFile property and ToString method
2006-04-28 Sebastien Pouliot <sebastien@ximian.com>
* PrintController.cs: corcompare fix. No public ctor in 2.0.
* PrinterSettings.cs: corcompare fix. Clone method isn't virtual.
2006-03-21 Sebastien Pouliot <sebastien@ximian.com>
* PrintingServicesUnix.cs: cupsGetPrinters(char***) requires to free
each individual string and (finally) the list. Note that this call is
deprecated.
2006-03-13 Peter Dennis Bartok <pbartok@novell.com>
* PrintingServicesUnix.cs: Handle not having a printer
2006-02-09 Peter Dennis Bartok <pbartok@novell.com>
* PrintingServicesWin32.cs: Simplyfied the code, removing the need
for pointer calculations (part of 64bit cleanup)
2006-01-27 Sebastien Pouliot <sebastien@ximian.com>
* PrintingServicesWin32.cs: Ensure Marshal.FreeHGlobal is called for
all unmanaged memory allocated with AllocHGlobal.
2006-01-15 Jordi Mas i Hernandez <jordimash@gmail.com>
* PrintingServicesUnix.cs: Allow setting the dpy's for the surface
2005-12-22 Jordi Mas i Hernandez <jordimash@gmail.com>
* PrintingServices.cs: Printing services abstration class
* PrintingServicesWin32.cs: Win32 printer driver
* PrintingServicesUnix.cs: Unix printer driver
* Margins.cs: Fixes exceptions error messages
* PrinterResolution.cs: Fixes
* PrintEventArgs.cs: New internal method
* PrintPageEventArgs.cs: New internal method
* StandardPrintController.cs: Fixes
* PrinterUnitConvert.cs: Fixes conversion errors
* PrintDocument.cs: Fixes to make it print
* PageSettings.cs: Take margains into account
* PrintController.cs: Fixes
* PaperSize.cs: Method to set paper Kind
* PrinterSettings.cs: Implements settings and fixes
*
2005-12-07 Jordi Mas i Hernandez <jordimash@gmail.com>
* PrinterResolutionKind.cs: Fixes signature for .Net 2.0
* PaperKind.cs: Fixes signature for .Net 2.0
* PaperSource.cs: Fixes signature for .Net 2.0
* Margins.cs: Fixes signature for .Net 2.0
* PrinterResolution.cs: Fixes signature for .Net 2.0
* PrintEventArgs.cs: Fixes signature for .Net 2.0
* PrintAction.cs: New enum in .Net 2.0
* PageSettings.cs: Fixes signature for .Net 2.0
* PaperSourceKind.cs: Fixes signature for .Net 2.0
* PrintController.cs: Fixes signature for .Net 2.0
* Duplex.cs: Fixes signature for .Net 2.0
* PaperSize.cs: Fixes signature for .Net 2.0
* PreviewPrintController.cs: Fixes signature for .Net 2.0
* PrinterSettings.cs: Fixes signature for .Net 2.0
* PrintRange.cs: Fixes signature for .Net 2.0
2005-09-16 Sebastien Pouliot <sebastien@ximian.com>
* InvalidPrinterException.cs: Removed NotImplementedException (not
required) and added a demand for SerializationFormatter on the
GetObjectData method.
* PrintingPermission.cs: Throw ArgumentException if the class or
version attributes are missing in the supplied XML (only in 1.x).
2005-03-23 Jordi Mas i Hernandez <jordi@ximian.com>
* PaperKind.cs: fixes wrong enum values
2005-01-27 Lluis Sanchez Gual <lluis@novell.com>
* MarginsConverter.cs: Implemented support for InstanceDescriptor.

View File

@@ -0,0 +1,42 @@
//
// System.Drawing.Duplex.cs
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
// Author: Dennis Hayes (dennish@raytek.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
public enum Duplex {
Default = -1,
Horizontal = 3,
Simplex = 1,
Vertical = 2
}
}

View File

@@ -0,0 +1,71 @@
//
// System.Drawing.InvalidPrinterExecption.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace System.Drawing.Printing {
#if NET_2_0
[Serializable]
#endif
public class InvalidPrinterException : SystemException {
// private PrinterSettings settings;
public InvalidPrinterException (PrinterSettings settings): base(InvalidPrinterException.GetMessage(settings))
{
// this.settings = settings;
}
protected InvalidPrinterException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
[SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException ("info");
base.GetObjectData (info, context);
}
private static string GetMessage(PrinterSettings settings)
{
if (settings.PrinterName == null || settings.PrinterName == String.Empty)
return "No Printers Installed";
return String.Format("Tried to access printer '{0}' with invalid settings.", settings.PrinterName);
}
}
}

View File

@@ -0,0 +1,159 @@
//
// System.Drawing.Margins.cs
//
// Authors:
// Dennis Hayes (dennish@Raytek.com)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002 Ximian, Inc
// Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.ComponentModel;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
[TypeConverter (typeof (MarginsConverter))]
public class Margins : ICloneable {
int left;
int right;
int top;
int bottom;
public Margins ()
{
left = 100;
right = 100;
top = 100;
bottom = 100;
}
public Margins (int left, int right, int top, int bottom)
{
Left = left;
Right = right;
Top = top;
Bottom = bottom;
}
public int Left {
get {
return left;
}
set {
if (value < 0)
InvalidMargin ("left");
left = value;
}
}
public int Right {
get {
return right;
}
set {
if (value < 0)
InvalidMargin ("right");
right = value;
}
}
public int Top {
get {
return top;
}
set {
if (value < 0)
InvalidMargin ("top");
top = value;
}
}
public int Bottom {
get {
return bottom;
}
set {
if (value < 0)
InvalidMargin ("bottom");
bottom = value;
}
}
private void InvalidMargin (string property)
{
string msg = Locale.GetText ("All Margins must be greater than 0");
throw new System.ArgumentException (msg, property);
}
public object Clone ()
{
return new Margins (left, right, top, bottom);
}
public override bool Equals (object obj)
{
return Equals (obj as Margins);
}
private bool Equals (Margins m)
{
// avoid recursion with == operator
if ((object)m == null)
return false;
return ((m.Left == left) && (m.Right == right) && (m.Top == top) && (m.Bottom == bottom));
}
public override int GetHashCode ()
{
return left | (right << 8) | (right >> 24) | (top << 16) | (top >> 16) | (bottom << 24) | (bottom >> 8);
}
public override string ToString ()
{
string ret = "[Margins Left={0} Right={1} Top={2} Bottom={3}]";
return String.Format (ret, left, right, top, bottom);
}
#if NET_2_0
public static bool operator == (Margins m1, Margins m2)
{
// avoid recursion with == operator
if ((object)m1 == null)
return ((object)m2 == null);
return m1.Equals (m2);
}
public static bool operator != (Margins m1, Margins m2)
{
// avoid recursion with == operator
if ((object)m1 == null)
return ((object)m2 != null);
return !m1.Equals (m2);
}
#endif
}
}

View File

@@ -0,0 +1,137 @@
//
// System.Drawing.MarginsConverter.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
// Herve Poussineau (hpoussineau@fr.st)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.ComponentModel;
using System.Globalization;
using System.Text.RegularExpressions;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
namespace System.Drawing.Printing {
/// <summary>
/// Summary description for MarginsConverter.
/// </summary>
public class MarginsConverter : ExpandableObjectConverter {
public MarginsConverter() {
}
#region Methods
public override bool CanConvertFrom(ITypeDescriptorContext context,Type sourceType) {
if (sourceType == typeof(string))
return true;
return base.CanConvertFrom(context, sourceType);
}
public override bool CanConvertTo(ITypeDescriptorContext context,Type destinationType) {
if (destinationType == typeof(string))
return true;
if (destinationType == typeof (InstanceDescriptor))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertFrom(ITypeDescriptorContext context,CultureInfo culture,object value) {
if (value is string)
{
if (value == null)
return new Margins();
// format [left];[right];[top];[bottom]
string separator = @"( |\t)*";
separator = separator + ";" + separator;
string regex = @"(?<left>\d+)" + separator + @"(?<right>\d+)" + separator + @"(?<top>\d+)" + separator + @"(?<bottom>\d+)";
Match match = new Regex(regex).Match(value as string);
if (!match.Success)
throw new ArgumentException("value");
int left, right, top, bottom;
try
{
left = int.Parse(match.Groups["left"].Value);
right = int.Parse(match.Groups["right"].Value);
top = int.Parse(match.Groups["top"].Value);
bottom = int.Parse(match.Groups["bottom"].Value);
}
catch (Exception e)
{
throw new ArgumentException("value", e);
}
return new Margins(left, right, top, bottom);
} else
return base.ConvertFrom(context, culture, value);
}
public override object ConvertTo(ITypeDescriptorContext context,CultureInfo culture,object value,Type destinationType) {
if (destinationType == typeof(string) && value is Margins)
{
Margins source = value as Margins;
string ret = "{0}; {1}; {2}; {3}";
return String.Format(ret, source.Left, source.Right, source.Top, source.Bottom);
}
if (destinationType == typeof (InstanceDescriptor) && value is Margins) {
Margins c = (Margins) value;
ConstructorInfo ctor = typeof(Margins).GetConstructor (new Type[] {typeof(int), typeof(int), typeof(int), typeof(int)} );
return new InstanceDescriptor (ctor, new object[] {c.Left, c.Right, c.Top, c.Bottom});
}
return base.ConvertTo(context, culture, value, destinationType);
}
public override bool GetCreateInstanceSupported(ITypeDescriptorContext context)
{
return true;
}
public override object CreateInstance(ITypeDescriptorContext context, System.Collections.IDictionary propertyValues)
{
try
{
Margins margins = new Margins();
margins.Left = int.Parse(propertyValues["Left"].ToString());
margins.Right = int.Parse(propertyValues["Right"].ToString());
margins.Top = int.Parse(propertyValues["Top"].ToString());
margins.Bottom = int.Parse(propertyValues["Bottom"].ToString());
return margins;
}
catch (Exception)
{
// in case of error, return null
return null;
}
}
#endregion
}
}

View File

@@ -0,0 +1,244 @@
//
// System.Drawing.PageSettings.cs
//
// Authors:
// Dennis Hayes (dennish@Raytek.com)
// Herve Poussineau (hpoussineau@fr.st)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.InteropServices;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#else
[ComVisible (false)]
#endif
public class PageSettings : ICloneable
{
internal bool color;
internal bool landscape;
internal PaperSize paperSize;
internal PaperSource paperSource;
internal PrinterResolution printerResolution;
// create a new default Margins object (is 1 inch for all margins)
Margins margins = new Margins();
#if NET_2_0
float hardMarginX;
float hardMarginY;
RectangleF printableArea;
#endif
PrinterSettings printerSettings;
public PageSettings() : this(new PrinterSettings())
{
}
public PageSettings(PrinterSettings printerSettings)
{
PrinterSettings = printerSettings;
this.color = printerSettings.DefaultPageSettings.color;
this.landscape = printerSettings.DefaultPageSettings.landscape;
this.paperSize = printerSettings.DefaultPageSettings.paperSize;
this.paperSource = printerSettings.DefaultPageSettings.paperSource;
this.printerResolution = printerSettings.DefaultPageSettings.printerResolution;
}
// used by PrinterSettings.DefaultPageSettings
internal PageSettings(PrinterSettings printerSettings, bool color, bool landscape, PaperSize paperSize, PaperSource paperSource, PrinterResolution printerResolution)
{
PrinterSettings = printerSettings;
this.color = color;
this.landscape = landscape;
this.paperSize = paperSize;
this.paperSource = paperSource;
this.printerResolution = printerResolution;
}
//props
public Rectangle Bounds{
get{
int width = this.paperSize.Width;
int height = this.paperSize.Height;
width -= this.margins.Left + this.margins.Right;
height -= this.margins.Top + this.margins.Bottom;
if (this.landscape) {
// swap width and height
int tmp = width;
width = height;
height = tmp;
}
return new Rectangle (this.margins.Left, this.margins.Top, width, height);
}
}
public bool Color{
get{
if (!this.printerSettings.IsValid)
throw new InvalidPrinterException(this.printerSettings);
return color;
}
set{
color = value;
}
}
public bool Landscape {
get{
if (!this.printerSettings.IsValid)
throw new InvalidPrinterException(this.printerSettings);
return landscape;
}
set{
landscape = value;
}
}
public Margins Margins{
get{
if (!this.printerSettings.IsValid)
throw new InvalidPrinterException(this.printerSettings);
return margins;
}
set{
margins = value;
}
}
public PaperSize PaperSize{
get{
if (!this.printerSettings.IsValid)
throw new InvalidPrinterException(this.printerSettings);
return paperSize;
}
set{
if (value != null)
paperSize = value;
}
}
public PaperSource PaperSource{
get{
if (!this.printerSettings.IsValid)
throw new InvalidPrinterException(this.printerSettings);
return paperSource;
}
set{
if (value != null)
paperSource = value;
}
}
public PrinterResolution PrinterResolution{
get{
if (!this.printerSettings.IsValid)
throw new InvalidPrinterException(this.printerSettings);
return printerResolution;
}
set{
if (value != null)
printerResolution = value;
}
}
public PrinterSettings PrinterSettings{
get{
return printerSettings;
}
set{
printerSettings = value;
}
}
#if NET_2_0
public float HardMarginX {
get {
return hardMarginX;
}
}
public float HardMarginY {
get {
return hardMarginY;
}
}
public RectangleF PrintableArea {
get {
return printableArea;
}
}
#endif
public object Clone ()
{
// We do a deep copy
PrinterResolution pres = new PrinterResolution (this.printerResolution.X, this.printerResolution.Y, this.printerResolution.Kind);
PaperSource psource = new PaperSource (this.paperSource.SourceName, this.paperSource.Kind);
PaperSize psize = new PaperSize (this.paperSize.PaperName, this.paperSize.Width, this.paperSize.Height);
psize.SetKind (this.paperSize.Kind);
PageSettings ps = new PageSettings (this.printerSettings, this.color, this.landscape,
psize, psource, pres);
ps.Margins = (Margins) this.margins.Clone ();
return ps;
}
[MonoTODO("PageSettings.CopyToHdevmode")]
public void CopyToHdevmode (IntPtr hdevmode){
throw new NotImplementedException ();
}
[MonoTODO("PageSettings.SetHdevmode")]
public void SetHdevmode (IntPtr hdevmode){
throw new NotImplementedException ();
}
public override string ToString(){
string ret = "[PageSettings: Color={0}";
ret += ", Landscape={1}";
ret += ", Margins={2}";
ret += ", PaperSize={3}";
ret += ", PaperSource={4}";
ret += ", PrinterResolution={5}";
ret += "]";
return String.Format(ret, this.color, this.landscape, this.margins, this.paperSize, this.paperSource, this.printerResolution);
}
}
}

View File

@@ -0,0 +1,157 @@
//
// System.Drawing.PaperKind.cs
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Author: Dennis Hayes (dennish@raytek.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
public enum PaperKind
{
A2 = 66,
A3 = 8,
A3Extra = 63,
A3ExtraTransverse = 68,
A3Rotated = 76,
A3Transverse = 67,
A4 = 9,
A4Extra = 53,
A4Plus = 60,
A4Rotated = 77,
A4Small = 10,
A4Transverse = 55,
A5 = 11,
A5Extra = 64,
A5Rotated = 78,
A5Transverse = 61,
A6 = 70,
A6Rotated = 83,
APlus = 57,
B4 = 12,
B4Envelope = 33,
B4JisRotated = 79,
B5 = 13,
B5Envelope = 34,
B5Extra = 65,
B5JisRotated = 80,
B5Transverse = 62,
B6Envelope = 35,
B6Jis = 88,
B6JisRotated = 89,
BPlus = 58,
C3Envelope = 29,
C4Envelope = 30,
C5Envelope = 28,
C65Envelope = 32,
C6Envelope = 31,
CSheet = 24,
Custom = 0,
DLEnvelope = 27,
DSheet = 25,
ESheet = 26,
Executive = 7,
Folio = 14,
GermanLegalFanfold = 41,
GermanStandardFanfold = 40,
InviteEnvelope = 47,
IsoB4 = 42,
ItalyEnvelope = 36,
JapaneseDoublePostcard = 69,
JapaneseDoublePostcardRotated = 82,
JapaneseEnvelopeChouNumber3 = 73,
JapaneseEnvelopeChouNumber3Rotated = 86,
JapaneseEnvelopeChouNumber4 = 74,
JapaneseEnvelopeChouNumber4Rotated = 87,
JapaneseEnvelopeKakuNumber2 = 71,
JapaneseEnvelopeKakuNumber2Rotated = 84,
JapaneseEnvelopeKakuNumber3 = 72,
JapaneseEnvelopeKakuNumber3Rotated = 85,
JapaneseEnvelopeYouNumber4 = 91,
JapaneseEnvelopeYouNumber4Rotated = 92,
JapanesePostcard = 43,
JapanesePostcardRotated = 81,
Ledger = 4,
Legal = 5,
LegalExtra = 51,
Letter = 1,
LetterExtra = 50,
LetterExtraTransverse = 56,
LetterPlus = 59,
LetterRotated = 75,
LetterSmall = 2,
LetterTransverse = 54,
MonarchEnvelope = 37,
Note = 18,
Number10Envelope = 20,
Number11Envelope = 21,
Number12Envelope = 22,
Number14Envelope = 23,
Number9Envelope = 19,
PersonalEnvelope = 38,
Prc16K = 93,
Prc16KRotated = 106,
Prc32K = 94,
Prc32KBig = 95,
Prc32KBigRotated = 108,
Prc32KRotated = 107,
PrcEnvelopeNumber1 = 96,
PrcEnvelopeNumber10 = 105,
PrcEnvelopeNumber10Rotated = 118,
PrcEnvelopeNumber1Rotated = 109,
PrcEnvelopeNumber2 = 97,
PrcEnvelopeNumber2Rotated = 110,
PrcEnvelopeNumber3 = 98,
PrcEnvelopeNumber3Rotated = 111,
PrcEnvelopeNumber4 = 99,
PrcEnvelopeNumber4Rotated = 112,
PrcEnvelopeNumber5 = 100,
PrcEnvelopeNumber5Rotated = 113,
PrcEnvelopeNumber6 = 101,
PrcEnvelopeNumber6Rotated = 114,
PrcEnvelopeNumber7 = 102,
PrcEnvelopeNumber7Rotated = 115,
PrcEnvelopeNumber8 = 103,
PrcEnvelopeNumber8Rotated = 116,
PrcEnvelopeNumber9 = 104,
PrcEnvelopeNumber9Rotated = 117,
Quarto = 15,
Standard10x11 = 45,
Standard10x14 = 16,
Standard11x17 = 17,
Standard12x11 = 90,
Standard15x11 = 46,
Standard9x11 = 44,
Statement = 6,
Tabloid = 3,
TabloidExtra = 52,
USStandardFanfold = 39
}
}

View File

@@ -0,0 +1,139 @@
//
// System.Drawing.PaperSize.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
// Herve Poussineau (hpoussineau@fr.st)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Drawing.Printing
{
/// <summary>
/// Summary description for PaperSize.
/// </summary>
#if NET_2_0
[Serializable]
#endif
public class PaperSize
{
string name;
int width;
int height;
PaperKind kind;
internal bool is_default;
#if NET_2_0
public PaperSize ()
{
}
#endif
public PaperSize(string name, int width, int height)
{
this.width = width;
this.height = height;
this.name = name;
}
internal PaperSize(string name, int width, int height, PaperKind kind, bool isDefault)
{
this.width = width;
this.height = height;
this.name = name;
this.is_default = isDefault;
}
public int Width{
get{
return width;
}set
{
if (kind != PaperKind.Custom)
throw new ArgumentException();
width = value;
}
}
public int Height{
get{
return height;
}set
{
if (kind != PaperKind.Custom)
throw new ArgumentException();
height = value;
}
}
public string PaperName{
get{
return name;
}
set{
if (kind != PaperKind.Custom)
throw new ArgumentException();
name = value;
}
}
public PaperKind Kind{
get{
// .net ignores the values that are less than 0
// the value returned is not used internally, however.
if (kind > PaperKind.PrcEnvelopeNumber10Rotated)
return PaperKind.Custom;
return kind;
}
}
#if NET_2_0
public int RawKind {
get {
return (int)kind;
}
set {
kind = (PaperKind)value;
}
}
#endif
internal bool IsDefault {
get { return this.is_default; }
set { this.is_default = value; }
}
internal void SetKind (PaperKind k) {kind = k;}
public override string ToString(){
string ret = "[PaperSize {0} Kind={1} Height={2} Width={3}]";
return String.Format(ret, this.PaperName, this.Kind, this.Height, this.Width);
}
}
}

View File

@@ -0,0 +1,112 @@
//
// System.Drawing.PaperSource.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
// Herve Poussineau (hpoussineau@fr.st)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Drawing.Printing
{
/// <summary>
/// Summary description for PaperSource.
/// </summary>
#if NET_2_0
[Serializable]
#endif
public class PaperSource
{
private PaperSourceKind kind;
private string source_name;
internal bool is_default;
#if NET_2_0
public PaperSource ()
{
}
#endif
internal PaperSource(string sourceName, PaperSourceKind kind)
{
this.source_name = sourceName;
this.kind = kind;
}
internal PaperSource(string sourceName, PaperSourceKind kind, bool isDefault)
{
this.source_name = sourceName;
this.kind = kind;
this.is_default = IsDefault;
}
public PaperSourceKind Kind{
get {
// Exactly at 256 (as opposed to Custom, which is 257 and the max value of PaperSourceKind),
// we must return Custom always.
if ((int)kind >= 256)
return PaperSourceKind.Custom;
return this.kind;
}
}
public string SourceName{
get {
return this.source_name;
}
#if NET_2_0
set {
this.source_name = value;
}
#endif
}
#if NET_2_0
public int RawKind {
get {
return (int)kind;
}
set {
kind = (PaperSourceKind)value;
}
}
#endif
internal bool IsDefault {
get { return is_default;}
set { is_default = value;}
}
public override string ToString(){
string ret = "[PaperSource {0} Kind={1}]";
return String.Format(ret, this.SourceName, this.Kind);
}
}
}

View File

@@ -0,0 +1,52 @@
//
// System.Drawing.PaperSourceKind.cs
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Author: Dennis Hayes (dennish@raytek.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
public enum PaperSourceKind {
AutomaticFeed = 7,
Cassette = 14,
Custom = 257,
Envelope = 5,
FormSource = 15,
LargeCapacity = 11,
LargeFormat = 10,
Lower = 2,
Manual = 4,
ManualFeed = 6,
Middle = 3,
SmallFormat = 9,
TractorFeed = 8,
Upper = 1
}
}

View File

@@ -0,0 +1,57 @@
//
// System.Drawing.PreviewPageInfo.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Drawing.Printing
{
/// <summary>
/// Summary description for PreviewPageInfo.
/// </summary>
public sealed class PreviewPageInfo {
Image image;
Size physicalSize;
public PreviewPageInfo(Image image, Size physicalSize) {
this.image = image;
this.physicalSize = physicalSize;
}
public Image Image {
get{
return image;
}
}
public Size PhysicalSize{
get{
return physicalSize;
}
}
}
}

View File

@@ -0,0 +1,106 @@
//
// System.Drawing.PreviewPrintController.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.Drawing.Imaging;
namespace System.Drawing.Printing
{
public class PreviewPrintController : PrintController
{
bool useantialias;
ArrayList pageInfoList;
public PreviewPrintController()
{
pageInfoList = new ArrayList ();
}
#if NET_2_0
public override bool IsPreview {
get { return true; }
}
#endif
[MonoTODO]
public override void OnEndPage(PrintDocument document, PrintPageEventArgs e)
{
}
[MonoTODO]
public override void OnStartPrint(PrintDocument document, PrintEventArgs e)
{
if (!document.PrinterSettings.IsValid)
throw new InvalidPrinterException(document.PrinterSettings);
/* maybe we should reuse the images, and clear them? */
foreach (PreviewPageInfo pi in pageInfoList)
pi.Image.Dispose ();
pageInfoList.Clear ();
}
[MonoTODO]
public override void OnEndPrint(PrintDocument document, PrintEventArgs e)
{
}
[MonoTODO]
public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e)
{
Image image = new Bitmap (e.PageSettings.PaperSize.Width, e.PageSettings.PaperSize.Height);
PreviewPageInfo info = new PreviewPageInfo (image, new Size (e.PageSettings.PaperSize.Width,
e.PageSettings.PaperSize.Height));
pageInfoList.Add (info);
Graphics g = Graphics.FromImage (info.Image);
g.FillRectangle (new SolidBrush (Color.White), new Rectangle (new Point (0,0), new Size (image.Width, image.Height)));
return g;
}
public virtual bool UseAntiAlias {
get{ return useantialias; }
set{ useantialias = value; }
}
public PreviewPageInfo [] GetPreviewPageInfo()
{
PreviewPageInfo [] pi = new PreviewPageInfo[pageInfoList.Count];
pageInfoList.CopyTo (pi);
return pi;
}
}
}

View File

@@ -0,0 +1,45 @@
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Authors:
//
// Jordi Mas i Hernandez <jordimash@gmail.com>
//
//
#if NET_2_0
using System;
namespace System.Drawing.Printing
{
public enum PrintAction
{
PrintToFile = 0,
PrintToPreview = 1,
PrintToPrinter = 2
}
}
#endif

View File

@@ -0,0 +1,60 @@
//
// System.Drawing.PrintController.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
//
// (C) 2002 Ximian, Inc
// Copyright (C) 2004, 2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.Drawing.Printing {
public abstract class PrintController {
#if NET_2_0
public virtual bool IsPreview {
get { return false; }
}
#else
public PrintController ()
{
}
#endif
public virtual void OnEndPage (PrintDocument document, PrintPageEventArgs e)
{
}
public virtual void OnStartPrint (PrintDocument document, PrintEventArgs e)
{
}
public virtual void OnEndPrint (PrintDocument document, PrintEventArgs e)
{
}
public virtual Graphics OnStartPage (PrintDocument document, PrintPageEventArgs e)
{
return null;
}
}
}

View File

@@ -0,0 +1,211 @@
//
// System.Drawing.PrintDocument.cs
//
// Authors:
// Dennis Hayes (dennish@Raytek.com)
// Herve Poussineau (hpoussineau@fr.st)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.ComponentModel;
namespace System.Drawing.Printing
{
[DefaultEvent ("PrintPage"), DefaultProperty ("DocumentName")]
[ToolboxItemFilter ("System.Drawing.Printing", ToolboxItemFilterType.Allow)]
public class PrintDocument : System.ComponentModel.Component
{
private PageSettings defaultpagesettings;
private PrinterSettings printersettings;
private PrintController printcontroller;
private string documentname;
private bool originAtMargins = false; // .NET V1.1 Beta
public PrintDocument() {
documentname = "document"; //offical default.
printersettings = new PrinterSettings(); // use default values
defaultpagesettings = (PageSettings) printersettings.DefaultPageSettings.Clone ();
printcontroller = new StandardPrintController();
}
// properties
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
[SRDescription ("The settings for the current page.")]
public PageSettings DefaultPageSettings{
get{
return defaultpagesettings;
}
set{
defaultpagesettings = value;
}
}
// Name of the document, not the file!
[DefaultValue ("document")]
[SRDescription ("The name of the document.")]
public string DocumentName{
get{
return documentname;
}
set{
documentname = value;
}
}
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
[SRDescription ("The print controller object.")]
public PrintController PrintController{
get{
return printcontroller;
}
set{
printcontroller = value;
}
}
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
[SRDescription ("The current settings for the active printer.")]
public PrinterSettings PrinterSettings{
get{
return printersettings;
}
set{
printersettings = value == null ? new PrinterSettings () : value;
}
}
[DefaultValue (false)]
[SRDescription ("Determines if the origin is set at the specified margins.")]
public bool OriginAtMargins{
get{
return originAtMargins;
}
set{
originAtMargins = value;
}
}
// methods
public void Print(){
PrintEventArgs printArgs = new PrintEventArgs();
this.OnBeginPrint(printArgs);
if (printArgs.Cancel)
return;
PrintController.OnStartPrint(this, printArgs);
if (printArgs.Cancel)
return;
Graphics g = null;
if (printArgs.GraphicsContext != null) {
g = Graphics.FromHdc (printArgs.GraphicsContext.Hdc);
printArgs.GraphicsContext.Graphics = g;
}
// while there are more pages
PrintPageEventArgs printPageArgs;
do
{
QueryPageSettingsEventArgs queryPageSettingsArgs = new QueryPageSettingsEventArgs (
DefaultPageSettings.Clone () as PageSettings);
OnQueryPageSettings (queryPageSettingsArgs);
PageSettings pageSettings = queryPageSettingsArgs.PageSettings;
printPageArgs = new PrintPageEventArgs(
g,
pageSettings.Bounds,
new Rectangle(0, 0, pageSettings.PaperSize.Width, pageSettings.PaperSize.Height),
pageSettings);
// TODO: We should create a graphics context for each page since they can have diferent paper
// size, orientation, etc. We use a single graphic for now to keep Cairo using a single PDF file.
printPageArgs.GraphicsContext = printArgs.GraphicsContext;
Graphics pg = PrintController.OnStartPage(this, printPageArgs);
// assign Graphics in printPageArgs
printPageArgs.SetGraphics(pg);
if (!printPageArgs.Cancel)
this.OnPrintPage(printPageArgs);
PrintController.OnEndPage(this, printPageArgs);
if (printPageArgs.Cancel)
break;
} while (printPageArgs.HasMorePages);
this.OnEndPrint(printArgs);
PrintController.OnEndPrint(this, printArgs);
}
public override string ToString(){
return "[PrintDocument " + this.DocumentName + "]";
}
// events
protected virtual void OnBeginPrint(PrintEventArgs e){
//fire the event
if (BeginPrint != null)
BeginPrint(this, e);
}
protected virtual void OnEndPrint(PrintEventArgs e){
//fire the event
if (EndPrint != null)
EndPrint(this, e);
}
protected virtual void OnPrintPage(PrintPageEventArgs e){
//fire the event
if (PrintPage != null)
PrintPage(this, e);
}
protected virtual void OnQueryPageSettings(QueryPageSettingsEventArgs e){
//fire the event
if (QueryPageSettings != null)
QueryPageSettings(this, e);
}
[SRDescription ("Raised when printing begins")]
public event PrintEventHandler BeginPrint;
[SRDescription ("Raised when printing ends")]
public event PrintEventHandler EndPrint;
[SRDescription ("Raised when printing of a new page begins")]
public event PrintPageEventHandler PrintPage;
[SRDescription ("Raised before printing of a new page begins")]
public event QueryPageSettingsEventHandler QueryPageSettings;
}
}

View File

@@ -0,0 +1,60 @@
//
// System.Drawing.PrintEventArgs.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
//NOTE: Complete! Aparently just a redifiniton of CancleEventArgs specific to Printing.
namespace System.Drawing.Printing
{
/// <summary>
/// Summary description for PrintEventArgs.
/// </summary>
public class PrintEventArgs : System.ComponentModel.CancelEventArgs
{
private GraphicsPrinter graphics_context;
#if NET_2_0
internal PrintAction action;
#endif
public PrintEventArgs()
{
}
#if NET_2_0
public PrintAction PrintAction {
get { return action; }
}
#endif
internal GraphicsPrinter GraphicsContext {
get { return graphics_context; }
set { graphics_context = value; }
}
}
}

View File

@@ -0,0 +1,40 @@
//
// System.Drawing.PrintEventHandler.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Drawing.Printing
{
/// <summary>
/// Summary description for PrintEventHandler.
/// </summary>
public delegate void PrintEventHandler(object sender, PrintEventArgs e);
}

View File

@@ -0,0 +1,103 @@
//
// System.Drawing.PrintPageEventArgs.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
// Herve Poussineau (hpoussineau@fr.st)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Drawing;
namespace System.Drawing.Printing {
/// <summary>
/// Summary description for PrintPageEventArgs.
/// </summary>
public class PrintPageEventArgs : EventArgs {
bool cancel;
Graphics graphics;
bool hasmorePages;
Rectangle marginBounds;
Rectangle pageBounds;
PageSettings pageSettings;
GraphicsPrinter graphics_context;
public PrintPageEventArgs(Graphics graphics, Rectangle marginBounds,
Rectangle pageBounds, PageSettings pageSettings) {
this.graphics = graphics;
this.marginBounds = marginBounds;
this.pageBounds = pageBounds;
this.pageSettings = pageSettings;
}
public bool Cancel {
get{
return cancel;
}
set{
cancel = value;
}
}
public Graphics Graphics {
get{
return graphics;
}
}
public bool HasMorePages {
get{
return hasmorePages;
}
set{
hasmorePages = value;
}
}
public Rectangle MarginBounds {
get{
return marginBounds;
}
}
public Rectangle PageBounds {
get{
return pageBounds;
}
}
public PageSettings PageSettings {
get{
return pageSettings;
}
}
// used in PrintDocument.Print()
internal void SetGraphics(Graphics g)
{
graphics = g;
}
internal GraphicsPrinter GraphicsContext {
get { return graphics_context; }
set { graphics_context = value; }
}
}
}

View File

@@ -0,0 +1,40 @@
//
// System.Drawing.PrintPageEventHandler.cs
//
// Author:
// Dennis Hayes (dennish@Raytek.com)
//
// (C) 2002 Ximian, Inc
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Drawing.Printing
{
/// <summary>
/// Summary description for PrintPageEventHandler.
/// </summary>
public delegate void PrintPageEventHandler(object sender, PrintPageEventArgs e);
}

View File

@@ -0,0 +1,44 @@
//
// System.Drawing.PrintRange.cs
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Author: Dennis Hayes (dennish@raytek.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
public enum PrintRange {
AllPages = 0,
Selection = 1,
SomePages = 2,
#if NET_2_0
CurrentPage = 0x400000
#endif
}
}

Some files were not shown because too many files have changed in this diff Show More