Minor fixes which make System.Drawing compatible with netstandard1.6:
- Use MemoryStream.ToArray instead of .GetBuffer
- Use RuntimeInformation.IsOSPlatform to determine the operating system
- Use Stream.Dispose instead of Stream.Close
- Disable serialization support for exceptions
- Don't use AppDomain
* netstandard1.6 compatibility: Use GetTypeInfo () where required
A lot of methods have moved from Type to TypeInfo in netstandard1.6, add calls to GetTypeInfo ()
where required to support compiling System.Drawing on netstandard1.6
* Add missing using statement
There is already a test case for that (PrintingServicesUnixTest.cs,
Bug602934_PrinterSettingsReturnActualValues) which fails when user
configured options are different from PPD settings. Patch also makes
this test not to fail if "Resolution" option is not present in CUPS
options.
*Update: removed leftover debug Console.WriteLine from patch
This is a scripted conversion of mixed line-ending files to LF-only or CRLF-only
based on which patch is smaller. I used a threshold of upto a quarter of the
lines to determine whether to keep the patch or not.
This set of .gitattributes was automatically generated from the list of files
that GIT tried to normalize when I enabled automatic EOL conversion.
With this set of attributes, we prevent automated EOL conversion on files that
we know will cause trouble down the road.
* PrintingServicesUnix.cs: Fix potential crash on 64bit OS. Gendarme
rule for checking IntPtr has been updated to cover this case as well
svn path=/trunk/mcs/; revision=117611
* 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.
svn path=/trunk/mcs/; revision=78135
* 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.
svn path=/trunk/mcs/; revision=77837
* 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 )
svn path=/trunk/mcs/; revision=73264
* PrintingServicesUnix.cs: Fix leak caused by not calling cupsFreeDests
on certain codepaths. Fix return value of cupsFreeDests to void.
svn path=/trunk/mcs/; revision=73208
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.
svn path=/trunk/mcs/; revision=73048
* PrintingServicesUnix.cs: Ensure we free the original pointer in
GetAlternativeDefaultPrinter (not the one used for iteration).
svn path=/trunk/mcs/; revision=72542
* PrintingServicesUnix.cs: Add "landscape" option
when using PaperSettings.Landscape set to true. Also
swap the width and height for the postscript file.
svn path=/trunk/mcs/; revision=69014
* 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
svn path=/trunk/mcs/; revision=68872
* 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.
svn path=/trunk/mcs/; revision=68849
* Form.cs: Removed call to UpdateBounds on Form
constructor, it was causing a call to CreateHandle
before it was supposed to.
* PrintControllerWithStatusDialog: Applied patch
by Chris Toshok to hide controller when there are
no printers available.
PrintDialog.cs: initialize printer settings to
null - correct DefaultValues test #5
* PrintPreviewControl.cs: Move PrintController
initialization to GeneratePreview
* PrintPreviewDialog.cs:
- Remove Preview generation from Document_set(). It is
called on OnPaint
- Throw InvalidPrinterException on CreateHandle if
a Document is set but there are no printers or
printer is not valid.
* ThemeWin32Classic: don't paint PrintPreviewControl
if there is nothing to paint
* 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
svn path=/trunk/mcs/; revision=68635
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).
svn path=/trunk/mcs/; revision=68449
* 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).
svn path=/trunk/mcs/; revision=68030