[src] Remove the ModelAttribute.AutoGeneratedName property in .NET. (#13619)

AutoGeneratedName was a toggle to implement a certain (correct) behavior,
while at the same time not cause breaking changes.

Now that we can do breaking changes in .NET, we can remove the toggle (i.e.
the property), and just always do the right thing (that is: automatically
generate a _unique_ Objective-C name for Model classes, unless a name is
specified manually).

Ref: https://github.com/xamarin/xamarin-macios/issues/5107
This commit is contained in:
Rolf Bjarne Kvinge 2021-12-22 21:28:19 +01:00 коммит произвёл GitHub
Родитель 1b189a83c2
Коммит 5a45a3c3aa
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
43 изменённых файлов: 371 добавлений и 2 удалений

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

@ -727,8 +727,9 @@ It's possible to customize the name of the Objective-C class in two ways:
[Model (Name = "CustomName")]
```
It's recommended to use `AutoGeneratedName = true` (this may become the
default in the future).
It's recommended to use `AutoGeneratedName = true`. In .NET, the name is
always generated (unless it's explicitly specified as in 2. above), and the
`AutoGeneratedName` property does not exist anymore.
<a name="NoDefaultValueAttribute" />

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

@ -30,6 +30,8 @@ namespace Foundation {
public ModelAttribute () {}
public string Name { get; set; }
#if !NET
public bool AutoGeneratedName { get; set; }
#endif
}
}

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

@ -27636,7 +27636,11 @@ namespace AppKit {
[Mac (10,15)]
[NoMacCatalyst]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSSharingServicePickerDelegate))]
interface NSSharingServicePickerToolbarItemDelegate
{

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

@ -1821,7 +1821,11 @@ namespace ARKit {
interface IARCoachingOverlayViewDelegate {}
[iOS (13,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface ARCoachingOverlayViewDelegate {

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

@ -378,7 +378,11 @@ namespace AuthenticationServices {
interface IASAuthorizationControllerDelegate {}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#if NET
[Protocol][Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface ASAuthorizationControllerDelegate {
@ -735,7 +739,11 @@ namespace AuthenticationServices {
[Mac (10,15)]
[Introduced (PlatformName.MacCatalyst, 13, 0)]
[NoTV][NoiOS][NoWatch]
#if NET
[Protocol][Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface ASWebAuthenticationSessionRequestDelegate {
@ -826,7 +834,11 @@ namespace AuthenticationServices {
[Introduced (PlatformName.MacCatalyst, 14, 0)]
[iOS (14,0)]
[NoWatch, NoTV, NoMac]
#if NET
[Protocol][Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface ASAccountAuthenticationModificationControllerDelegate {

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

@ -131,7 +131,11 @@ namespace AutomaticAssessmentConfiguration {
[Mac (10,15,4), iOS (13,4)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface AEAssessmentSessionDelegate {

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

@ -4166,8 +4166,12 @@ namespace AVFoundation {
interface IAVAssetWriterDelegate { }
[TV (14,0), NoWatch, Mac (11,0), iOS (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol]
[Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface AVAssetWriterDelegate {
[Export ("assetWriter:didOutputSegmentData:segmentType:segmentReport:")]
@ -15100,7 +15104,11 @@ namespace AVFoundation {
interface IAVPlaybackCoordinatorPlaybackControlDelegate {}
[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface AVPlaybackCoordinatorPlaybackControlDelegate
{
@ -15265,7 +15273,11 @@ namespace AVFoundation {
interface IAVPlayerPlaybackCoordinatorDelegate {}
[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface AVPlayerPlaybackCoordinatorDelegate
{

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

@ -554,7 +554,11 @@ namespace AVKit {
[NoiOS, NoWatch, NoTV]
[Mac (10,15)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface AVPlayerViewPictureInPictureDelegate {
@ -879,7 +883,11 @@ namespace AVKit {
interface IAVPictureInPictureSampleBufferPlaybackDelegate {}
[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface AVPictureInPictureSampleBufferPlaybackDelegate
{
@ -908,7 +916,11 @@ namespace AVKit {
}
[Mac (12,0), NoiOS, NoTV, NoMacCatalyst]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface AVPlayerViewDelegate
{

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

@ -417,7 +417,11 @@ namespace CarPlay {
interface ICPInterfaceControllerDelegate { }
[NoWatch, NoTV, NoMac, iOS (12,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CPInterfaceControllerDelegate {
@ -439,7 +443,11 @@ namespace CarPlay {
[Introduced (PlatformName.iOS, 12,0)]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'CPTemplateApplicationSceneDelegate' instead.")]
[NoWatch, NoTV, NoMac]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CPApplicationDelegate : UIApplicationDelegate {
@ -674,7 +682,11 @@ namespace CarPlay {
[Deprecated (PlatformName.iOS, 14, 0, message: "Use 'CPListItem.Handler' instead.")]
[NoWatch, NoTV, NoMac, iOS (12,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CPListTemplateDelegate {
@ -838,7 +850,11 @@ namespace CarPlay {
interface ICPMapTemplateDelegate { }
[NoWatch, NoTV, NoMac, iOS (12,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CPMapTemplateDelegate {
@ -983,7 +999,11 @@ namespace CarPlay {
delegate void CPSearchTemplateDelegateUpdateHandler (CPListItem [] searchResults);
[NoWatch, NoTV, NoMac, iOS (12,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CPSearchTemplateDelegate {
@ -1026,7 +1046,11 @@ namespace CarPlay {
interface ICPSessionConfigurationDelegate { }
[NoWatch, NoTV, NoMac, iOS (12,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model ( AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CPSessionConfigurationDelegate {
@ -1168,7 +1192,11 @@ namespace CarPlay {
interface ICPTemplateApplicationSceneDelegate { }
[NoWatch, NoTV, NoMac, iOS (13,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CPTemplateApplicationSceneDelegate : UISceneDelegate
{
@ -1335,7 +1363,11 @@ namespace CarPlay {
interface ICPTemplateApplicationDashboardSceneDelegate { }
[NoWatch, NoTV, NoMac, iOS (13,4)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CPTemplateApplicationDashboardSceneDelegate : UISceneDelegate {
@ -1716,7 +1748,11 @@ namespace CarPlay {
interface ICPPointOfInterestTemplateDelegate { }
[NoWatch, NoTV, NoMac, iOS (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface CPPointOfInterestTemplateDelegate
{
@ -1760,7 +1796,11 @@ namespace CarPlay {
interface ICPTabBarTemplateDelegate { }
[NoWatch, NoTV, NoMac, iOS (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CPTabBarTemplateDelegate
{

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

@ -1617,7 +1617,11 @@ namespace Chip {
interface IChipDevicePairingDelegate {}
[Mac (12,0), Watch (8,0), TV (15,0), iOS (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject), Name="CHIPDevicePairingDelegate")]
interface ChipDevicePairingDelegate
{
@ -1719,7 +1723,11 @@ namespace Chip {
interface IChipPersistentStorageDelegate {}
[Mac (12,0), Watch (8,0), TV (15,0), iOS (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject), Name="CHIPPersistentStorageDelegate")]
interface ChipPersistentStorageDelegate
{

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

@ -434,7 +434,11 @@ namespace CoreMidi {
[Mac (11, 0), iOS (14,0)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject), Name="MIDICIProfileResponderDelegate")]
interface MidiCIProfileResponderDelegate
{

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

@ -696,7 +696,11 @@ namespace CoreML {
[Watch (5,0), TV (12,0), Mac (10,14), iOS (12,0)]
[BaseType (typeof(NSObject))]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
interface MLCustomModel {
// [Abstract]

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

@ -722,7 +722,11 @@ namespace CoreMotion {
[iOS (14,0)][Watch (7,0)]
[MacCatalyst (14,0)]
[NoMac]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CMHeadphoneMotionManagerDelegate {
@ -799,7 +803,11 @@ namespace CoreMotion {
interface ICMFallDetectionDelegate {}
[Watch (7,2), NoTV, NoMac, NoiOS]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CMFallDetectionDelegate {

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

@ -977,7 +977,11 @@ namespace CoreNFC {
interface INFCTagReaderSessionDelegate {}
[iOS (13,0)]
#if NET
[Protocol][Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface NFCTagReaderSessionDelegate {
@ -1021,7 +1025,11 @@ namespace CoreNFC {
interface INFCVasReaderSessionDelegate {}
[iOS (13,0)]
#if NET
[Protocol][Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject), Name = "NFCVASReaderSessionDelegate")]
interface NFCVasReaderSessionDelegate {

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

@ -77,7 +77,11 @@ namespace CoreTelephony {
[Obsoleted (PlatformName.iOS, 14,0, message: Constants.UseCallKitInstead)]
[iOS (13,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CTTelephonyNetworkInfoDelegate {

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

@ -16035,7 +16035,11 @@ namespace Foundation
}
[BaseType (typeof (NSObject), Name = "NSXPCListenerDelegate")]
#if NET
[Protocol, Model]
#else
[Model (AutoGeneratedName = true), Protocol]
#endif
interface NSXpcListenerDelegate
{
[Export ("listener:shouldAcceptNewConnection:")]
@ -16391,7 +16395,11 @@ namespace Foundation
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#if NET
[Protocol][Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSUrlSessionTaskDelegate), Name = "NSURLSessionWebSocketDelegate")]
interface NSUrlSessionWebSocketDelegate {

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

@ -6476,7 +6476,13 @@ public partial class Generator : IMemberGatherer {
if (is_model) {
if (!string.IsNullOrEmpty (model.Name)) {
register_name = model.Name;
#if NET
} else {
// For .NET, we'll always generate the Objective-C name. If a user wants to use a different name,
// they can set the model name (so we'll enter the previous condition)
#else
} else if (model.AutoGeneratedName) {
#endif
register_name = Registrar.Registrar.SanitizeObjectiveCName (GetAssemblyName () + "__" + type.FullName);
}
}

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

@ -1793,7 +1793,11 @@ namespace HomeKit {
interface IHMNetworkConfigurationProfileDelegate {}
[Watch (6,0), TV (13,0), NoMac, iOS (13,0), MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface HMNetworkConfigurationProfileDelegate {
[Export ("profileDidUpdateNetworkAccessMode:")]

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

@ -148,7 +148,11 @@ namespace ImageCaptureCore {
NSString Transfer { get; }
}
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface ICDeviceDelegate {
@ -285,7 +289,11 @@ namespace ImageCaptureCore {
interface IICDeviceBrowserDelegate {}
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface ICDeviceBrowserDelegate {
@ -419,7 +427,11 @@ namespace ImageCaptureCore {
ICCameraItem[] SidecarFiles { get; }
}
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface ICCameraDeviceDelegate : ICDeviceDelegate {
@ -474,7 +486,11 @@ namespace ImageCaptureCore {
interface IICCameraDeviceDownloadDelegate {}
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface ICCameraDeviceDownloadDelegate {
@ -843,7 +859,11 @@ namespace ImageCaptureCore {
interface IICScannerDeviceDelegate {}
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface ICScannerDeviceDelegate : ICDeviceDelegate {

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

@ -138,7 +138,11 @@ namespace IntentsUI {
[Mac (12,0)]
[iOS (12,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface INUIAddVoiceShortcutViewControllerDelegate {
@ -177,7 +181,11 @@ namespace IntentsUI {
[Mac (12,0)]
[iOS (12,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface INUIEditVoiceShortcutViewControllerDelegate {
@ -233,7 +241,11 @@ namespace IntentsUI {
interface IINUIAddVoiceShortcutButtonDelegate {}
[NoWatch, NoTV, Mac (12,0), iOS (12,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface INUIAddVoiceShortcutButtonDelegate {

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

@ -368,7 +368,11 @@ namespace JavaScriptCore {
}
[Mac (10,9), iOS (7,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface JSExport {

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

@ -2283,7 +2283,11 @@ namespace MediaPlayer {
[TV (14,0)]
[NoWatch, NoMac, NoiOS]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface MPNowPlayingSessionDelegate {

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

@ -4071,7 +4071,11 @@ namespace Metal {
interface IMTLCaptureScope { }
[Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface MTLCaptureScope
{

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

@ -6926,7 +6926,11 @@ namespace MetalPerformanceShaders {
interface IMPSCnnBatchNormalizationDataSource { }
[TV (11,3), Mac (10,13,4), iOS (11,3)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject), Name = "MPSCNNBatchNormalizationDataSource")]
interface MPSCnnBatchNormalizationDataSource : NSCopying {
@ -7297,7 +7301,11 @@ namespace MetalPerformanceShaders {
interface IMPSCnnInstanceNormalizationDataSource { }
[TV (11,3), Mac (10,13,4), iOS (11,3)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject), Name = "MPSCNNInstanceNormalizationDataSource")]
interface MPSCnnInstanceNormalizationDataSource : NSCopying {

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

@ -105,8 +105,12 @@ namespace NearbyInteraction {
[Watch (8,0), NoTV, NoMac, iOS (14,0)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol]
[Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface NISessionDelegate
{

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

@ -2332,7 +2332,11 @@ namespace NetworkExtension {
[NoWatch, NoTV, NoMac, iOS (14,0)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface NEAppPushDelegate
{

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

@ -1592,7 +1592,11 @@ namespace PassKit {
[NoWatch, NoTV, NoMac] // under `#if TARGET_OS_IOS`
[iOS (13,4)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface PKAddSecureElementPassViewControllerDelegate {

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

@ -72,7 +72,11 @@ namespace PencilKit {
[iOS (13, 0), NoMac]
[Introduced (PlatformName.MacCatalyst, 14, 0)]
[BaseType (typeof (NSObject))]
#if NET
[Protocol, Model]
#else
[Model (AutoGeneratedName = true)] [Protocol]
#endif
interface PKCanvasViewDelegate : UIScrollViewDelegate {
[Export ("canvasViewDrawingDidChange:")]

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

@ -492,7 +492,11 @@ namespace PhotosUI {
[NoWatch, NoTV, NoMac, iOS (14,0)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface PHPickerViewControllerDelegate
{

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

@ -420,7 +420,11 @@ namespace ReplayKit {
[Mac (11,0)]
[NoiOS]
[NoTV]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface RPBroadcastActivityControllerDelegate {

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

@ -709,7 +709,11 @@ namespace SensorKit {
[NoWatch, NoTV, NoMac]
[iOS (14,0)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface SRSensorReaderDelegate {

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

@ -257,7 +257,11 @@ namespace ShazamKit {
interface ISHSessionDelegate {}
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface SHSessionDelegate
{

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

@ -997,8 +997,12 @@ namespace StoreKit {
interface ISKPaymentQueueDelegate {}
[Watch (6, 2), Mac (10,15), iOS (13,0)]
#if NET
[Protocol, Model]
#else
[Protocol]
[Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface SKPaymentQueueDelegate {
[Export ("paymentQueue:shouldContinueTransaction:inStorefront:")]
@ -1148,7 +1152,11 @@ namespace StoreKit {
[NoWatch, NoTV, NoMac, iOS (14,0)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface SKOverlayDelegate {
[Export ("storeOverlay:didFailToLoadWithError:")]

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

@ -1130,7 +1130,11 @@ namespace TVMLKit {
interface ITVBrowserViewControllerDataSource { }
[TV (13,0)]
#if NET
[Protocol][Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface TVBrowserViewControllerDataSource {
[Abstract]
@ -1142,7 +1146,11 @@ namespace TVMLKit {
interface ITVBrowserViewControllerDelegate { }
[TV (13,0)]
#if NET
[Protocol][Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface TVBrowserViewControllerDelegate {
[Export ("browserViewController:willCenterOnViewElement:")]
@ -1200,7 +1208,11 @@ namespace TVMLKit {
interface ITVDocumentViewControllerDelegate { }
[TV (13,0)]
#if NET
[Protocol][Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface TVDocumentViewControllerDelegate {

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

@ -269,7 +269,11 @@ namespace TVUIKit {
}
[TV (13,0)]
#if NET
[Protocol, Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (UICollectionViewDelegate))]
interface TVCollectionViewDelegateFullScreenLayout {
[Export ("collectionView:layout:willCenterCellAtIndexPath:")]

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

@ -306,7 +306,11 @@ namespace UIKit {
[NoWatch, NoTV, iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (NSObject))]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
interface UISheetPresentationControllerDelegate : UIAdaptivePresentationControllerDelegate {
[Export ("sheetPresentationControllerDidChangeSelectedDetentIdentifier:")]
@ -2855,7 +2859,11 @@ namespace UIKit {
interface IUIContextMenuInteractionDelegate { }
[NoWatch, NoTV, iOS (13,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UIContextMenuInteractionDelegate {
@ -13092,8 +13100,12 @@ namespace UIKit {
}
[BaseType (typeof (NSObject))]
#if NET
[Protocol, Model]
#else
[Model (AutoGeneratedName = true)]
[Protocol]
#endif
interface UITableViewDataSource {
[Export ("tableView:numberOfRowsInSection:")]
@ -20016,7 +20028,11 @@ namespace UIKit {
interface IUISceneDelegate { }
[iOS (13,0), TV (13,0), NoWatch]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UISceneDelegate {
@ -20436,7 +20452,11 @@ namespace UIKit {
interface IUIFontPickerViewControllerDelegate { }
[NoWatch, NoTV, iOS (13,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UIFontPickerViewControllerDelegate {
@ -20564,7 +20584,11 @@ namespace UIKit {
interface IUILargeContentViewerInteractionDelegate { }
[NoWatch, NoTV, iOS (13,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UILargeContentViewerInteractionDelegate {
@ -20723,7 +20747,11 @@ namespace UIKit {
interface IUIScreenshotServiceDelegate { }
[NoWatch, iOS (13,0), TV (13,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UIScreenshotServiceDelegate {
@ -20785,7 +20813,11 @@ namespace UIKit {
interface IUISearchTextFieldDelegate { }
[NoTV, iOS (13,0), NoWatch]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UISearchTextFieldDelegate : UITextFieldDelegate {
@ -20892,7 +20924,11 @@ namespace UIKit {
interface IUITextFormattingCoordinatorDelegate { }
[iOS (13,0), TV (13,0), NoWatch]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UITextFormattingCoordinatorDelegate {
@ -20947,7 +20983,11 @@ namespace UIKit {
interface IUITextInteractionDelegate { }
[iOS (13,0), NoTV, NoWatch]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UITextInteractionDelegate {
@ -21065,7 +21105,11 @@ namespace UIKit {
interface IUIWindowSceneDelegate { }
[iOS (13,0), TV (13,0), NoWatch]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UIWindowSceneDelegate : UISceneDelegate {
@ -21413,7 +21457,11 @@ namespace UIKit {
interface IUIPointerInteractionDelegate { }
[NoWatch, NoTV, iOS (13,4)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UIPointerInteractionDelegate {
@ -22070,7 +22118,11 @@ namespace UIKit {
[NoWatch, NoTV, iOS (14,0)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UIColorPickerViewControllerDelegate {
@ -22281,7 +22333,11 @@ namespace UIKit {
[NoWatch, NoTV, iOS (14,0)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UIIndirectScribbleInteractionDelegate {
@ -22577,7 +22633,11 @@ namespace UIKit {
[NoWatch, NoTV, iOS (14,0)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UIScribbleInteractionDelegate {
@ -23104,7 +23164,11 @@ namespace UIKit {
interface IUIToolTipInteractionDelegate {}
[NoWatch, NoTV, iOS (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface UIToolTipInteractionDelegate {

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

@ -50,7 +50,11 @@ namespace VisionKit {
interface IVNDocumentCameraViewControllerDelegate { }
[NoWatch, NoTV, NoMac, iOS (13,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface VNDocumentCameraViewControllerDelegate {

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

@ -1630,7 +1630,11 @@ namespace WatchKit {
interface IWKExtendedRuntimeSessionDelegate {}
[Watch (6,0), NoiOS]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface WKExtendedRuntimeSessionDelegate {

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

@ -423,7 +423,11 @@ namespace WebKit {
interface IDomNodeFilter {}
[Deprecated (PlatformName.MacOSX, 10, 14, message: "No longer supported.")]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject), Name="DOMNodeFilter")]
interface DomNodeFilter {
[Export ("acceptNode:")]
@ -2091,8 +2095,12 @@ namespace WebKit {
[Deprecated (PlatformName.MacOSX, 10, 14, message: "No longer supported.")]
[BaseType (typeof (NSObject))]
#if NET
[Protocol, Model]
#else
[Model (AutoGeneratedName = true)]
[Protocol]
#endif
partial interface WebOpenPanelResultListener {
[Export ("chooseFilename:")]
void ChooseFilename (string filename);
@ -2126,8 +2134,12 @@ namespace WebKit {
[Deprecated (PlatformName.MacOSX, 10, 14, message: "No longer supported.")]
[BaseType (typeof (NSObject))]
#if NET
[Protocol, Model]
#else
[Model (AutoGeneratedName = true)]
[Protocol]
#endif
partial interface WebPolicyDecisionListener {
[Export ("use")]
void Use ();

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

@ -1297,7 +1297,11 @@ namespace WebKit
[Mac (11,3)][iOS (14,5)]
[MacCatalyst (14,5)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface WKDownloadDelegate {

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

@ -3065,7 +3065,11 @@ namespace UIKit {
}
[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface NSTextLayoutManagerDelegate
{
@ -3230,7 +3234,11 @@ namespace UIKit {
}
[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface NSTextContentManagerDelegate
{
@ -3560,7 +3568,11 @@ namespace UIKit {
interface INSTextViewportLayoutControllerDelegate {}
[TV (15,0), NoWatch, Mac (12,0), iOS (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface NSTextViewportLayoutControllerDelegate
{
@ -3700,7 +3712,11 @@ namespace UIKit {
}
[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface NSTextSelectionDataSource
{
@ -3828,7 +3844,11 @@ namespace UIKit {
}
[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface NSTextContentStorageDelegate : NSTextContentManagerDelegate
{

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

@ -579,7 +579,11 @@ namespace GeneratorTests
public void GHIssue3869 () => BuildFile (Profile.iOS, "ghissue3869.cs");
[Test]
#if NET
[TestCase ("issue3875.cs", "api0__Issue3875_AProtocol")]
#else
[TestCase ("issue3875.cs", "AProtocol")]
#endif
[TestCase ("issue3875B.cs", "BProtocol")]
[TestCase ("issue3875C.cs", "api0__Issue3875_AProtocol")]
public void Issue3875 (string file, string modelName)

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

@ -2,7 +2,11 @@ using Foundation;
using ObjCRuntime;
namespace Issue3875
{
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof(NSObject))]
interface AProtocol
{