Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -30,9 +30,7 @@
using System;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
public enum Duplex {
Default = -1,
Horizontal = 3,

View File

@@ -35,9 +35,7 @@ using System.Security.Permissions;
namespace System.Drawing.Printing {
#if NET_2_0
[Serializable]
#endif
public class InvalidPrinterException : SystemException {
// private PrinterSettings settings;

View File

@@ -33,9 +33,7 @@ using System.ComponentModel;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
[TypeConverter (typeof (MarginsConverter))]
public class Margins : ICloneable {
int left;
@@ -138,7 +136,6 @@ namespace System.Drawing.Printing
return String.Format (ret, left, right, top, bottom);
}
#if NET_2_0
public static bool operator == (Margins m1, Margins m2)
{
// avoid recursion with == operator
@@ -154,6 +151,5 @@ namespace System.Drawing.Printing
return ((object)m2 != null);
return !m1.Equals (m2);
}
#endif
}
}

View File

@@ -37,11 +37,7 @@ using System.Runtime.InteropServices;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#else
[ComVisible (false)]
#endif
public class PageSettings : ICloneable
{
internal bool color;
@@ -53,11 +49,9 @@ namespace System.Drawing.Printing
// 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())
@@ -182,7 +176,6 @@ namespace System.Drawing.Printing
printerSettings = value;
}
}
#if NET_2_0
public float HardMarginX {
get {
return hardMarginX;
@@ -200,7 +193,6 @@ namespace System.Drawing.Printing
return printableArea;
}
}
#endif
public object Clone ()

View File

@@ -31,9 +31,7 @@ using System;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
public enum PaperKind
{
A2 = 66,

View File

@@ -37,9 +37,7 @@ namespace System.Drawing.Printing
/// <summary>
/// Summary description for PaperSize.
/// </summary>
#if NET_2_0
[Serializable]
#endif
public class PaperSize
{
string name;
@@ -48,12 +46,10 @@ namespace System.Drawing.Printing
PaperKind kind;
internal bool is_default;
#if NET_2_0
public PaperSize ()
{
}
#endif
public PaperSize(string name, int width, int height)
{
this.width = width;
@@ -111,7 +107,6 @@ namespace System.Drawing.Printing
return kind;
}
}
#if NET_2_0
public int RawKind {
get {
return (int)kind;
@@ -121,7 +116,6 @@ namespace System.Drawing.Printing
}
}
#endif
internal bool IsDefault {
get { return this.is_default; }

View File

@@ -37,21 +37,17 @@ 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)
{
@@ -80,14 +76,11 @@ namespace System.Drawing.Printing
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;
@@ -96,7 +89,6 @@ namespace System.Drawing.Printing
kind = (PaperSourceKind)value;
}
}
#endif
internal bool IsDefault {
get { return is_default;}

View File

@@ -30,9 +30,7 @@
using System;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
public enum PaperSourceKind {
AutomaticFeed = 7,
Cassette = 14,

View File

@@ -45,11 +45,9 @@ namespace System.Drawing.Printing
{
pageInfoList = new ArrayList ();
}
#if NET_2_0
public override bool IsPreview {
get { return true; }
}
#endif
[MonoTODO]
public override void OnEndPage(PrintDocument document, PrintPageEventArgs e)

View File

@@ -26,7 +26,6 @@
//
//
#if NET_2_0
using System;
@@ -41,5 +40,4 @@ namespace System.Drawing.Printing
}
#endif

View File

@@ -31,15 +31,9 @@ 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)
{
}

View File

@@ -39,18 +39,14 @@ namespace System.Drawing.Printing
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; }

View File

@@ -30,15 +30,11 @@
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
}
}

View File

@@ -36,24 +36,16 @@ using System;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
public class PrinterResolution
{
private PrinterResolutionKind kind = PrinterResolutionKind.Custom;
private int x;
private int y;
#if NET_2_0
public PrinterResolution ()
{
}
#else
private PrinterResolution ()
{
}
#endif
internal PrinterResolution (int x, int y, PrinterResolutionKind kind)
{
@@ -66,33 +58,27 @@ namespace System.Drawing.Printing
get {
return x;
}
#if NET_2_0
set {
x = value;
}
#endif
}
public int Y {
get {
return y;
}
#if NET_2_0
set {
y = value;
}
#endif
}
public PrinterResolutionKind Kind {
get {
return kind;
}
#if NET_2_0
set {
kind = value;
}
#endif
}
public override string ToString ()

View File

@@ -30,9 +30,7 @@
using System;
namespace System.Drawing.Printing
{
#if NET_2_0
[Serializable]
#endif
public enum PrinterResolutionKind {
Custom = 0,
Draft = -1,

View File

@@ -38,9 +38,6 @@ using System.Drawing.Imaging;
namespace System.Drawing.Printing
{
[Serializable]
#if ! NET_2_0
[ComVisible(false)]
#endif
public class PrinterSettings : ICloneable
{
private string printer_name;
@@ -219,11 +216,7 @@ namespace System.Drawing.Printing
return paper_sources;
}
}
#if NET_2_0
public
#else
internal
#endif
string PrintFileName
{
get { return print_filename; }
@@ -310,7 +303,6 @@ namespace System.Drawing.Printing
{
throw new NotImplementedException();
}
#if NET_2_0
[MonoTODO("PrinterSettings.CreateMeasurementGraphics")]
public Graphics CreateMeasurementGraphics(bool honorOriginAtMargins)
{
@@ -328,7 +320,6 @@ namespace System.Drawing.Printing
{
throw new NotImplementedException();
}
#endif
[MonoTODO("PrinterSettings.GetHdevmode")]
public IntPtr GetHdevmode()
@@ -348,7 +339,6 @@ namespace System.Drawing.Printing
throw new NotImplementedException();
}
#if NET_2_0
[MonoTODO("IsDirectPrintingSupported")]
public bool IsDirectPrintingSupported (Image image)
@@ -361,7 +351,6 @@ namespace System.Drawing.Printing
{
throw new NotImplementedException();
}
#endif
[MonoTODO("PrinterSettings.SetHdevmode")]
public void SetHdevmode(IntPtr hdevmode)
@@ -400,13 +389,9 @@ namespace System.Drawing.Printing
int ICollection.Count { get { return _PaperSources.Count; } }
bool ICollection.IsSynchronized { get { return false; } }
object ICollection.SyncRoot { get { return this; } }
#if NET_2_0
[EditorBrowsable(EditorBrowsableState.Never)]
public int Add (PaperSource paperSource) {return _PaperSources.Add (paperSource); }
public void CopyTo (PaperSource[] paperSources, int index) {throw new NotImplementedException (); }
#else
internal int Add (PaperSource paperSource) {return _PaperSources.Add (paperSource); }
#endif
public virtual PaperSource this[int index] {
get { return _PaperSources[index] as PaperSource; }
@@ -447,13 +432,9 @@ namespace System.Drawing.Printing
int ICollection.Count { get { return _PaperSizes.Count; } }
bool ICollection.IsSynchronized { get { return false; } }
object ICollection.SyncRoot { get { return this; } }
#if NET_2_0
[EditorBrowsable(EditorBrowsableState.Never)]
public int Add (PaperSize paperSize) {return _PaperSizes.Add (paperSize); }
public void CopyTo (PaperSize[] paperSizes, int index) {throw new NotImplementedException (); }
#else
internal int Add (PaperSize paperSize) {return _PaperSizes.Add (paperSize); }
#endif
public virtual PaperSize this[int index] {
get { return _PaperSizes[index] as PaperSize; }
@@ -493,13 +474,9 @@ namespace System.Drawing.Printing
int ICollection.Count { get { return _PrinterResolutions.Count; } }
bool ICollection.IsSynchronized { get { return false; } }
object ICollection.SyncRoot { get { return this; } }
#if NET_2_0
[EditorBrowsable(EditorBrowsableState.Never)]
public int Add (PrinterResolution printerResolution) { return _PrinterResolutions.Add (printerResolution); }
public void CopyTo (PrinterResolution[] printerResolutions, int index) {throw new NotImplementedException (); }
#else
internal int Add (PrinterResolution printerResolution) { return _PrinterResolutions.Add (printerResolution); }
#endif
public virtual PrinterResolution this[int index] {
get { return _PrinterResolutions[index] as PrinterResolution; }
@@ -543,13 +520,9 @@ namespace System.Drawing.Printing
public virtual string this[int index] {
get { return _Strings[index] as string; }
}
#if NET_2_0
[EditorBrowsable(EditorBrowsableState.Never)]
public int Add (string value) { return _Strings.Add (value); }
public void CopyTo (string[] strings, int index) {throw new NotImplementedException (); }
#else
internal int Add (string value) { return _Strings.Add (value); }
#endif
IEnumerator IEnumerable.GetEnumerator()
{

View File

@@ -199,17 +199,10 @@ namespace System.Drawing.Printing {
throw new ArgumentNullException (parameterName);
string c = se.Attribute ("class");
#if NET_2_0
if (c == null) {
string msg = Locale.GetText ("Missing 'class' attribute.");
throw new ArgumentException (msg, parameterName);
}
#else
if ((c == null) || (String.Compare (c, 0, "System.Drawing.Printing.PrintingPermission", 0, 42) != 0)) {
string msg = Locale.GetText ("Wrong 'class' attribute.");
throw new ArgumentException (msg, parameterName);
}
#endif
// we assume minimum version if no version number is supplied
int version = minimumVersion;
string v = se.Attribute ("version");
@@ -223,12 +216,6 @@ namespace System.Drawing.Printing {
throw new ArgumentException (msg, parameterName, e);
}
}
#if !NET_2_0
else {
string msg = Locale.GetText ("Missing 'version' attribute.");
throw new ArgumentException (msg, parameterName);
}
#endif
if ((version < minimumVersion) || (version > maximumVersion)) {
string msg = Locale.GetText ("Unknown version '{0}', expected versions between ['{1}','{2}'].");

View File

@@ -29,9 +29,7 @@
namespace System.Drawing.Printing {
#if NET_2_0
[Serializable]
#endif
public enum PrintingPermissionLevel {
AllPrinting = 3,
DefaultPrinting = 2,