[appkit] Add helper properties for the NSPrintInfo PrintCore methods. Fixes #52501 (#1740)

* Add helper properties for the PrintCore methods that return the correct types instead of IntPtrs

* NSPrintInfo make bindings internal and change manual properties to getter methods

https://bugzilla.xamarin.com/show_bug.cgi?id=52501
This commit is contained in:
Timothy Risi 2017-02-23 17:03:58 -09:00 коммит произвёл Sebastien Pouliot
Родитель 87b2e73248
Коммит 8a6cfbe544
3 изменённых файлов: 34 добавлений и 0 удалений

24
src/AppKit/NSPrintInfo.cs Normal file
Просмотреть файл

@ -0,0 +1,24 @@
using System;
using XamCore.PrintCore;
namespace XamCore.AppKit {
public partial class NSPrintInfo {
public PMPrintSession GetPrintSession ()
{
var ptr = GetPMPrintSession ();
return new PMPrintSession (ptr, false);
}
public PMPageFormat GetPageFormat ()
{
var ptr = GetPMPageFormat ();
return new PMPageFormat (ptr, false);
}
public PMPrintSettings GetPrintSettings ()
{
var ptr = GetPMPrintSettings ();
return new PMPrintSettings (ptr, false);
}
}
}

Просмотреть файл

@ -11808,12 +11808,21 @@ namespace XamCore.AppKit {
[Export ("printSettings")] [Export ("printSettings")]
NSMutableDictionary PrintSettings { get; } NSMutableDictionary PrintSettings { get; }
#if XAMCORE_4_0
[Internal]
#endif
[Export ("PMPrintSession")] [Export ("PMPrintSession")]
IntPtr GetPMPrintSession (); IntPtr GetPMPrintSession ();
#if XAMCORE_4_0
[Internal]
#endif
[Export ("PMPageFormat")] [Export ("PMPageFormat")]
IntPtr GetPMPageFormat (); IntPtr GetPMPageFormat ();
#if XAMCORE_4_0
[Internal]
#endif
[Export ("PMPrintSettings")] [Export ("PMPrintSettings")]
IntPtr GetPMPrintSettings (); IntPtr GetPMPrintSettings ();

Просмотреть файл

@ -118,6 +118,7 @@ APPKIT_SOURCES = \
AppKit/NSPopUpButton.cs \ AppKit/NSPopUpButton.cs \
AppKit/NSPopUpButtonCell.cs \ AppKit/NSPopUpButtonCell.cs \
AppKit/NSPredicateEditorRowTemplate.cs \ AppKit/NSPredicateEditorRowTemplate.cs \
AppKit/NSPrintInfo.cs \
AppKit/NSPrintPanel.cs \ AppKit/NSPrintPanel.cs \
AppKit/NSResponder.cs \ AppKit/NSResponder.cs \
AppKit/NSScreen.cs \ AppKit/NSScreen.cs \