Merge pull request #852 from spouliot/intro-model
[test][intro] Check for API parameters that are [Model] and not the [Protocol] interface
This commit is contained in:
Коммит
d2cbd993ad
|
@ -26,10 +26,18 @@ namespace XamCore.AVFoundation {
|
|||
throw new NotSupportedException ("NS_UNAVAILABLE");
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Obsolete ("Use the overload with a `INSUrlSessionDelegate` parameter.")]
|
||||
public new static NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration, NSUrlSessionDelegate sessionDelegate, NSOperationQueue delegateQueue)
|
||||
{
|
||||
throw new NotSupportedException ("NS_UNAVAILABLE");
|
||||
}
|
||||
#endif
|
||||
|
||||
public new static NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration, INSUrlSessionDelegate sessionDelegate, NSOperationQueue delegateQueue)
|
||||
{
|
||||
throw new NotSupportedException ("NS_UNAVAILABLE");
|
||||
}
|
||||
|
||||
public new static NSUrlSession FromWeakConfiguration (NSUrlSessionConfiguration configuration, NSObject weakDelegate, NSOperationQueue delegateQueue)
|
||||
{
|
||||
|
|
|
@ -280,6 +280,7 @@ namespace XamCore.AVFoundation {
|
|||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[Obsolete ("Use the overload with a `INSUrlSessionDelegate` parameter.")]
|
||||
public new static NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration, NSUrlSessionDelegate sessionDelegate, NSOperationQueue delegateQueue)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
|
|
|
@ -13,6 +13,15 @@ namespace XamCore.NetworkExtension {
|
|||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class NEPacketTunnelProvider {
|
||||
|
||||
[Obsolete ("Use the overload accepting a INWTcpConnectionAuthenticationDelegate argument")]
|
||||
public virtual NWTcpConnection CreateTcpConnection (NWEndpoint remoteEndpoint, bool enableTls, NWTlsParameters tlsParameters, NWTcpConnectionAuthenticationDelegate @delegate)
|
||||
{
|
||||
return CreateTcpConnection (remoteEndpoint, enableTls, tlsParameters, (INWTcpConnectionAuthenticationDelegate) @delegate);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
|
||||
using System;
|
||||
using XamCore.CoreGraphics;
|
||||
|
||||
namespace XamCore.UIKit {
|
||||
|
||||
|
@ -77,5 +78,16 @@ namespace XamCore.UIKit {
|
|||
{
|
||||
}
|
||||
}
|
||||
|
||||
#if !TVOS
|
||||
public partial class UIPreviewInteraction {
|
||||
[Obsolete ("Use overload accepting a IUICoordinateSpace")]
|
||||
public virtual CGPoint GetLocationInCoordinateSpace (UICoordinateSpace coordinateSpace)
|
||||
{
|
||||
return GetLocationInCoordinateSpace ((IUICoordinateSpace) coordinateSpace);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -18,7 +18,8 @@ using XamCore.Foundation;
|
|||
namespace XamCore.UIKit {
|
||||
public partial class UIActionSheet : IEnumerable {
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Obsolete ("Use overload with a IUIActionSheetDelegate parameter")]
|
||||
public UIActionSheet (string title, UIActionSheetDelegate del, string cancelTitle, string destroy, params string [] other)
|
||||
: this (title, del as IUIActionSheetDelegate, cancelTitle, destroy, other)
|
||||
{
|
||||
|
@ -46,7 +47,8 @@ namespace XamCore.UIKit {
|
|||
CancelButtonIndex = AddButton (cancelTitle);
|
||||
}
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Obsolete ("Use overload with a IUIActionSheetDelegate parameter")]
|
||||
public UIActionSheet (string title, UIActionSheetDelegate del)
|
||||
: this (title, del as IUIActionSheetDelegate, null, null, (string) null)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ using XamCore.Foundation;
|
|||
|
||||
namespace XamCore.UIKit {
|
||||
public partial class UIAlertView {
|
||||
public UIAlertView (string title, string message, UIAlertViewDelegate del, string cancelButtonTitle, params string [] otherButtons)
|
||||
public UIAlertView (string title, string message, IUIAlertViewDelegate del, string cancelButtonTitle, params string [] otherButtons)
|
||||
: this (title, message, del, cancelButtonTitle, otherButtons == null || otherButtons.Length == 0 ? IntPtr.Zero : new NSString (otherButtons [0]).Handle, IntPtr.Zero, IntPtr.Zero)
|
||||
{
|
||||
if (otherButtons == null)
|
||||
|
@ -26,6 +26,12 @@ namespace XamCore.UIKit {
|
|||
for (int i = 1; i < otherButtons.Length; i++)
|
||||
AddButton (otherButtons [i]);
|
||||
}
|
||||
|
||||
[Obsolete ("Use overload with a IUIAlertViewDelegate parameter")]
|
||||
public UIAlertView (string title, string message, UIAlertViewDelegate del, string cancelButtonTitle, params string [] otherButtons)
|
||||
: this (title, message, (IUIAlertViewDelegate) del, cancelButtonTitle, otherButtons)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,8 +66,12 @@ namespace XamCore.WebKit {
|
|||
callback (evt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if XAMCORE_4_0
|
||||
public IDomEventListener AddEventListener (string type, DomEventListenerHandler handler, bool useCapture)
|
||||
#else
|
||||
public DomEventListener AddEventListener (string type, DomEventListenerHandler handler, bool useCapture)
|
||||
#endif
|
||||
{
|
||||
if (handler == null)
|
||||
throw new ArgumentNullException ("handler");
|
||||
|
@ -76,7 +80,11 @@ namespace XamCore.WebKit {
|
|||
return obj;
|
||||
}
|
||||
|
||||
#if XAMCORE_4_0
|
||||
public IDomEventListener AddEventListener (string type, Action<DomEvent> callback, bool useCapture)
|
||||
#else
|
||||
public DomEventListener AddEventListener (string type, Action<DomEvent> callback, bool useCapture)
|
||||
#endif
|
||||
{
|
||||
if (callback == null)
|
||||
throw new ArgumentNullException ("callback");
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace XamCore.AppKit {
|
|||
[Sealed] // Just to avoid the duplicate selector error
|
||||
IntPtr Constructor (double duration, NSAnimationCurve animationCurve);
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Obsolete ("Use the constructor instead")]
|
||||
[Export ("initWithDuration:animationCurve:")]
|
||||
IntPtr Constant (double duration, NSAnimationCurve animationCurve);
|
||||
|
@ -7611,7 +7611,7 @@ namespace XamCore.AppKit {
|
|||
[Export ("menuDidClose:")]
|
||||
void MenuDidClose (NSMenu menu);
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("menu:willHighlightItem:")]
|
||||
|
@ -8216,7 +8216,7 @@ namespace XamCore.AppKit {
|
|||
nint RunModal (string [] types);
|
||||
}
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
// This class doesn't show up in any documentation
|
||||
[BaseType (typeof (NSOpenPanel))]
|
||||
[DisableDefaultCtor] // should not be created by (only returned to) user code
|
||||
|
@ -11154,7 +11154,7 @@ namespace XamCore.AppKit {
|
|||
interface INSPasteboardWriting {}
|
||||
|
||||
[BaseType (typeof (NSObject))]
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
// A class that implements only NSPasteboardReading does not make sense, it's
|
||||
// used to add pasteboard support to existing classes.
|
||||
[Model]
|
||||
|
@ -11169,7 +11169,7 @@ namespace XamCore.AppKit {
|
|||
[Export ("readingOptionsForType:pasteboard:")]
|
||||
NSPasteboardReadingOptions GetReadingOptionsForType (string type, NSPasteboard pasteboard);
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
// This binding is just broken, it's an ObjC ctor (init*) bound as a normal method.
|
||||
[Abstract]
|
||||
[Export ("xamarinselector:removed:")]
|
||||
|
@ -12520,7 +12520,7 @@ namespace XamCore.AppKit {
|
|||
|
||||
}
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
// This class doesn't show up in any documentation.
|
||||
[BaseType (typeof (NSSavePanel))]
|
||||
[DisableDefaultCtor] // should not be created by (only returned to) user code
|
||||
|
@ -14505,102 +14505,102 @@ namespace XamCore.AppKit {
|
|||
|
||||
[Lion]
|
||||
[Protocol]
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Model]
|
||||
[BaseType (typeof (NSObject))]
|
||||
#endif
|
||||
partial interface NSTextFinderClient {
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("allowsMultipleSelection")]
|
||||
bool AllowsMultipleSelection { get; }
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("editable")]
|
||||
bool Editable { [Bind ("isEditable")] get; }
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("string", ArgumentSemantic.Copy)]
|
||||
string String { get; }
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("firstSelectedRange")]
|
||||
NSRange FirstSelectedRange { get; }
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("selectedRanges", ArgumentSemantic.Copy)]
|
||||
NSArray SelectedRanges { get; set; }
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("visibleCharacterRanges", ArgumentSemantic.Copy)]
|
||||
NSArray VisibleCharacterRanges { get; }
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("selectable")]
|
||||
bool Selectable { [Bind ("isSelectable")] get; }
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("stringAtIndex:effectiveRange:endsWithSearchBoundary:")]
|
||||
string StringAtIndexeffectiveRangeendsWithSearchBoundary (nuint characterIndex, ref NSRange outRange, bool outFlag);
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("stringLength")]
|
||||
nuint StringLength ();
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("scrollRangeToVisible:")]
|
||||
void ScrollRangeToVisible (NSRange range);
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("shouldReplaceCharactersInRanges:withStrings:")]
|
||||
bool ShouldReplaceCharactersInRangeswithStrings (NSArray ranges, NSArray strings);
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("replaceCharactersInRange:withString:")]
|
||||
void ReplaceCharactersInRangewithString (NSRange range, string str);
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("didReplaceCharacters")]
|
||||
void DidReplaceCharacters ();
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("contentViewAtIndex:effectiveCharacterRange:")]
|
||||
NSView ContentViewAtIndexeffectiveCharacterRange (nuint index, ref NSRange outRange);
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("rectsForCharacterRange:")]
|
||||
NSArray RectsForCharacterRange (NSRange range);
|
||||
|
||||
#if !XAMCORE_3_0
|
||||
#if !XAMCORE_4_0
|
||||
[Abstract]
|
||||
#endif
|
||||
[Export ("drawCharactersInRange:forContentView:")]
|
||||
|
@ -16549,10 +16549,11 @@ namespace XamCore.AppKit {
|
|||
// This is the mixed NSTableViewDataSource and NSTableViewDelegate
|
||||
//
|
||||
[Model]
|
||||
[Synthetic]
|
||||
[BaseType (typeof (NSObject))]
|
||||
interface NSTableViewSource {
|
||||
//
|
||||
// These come form NSTableViewDataSource
|
||||
// These come from NSTableViewDataSource
|
||||
//
|
||||
[Export ("tableView:willDisplayCell:forTableColumn:row:")]
|
||||
void WillDisplayCell (NSTableView tableView, NSObject cell, NSTableColumn tableColumn, nint row);
|
||||
|
|
|
@ -7943,13 +7943,16 @@ namespace XamCore.AVFoundation {
|
|||
[Export ("alwaysDiscardsLateVideoFrames")]
|
||||
bool AlwaysDiscardsLateVideoFrames { get; set; }
|
||||
|
||||
#if !XAMARIN_4_0
|
||||
[Obsolete ("Use overload accepting a IAVCaptureVideoDataOutputSampleBufferDelegate")]
|
||||
[Export ("setSampleBufferDelegate:queue:")]
|
||||
[PostGet ("SampleBufferDelegate")]
|
||||
[PostGet ("SampleBufferCallbackQueue")]
|
||||
void SetSampleBufferDelegate ([NullAllowed] AVCaptureVideoDataOutputSampleBufferDelegate sampleBufferDelegate, [NullAllowed] DispatchQueue sampleBufferCallbackQueue);
|
||||
|
||||
[Export ("setSampleBufferDelegate:queue:")]
|
||||
[Sealed]
|
||||
#endif
|
||||
[Export ("setSampleBufferDelegate:queue:")]
|
||||
void SetSampleBufferDelegateQueue ([NullAllowed] IAVCaptureVideoDataOutputSampleBufferDelegate sampleBufferDelegate, [NullAllowed] DispatchQueue sampleBufferCallbackQueue);
|
||||
|
||||
// 5.0 APIs
|
||||
|
@ -7998,16 +8001,22 @@ namespace XamCore.AVFoundation {
|
|||
[Export ("sampleBufferCallbackQueue")]
|
||||
DispatchQueue SampleBufferCallbackQueue { get; }
|
||||
|
||||
#if XAMCORE_4_0
|
||||
[Export ("setSampleBufferDelegate:queue:")]
|
||||
void SetSampleBufferDelegate ([NullAllowed] IAVCaptureAudioDataOutputSampleBufferDelegate sampleBufferDelegate, [NullAllowed] DispatchQueue sampleBufferCallbackDispatchQueue);
|
||||
#else
|
||||
[Export ("setSampleBufferDelegate:queue:")]
|
||||
[Sealed]
|
||||
void SetSampleBufferDelegateQueue ([NullAllowed] IAVCaptureAudioDataOutputSampleBufferDelegate sampleBufferDelegate, [NullAllowed] DispatchQueue sampleBufferCallbackDispatchQueue);
|
||||
|
||||
[Obsolete ("Use overload accepting a IAVCaptureVideoDataOutputSampleBufferDelegate")]
|
||||
[Export ("setSampleBufferDelegate:queue:")]
|
||||
#if XAMCORE_2_0
|
||||
void SetSampleBufferDelegateQueue ([NullAllowed] AVCaptureAudioDataOutputSampleBufferDelegate sampleBufferDelegate, [NullAllowed] DispatchQueue sampleBufferCallbackDispatchQueue);
|
||||
#else
|
||||
void SetSampleBufferDelegatequeue ([NullAllowed] AVCaptureAudioDataOutputSampleBufferDelegate sampleBufferDelegate, [NullAllowed] DispatchQueue sampleBufferCallbackDispatchQueue);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !MONOMAC
|
||||
[Since (7,0)]
|
||||
|
|
|
@ -5768,6 +5768,8 @@ namespace XamCore.Foundation
|
|||
|
||||
delegate void NSUrlDownloadSessionResponse (NSUrl location, NSUrlResponse response, NSError error);
|
||||
|
||||
interface INSUrlSessionDelegate {}
|
||||
|
||||
//
|
||||
// Some of the XxxTaskWith methods that take a completion were flagged as allowing a null in
|
||||
// 083d9cba1eb997eac5c5ded77db32180c3eef566 with comment:
|
||||
|
@ -5797,9 +5799,14 @@ namespace XamCore.Foundation
|
|||
[Static, Export ("sessionWithConfiguration:delegate:delegateQueue:")]
|
||||
NSUrlSession FromWeakConfiguration (NSUrlSessionConfiguration configuration, [NullAllowed] NSObject weakDelegate, [NullAllowed] NSOperationQueue delegateQueue);
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Obsolete ("Use the overload with a `INSUrlSessionDelegate` parameter.")]
|
||||
[Static, Wrap ("FromWeakConfiguration (configuration, sessionDelegate, delegateQueue);")]
|
||||
NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration, NSUrlSessionDelegate sessionDelegate, NSOperationQueue delegateQueue);
|
||||
|
||||
#endif
|
||||
[Static, Wrap ("FromWeakConfiguration (configuration, (NSObject) sessionDelegate, delegateQueue);")]
|
||||
NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration, INSUrlSessionDelegate sessionDelegate, NSOperationQueue delegateQueue);
|
||||
|
||||
[Export ("delegateQueue", ArgumentSemantic.Retain)]
|
||||
NSOperationQueue DelegateQueue { get; }
|
||||
|
||||
|
@ -10536,6 +10543,8 @@ namespace XamCore.Foundation
|
|||
#endif
|
||||
delegate void NSFileCoordinatorWorkerRW (NSUrl newReadingUrl, NSUrl newWritingUrl);
|
||||
|
||||
interface INSFilePresenter {}
|
||||
|
||||
[Since (5,0)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
interface NSFileCoordinator {
|
||||
|
@ -10553,7 +10562,13 @@ namespace XamCore.Foundation
|
|||
|
||||
[DesignatedInitializer]
|
||||
[Export ("initWithFilePresenter:")]
|
||||
IntPtr Constructor ([NullAllowed] INSFilePresenter filePresenterOrNil);
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Obsolete ("Use .ctor(INSFilePresenter) instead")]
|
||||
[Wrap ("this ((INSFilePresenter) filePresenterOrNil)")]
|
||||
IntPtr Constructor ([NullAllowed] NSFilePresenter filePresenterOrNil);
|
||||
#endif
|
||||
|
||||
[Export ("coordinateReadingItemAtURL:options:error:byAccessor:")]
|
||||
#if XAMCORE_2_0
|
||||
|
|
|
@ -1170,6 +1170,8 @@ namespace XamCore.NetworkExtension {
|
|||
void WriteClose ();
|
||||
}
|
||||
|
||||
interface INWTcpConnectionAuthenticationDelegate {}
|
||||
|
||||
[iOS (9,0)][Mac (10,11, onlyOn64 : true)]
|
||||
[Protocol, Model]
|
||||
[BaseType (typeof (NSObject), Name = "NWTCPConnectionAuthenticationDelegate")]
|
||||
|
@ -1352,7 +1354,7 @@ namespace XamCore.NetworkExtension {
|
|||
NEPacketTunnelFlow PacketFlow { get; }
|
||||
|
||||
[Export ("createTCPConnectionThroughTunnelToEndpoint:enableTLS:TLSParameters:delegate:")]
|
||||
NWTcpConnection CreateTcpConnection (NWEndpoint remoteEndpoint, bool enableTls, [NullAllowed] NWTlsParameters tlsParameters, [NullAllowed] NWTcpConnectionAuthenticationDelegate @delegate);
|
||||
NWTcpConnection CreateTcpConnection (NWEndpoint remoteEndpoint, bool enableTls, [NullAllowed] NWTlsParameters tlsParameters, [NullAllowed] INWTcpConnectionAuthenticationDelegate @delegate);
|
||||
|
||||
[Export ("createUDPSessionThroughTunnelToEndpoint:fromEndpoint:")]
|
||||
NWUdpSession CreateUdpSession (NWEndpoint remoteEndpoint, [NullAllowed] NWHostEndpoint localEndpoint);
|
||||
|
|
|
@ -516,8 +516,14 @@ namespace XamCore.PassKit {
|
|||
|
||||
[DesignatedInitializer]
|
||||
[Export ("initWithRequestConfiguration:delegate:")]
|
||||
IntPtr Constructor (PKAddPaymentPassRequestConfiguration configuration, [NullAllowed] PKAddPaymentPassViewControllerDelegate viewControllerDelegate);
|
||||
|
||||
IntPtr Constructor (PKAddPaymentPassRequestConfiguration configuration, [NullAllowed] IPKAddPaymentPassViewControllerDelegate viewControllerDelegate);
|
||||
|
||||
#if !XAMCORE_4_0
|
||||
[Obsolete ("Use the overload accepting a IPKAddPaymentPassViewControllerDelegate")]
|
||||
[Wrap ("this (configuration, (IPKAddPaymentPassViewControllerDelegate) viewControllerDelegate)")]
|
||||
IntPtr Constructor (PKAddPaymentPassRequestConfiguration configuration, PKAddPaymentPassViewControllerDelegate viewControllerDelegate);
|
||||
#endif
|
||||
|
||||
[Wrap ("WeakDelegate")]
|
||||
[NullAllowed, Protocolize]
|
||||
PKAddPaymentPassViewControllerDelegate Delegate { get; set; }
|
||||
|
@ -525,6 +531,8 @@ namespace XamCore.PassKit {
|
|||
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
|
||||
NSObject WeakDelegate { get; set; }
|
||||
}
|
||||
|
||||
interface IPKAddPaymentPassViewControllerDelegate {}
|
||||
|
||||
[Protocol, Model]
|
||||
[BaseType (typeof(NSObject))]
|
||||
|
|
11
src/uikit.cs
11
src/uikit.cs
|
@ -2065,6 +2065,8 @@ namespace XamCore.UIKit {
|
|||
UIAlertAction PreferredAction { get; set; }
|
||||
}
|
||||
|
||||
interface IUIAlertViewDelegate {}
|
||||
|
||||
[NoTV]
|
||||
[BaseType (typeof (UIView), KeepRefUntil="Dismissed", Delegates=new string [] { "WeakDelegate" }, Events=new Type [] {typeof(UIAlertViewDelegate)})]
|
||||
[Availability (Deprecated = Platform.iOS_9_0, Message = "Use UIAlertController with a UIAlertControllerStyle.Alert type instead")]
|
||||
|
@ -2083,7 +2085,7 @@ namespace XamCore.UIKit {
|
|||
// arguments (id, SEL), which means we only need 7 more. And 'mustAlsoBeNull' is that 7th argument.
|
||||
// So on ARM64 the 8th argument ('mustBeNull') is ignored, and iOS sees the 9th argument ('mustAlsoBeNull') as the 8th argument.
|
||||
[Availability (Deprecated=Platform.iOS_8_0, Message="Use UIAlertController instead")]
|
||||
IntPtr Constructor ([NullAllowed] string title, [NullAllowed] string message, [NullAllowed] UIAlertViewDelegate viewDelegate, [NullAllowed] string cancelButtonTitle, IntPtr otherButtonTitles, IntPtr mustBeNull, IntPtr mustAlsoBeNull);
|
||||
IntPtr Constructor ([NullAllowed] string title, [NullAllowed] string message, [NullAllowed] IUIAlertViewDelegate viewDelegate, [NullAllowed] string cancelButtonTitle, IntPtr otherButtonTitles, IntPtr mustBeNull, IntPtr mustAlsoBeNull);
|
||||
|
||||
[Wrap ("WeakDelegate")]
|
||||
[Protocolize]
|
||||
|
@ -8781,7 +8783,12 @@ namespace XamCore.UIKit {
|
|||
|
||||
[NullAllowed] // by default this property is null
|
||||
[Export ("dataSource", ArgumentSemantic.Assign)]
|
||||
#if XAMCORE_4_0
|
||||
IUIPickerViewDataSource DataSource { get; set; }
|
||||
#else
|
||||
// should have been WeakDataSource
|
||||
NSObject DataSource { get; set; }
|
||||
#endif
|
||||
|
||||
[Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
|
||||
NSObject WeakDelegate { get; set; }
|
||||
|
@ -15930,7 +15937,7 @@ namespace XamCore.UIKit {
|
|||
IUIPreviewInteractionDelegate Delegate { get; set; }
|
||||
|
||||
[Export ("locationInCoordinateSpace:")]
|
||||
CGPoint GetLocationInCoordinateSpace ([NullAllowed] UICoordinateSpace coordinateSpace);
|
||||
CGPoint GetLocationInCoordinateSpace ([NullAllowed] IUICoordinateSpace coordinateSpace);
|
||||
|
||||
[Export ("cancelInteraction")]
|
||||
void CancelInteraction ();
|
||||
|
|
|
@ -192,10 +192,10 @@ namespace Introspection {
|
|||
|
||||
public Type CurrentType { get; private set; }
|
||||
|
||||
const BindingFlags Flags = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
|
||||
const BindingFlags Flags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
|
||||
|
||||
[Test]
|
||||
public void Signatures ()
|
||||
public void NativeSignatures ()
|
||||
{
|
||||
int n = 0;
|
||||
Errors = 0;
|
||||
|
@ -794,5 +794,76 @@ namespace Introspection {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#if XAMCORE_2_0
|
||||
[Test]
|
||||
#endif
|
||||
public void ManagedSignature ()
|
||||
{
|
||||
int n = 0;
|
||||
Errors = 0;
|
||||
ErrorData.Clear ();
|
||||
|
||||
foreach (Type t in Assembly.GetTypes ()) {
|
||||
|
||||
if (!NSObjectType.IsAssignableFrom (t))
|
||||
continue;
|
||||
|
||||
CurrentType = t;
|
||||
|
||||
foreach (MethodInfo m in t.GetMethods (Flags))
|
||||
CheckManagedMemberSignatures (m, t, ref n);
|
||||
|
||||
foreach (MethodBase m in t.GetConstructors (Flags))
|
||||
CheckManagedMemberSignatures (m, t, ref n);
|
||||
}
|
||||
AssertIfErrors ("{0} errors found in {1} signatures validated{2}", Errors, n, Errors == 0 ? string.Empty : ":\n" + ErrorData.ToString () + "\n");
|
||||
}
|
||||
|
||||
protected virtual bool CheckType (Type t, ref int n)
|
||||
{
|
||||
if (t.IsArray)
|
||||
return CheckType (t.GetElementType (), ref n);
|
||||
// e.g. NSDictionary<NSString,NSObject> needs 3 check
|
||||
if (t.IsGenericType) {
|
||||
foreach (var ga in t.GetGenericArguments ())
|
||||
return CheckType (ga, ref n);
|
||||
}
|
||||
// look for [Model] types
|
||||
if (t.GetCustomAttribute<ModelAttribute> (false) == null)
|
||||
return true;
|
||||
n++;
|
||||
switch (t.Name) {
|
||||
case "CAAnimationDelegate": // this was not a protocol before iOS 10 and was not bound as such
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void CheckManagedMemberSignatures (MethodBase m, Type t, ref int n)
|
||||
{
|
||||
// if the method was obsoleted then it's not an issue, we assume the alternative is fine
|
||||
if (m.GetCustomAttribute<ObsoleteAttribute> () != null)
|
||||
return;
|
||||
if (m.DeclaringType != t)
|
||||
return;
|
||||
|
||||
CurrentMethod = m;
|
||||
|
||||
foreach (var p in m.GetParameters ()) {
|
||||
var pt = p.ParameterType;
|
||||
// skip methods added inside the [Model] type - those are fine
|
||||
if (t == pt)
|
||||
continue;
|
||||
if (!CheckType (pt, ref n))
|
||||
ReportError ($"`{t.Name}.{m.Name}` includes a parameter of type `{pt.Name}` which is a concrete type `[Model]` and not an interface `[Protocol]`");
|
||||
}
|
||||
if (!m.IsConstructor) {
|
||||
var rt = (m as MethodInfo).ReturnType;
|
||||
if (!CheckType (rt, ref n))
|
||||
ReportError ($"`{t.Name}.{m.Name}` return type `{rt.Name}` is a concrete type `[Model]` and not an interface `[Protocol]`");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -239,5 +239,38 @@ namespace Introspection {
|
|||
}
|
||||
return base.Check (encodedType, type);
|
||||
}
|
||||
|
||||
protected override bool CheckType (Type t, ref int n)
|
||||
{
|
||||
switch (t.Name) {
|
||||
#if !XAMCORE_4_0
|
||||
case "NSPasteboardReading":
|
||||
case "NSPasteboardWriting":
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.CheckType (t, ref n);
|
||||
}
|
||||
|
||||
protected override void CheckManagedMemberSignatures (MethodBase m, Type t, ref int n)
|
||||
{
|
||||
#if !XAMCORE_4_0 // let's review the tests exceptions if we break things
|
||||
switch (m.Name) {
|
||||
case "get_Source":
|
||||
case "set_Source":
|
||||
// NSTableViewSource is our own creation and we did not make an interface out of it
|
||||
if (t.Name == "NSTableView")
|
||||
return;
|
||||
break;
|
||||
case "AddEventListener":
|
||||
// Fixed in XAMCORE_4_0
|
||||
if (t.Name == "DomNode")
|
||||
return;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
base.CheckManagedMemberSignatures (m, t, ref n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -176,5 +176,43 @@ namespace Introspection {
|
|||
}
|
||||
return base.Check (encodedType, type);
|
||||
}
|
||||
|
||||
protected override void CheckManagedMemberSignatures (MethodBase m, Type t, ref int n)
|
||||
{
|
||||
#if !XAMCORE_4_0 // let's review the tests exceptions if we break things
|
||||
switch (m.Name) {
|
||||
case "get_Source":
|
||||
case "set_Source":
|
||||
// UITableViewSource is our own creation and we did not make an interface out of it
|
||||
if (t.Name == "UITableView")
|
||||
return;
|
||||
// UICollectionViewSource is our own creation and we did not make an interface out of it
|
||||
if (t.Name == "UICollectionView")
|
||||
return;
|
||||
break;
|
||||
case "get_SearchResultsSource":
|
||||
case "set_SearchResultsSource":
|
||||
// UITableViewSource is our own creation and we did not make an interface out of it
|
||||
if (t.Name == "UISearchDisplayController")
|
||||
return;
|
||||
break;
|
||||
case "get_ImagePickerControllerDelegate":
|
||||
case "set_ImagePickerControllerDelegate":
|
||||
case "get_NavigationControllerDelegate":
|
||||
case "set_NavigationControllerDelegate":
|
||||
// fixed in XAMCORE_4_0 - alternative are the Weak* delegates
|
||||
if (t.Name == "UIImagePickerController")
|
||||
return;
|
||||
break;
|
||||
case "get_Model":
|
||||
case "set_Model":
|
||||
// UIPickerViewModel is our own creation and we did not make an interface out of it
|
||||
if (t.Name == "UIPickerView")
|
||||
return;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
base.CheckManagedMemberSignatures (m, t, ref n);
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче