Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/CloudKit/CKSyncEngineFetchChangesScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
using ObjCRuntime;
using Foundation;

#if !NET
using NativeHandle = System.IntPtr;
#endif

#nullable enable

namespace CloudKit {
public partial class CKSyncEngineFetchChangesScope {
/// <summary>Creates a new <see cref="CKSyncEngineFetchChangesScope" /> using the specified <paramref name="zoneIds" /> and whether the zone identifiers are included or excluded.</summary>
/// <param name="zoneIds">A set of <see cref="CKRecordZoneID" />s to include or exclude.</param>
/// <param name="excluded">Determines whether the specified <paramref name="zoneIds" /> are included or excluded.</param>
/// <returns>A new <see cref="CKSyncEngineFetchChangesScope" /> instance using the specified <paramref name="zoneIds" />.</returns>
public CKSyncEngineFetchChangesScope (NSSet<CKRecordZoneID>? zoneIds, bool excluded)
: base (NSObjectFlag.Empty)
{
if (excluded) {
// needs to be converted to an empty set
zoneIds ??= new NSSet<CKRecordZoneID> ();
InitializeHandle (_InitWithExcludedZoneIds (zoneIds!), "initWithZoneIDs:");
InitializeHandle (_InitWithExcludedZoneIds (zoneIds), "initWithExcludedZoneIDs:");
} else {
// supports a null parameter
InitializeHandle (_InitWithZoneIds (zoneIds!), "initWithExcludedZoneIDs:");
InitializeHandle (_InitWithZoneIds (zoneIds), "initWithZoneIDs:");
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions src/CloudKit/CKSyncEngineSendChangesScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
using ObjCRuntime;
using Foundation;

#if !NET
using NativeHandle = System.IntPtr;
#endif

#nullable enable

namespace CloudKit {
public partial class CKSyncEngineSendChangesScope {
/// <summary>Creates a new <see cref="CKSyncEngineSendChangesScope" /> using the specified <paramref name="zoneIds" /> and whether the zone identifiers are included or excluded.</summary>
/// <param name="zoneIds">A set of <see cref="CKRecordZoneID" />s to include or exclude.</param>
/// <param name="excluded">Determines whether the specified <paramref name="zoneIds" /> are included or excluded.</param>
/// <returns>A new <see cref="CKSyncEngineSendChangesScope" /> instance using the specified <paramref name="zoneIds" />.</returns>
public CKSyncEngineSendChangesScope (NSSet<CKRecordZoneID>? zoneIds, bool excluded)
: base (NSObjectFlag.Empty)
{
if (excluded) {
// needs to be converted to an empty set
zoneIds ??= new NSSet<CKRecordZoneID> ();
InitializeHandle (_InitWithExcludedZoneIds (zoneIds!), "initWithZoneIDs:");
InitializeHandle (_InitWithExcludedZoneIds (zoneIds), "initWithExcludedZoneIDs:");
} else {
// supports a null parameter
InitializeHandle (_InitWithZoneIds (zoneIds!), "initWithExcludedZoneIDs:");
InitializeHandle (_InitWithZoneIds (zoneIds), "initWithZoneIDs:");
}
}
}
Expand Down
27 changes: 17 additions & 10 deletions src/CloudKit/CKUserIdentityLookupInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,33 @@ namespace CloudKit {
public partial class CKUserIdentityLookupInfo {
// extra parameter to get a unique signature for a string argument
CKUserIdentityLookupInfo (string id, int type)
: base (NSObjectFlag.Empty)
{
var h = type == 0 ? _FromEmail (id) : _FromPhoneNumber (id);
InitializeHandle (h);
switch (type) {
case 0:
InitializeHandle (_FromEmail (id), "initWithEmailAddress:");
break;
case 1:
InitializeHandle (_FromPhoneNumber (id), "initWithPhoneNumber:");
break;
default:
throw new ArgumentOutOfRangeException (nameof (type));
}
}

/// <param name="email">To be added.</param>
/// <summary>Creates a new <see cref="T:CloudKit.CKUserIdentityLookupInfo" /> from the specified <paramref name="email" /> address.</summary>
/// <returns>To be added.</returns>
/// <remarks>To be added.</remarks>
/// <summary>Creates a new <see cref="CKUserIdentityLookupInfo" /> using the specified <paramref name="email" /> address.</summary>
/// <param name="email">The email to use in the lookup.</param>
/// <returns>A new <see cref="CKUserIdentityLookupInfo" /> instance for the specified email.</returns>
public static CKUserIdentityLookupInfo FromEmail (string email)
{
if (string.IsNullOrEmpty (email))
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (email));
return new CKUserIdentityLookupInfo (email, 0);
}

/// <param name="phoneNumber">To be added.</param>
/// <summary>Creates a new <see cref="T:CloudKit.CKUserIdentityLookupInfo" /> from the specified <paramref name="phoneNumber" />.</summary>
/// <returns>To be added.</returns>
/// <remarks>To be added.</remarks>
/// <summary>Creates a new <see cref="T:CloudKit.CKUserIdentityLookupInfo" /> using the specified <paramref name="phoneNumber" />.</summary>
/// <param name="phoneNumber">The phone number to use in the lookup.</param>
/// <returns>A new <see cref="CKUserIdentityLookupInfo" /> instance for the specified phone number.</returns>
public static CKUserIdentityLookupInfo FromPhoneNumber (string phoneNumber)
{
if (string.IsNullOrEmpty (phoneNumber))
Expand Down
3 changes: 0 additions & 3 deletions tests/cecil-tests/ConstructorTest.KnownFailures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ public partial class ConstructorTest {
"AVFoundation.InternalAVAudioSessionDelegate::.ctor(AVFoundation.AVAudioSession)",
"CarPlay.CPListSection::.ctor(CarPlay.CPListItem[],System.String,System.String)",
"CarPlay.CPListSection::.ctor(CarPlay.CPListItem[])",
"CloudKit.CKSyncEngineFetchChangesScope::.ctor(Foundation.NSSet`1<CloudKit.CKRecordZoneID>,System.Boolean)",
"CloudKit.CKSyncEngineSendChangesScope::.ctor(Foundation.NSSet`1<CloudKit.CKRecordZoneID>,System.Boolean)",
"CloudKit.CKUserIdentityLookupInfo::.ctor(System.String,System.Int32)",
"CoreAnimation.CALayer::.ctor(CoreAnimation.CALayer)",
"Foundation.InternalNSNotificationHandler::.ctor(Foundation.NSNotificationCenter,System.Action`1<Foundation.NSNotification>)",
"Foundation.NSActionDispatcher::.ctor(System.Action)",
Expand Down
2 changes: 0 additions & 2 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9048,8 +9048,6 @@ M:CloudKit.CKSyncEngine.SendChangesAsync
M:CloudKit.CKSyncEngine.SendChangesAsync(CloudKit.CKSyncEngineSendChangesOptions)
M:CloudKit.CKSyncEngineConfiguration.Dispose(System.Boolean)
M:CloudKit.CKSyncEngineDelegate_Extensions.SyncEngine(CloudKit.ICKSyncEngineDelegate,CloudKit.CKSyncEngine,CloudKit.CKSyncEngineFetchChangesContext)
M:CloudKit.CKSyncEngineFetchChangesScope.#ctor(Foundation.NSSet{CloudKit.CKRecordZoneID},System.Boolean)
M:CloudKit.CKSyncEngineSendChangesScope.#ctor(Foundation.NSSet{CloudKit.CKRecordZoneID},System.Boolean)
M:CloudKit.ICKSyncEngineDelegate.SyncEngine(CloudKit.CKSyncEngine,CloudKit.CKSyncEngineEvent)
M:CloudKit.ICKSyncEngineDelegate.SyncEngine(CloudKit.CKSyncEngine,CloudKit.CKSyncEngineFetchChangesContext)
M:CloudKit.ICKSyncEngineDelegate.SyncEngine(CloudKit.CKSyncEngine,CloudKit.CKSyncEngineSendChangesContext)
Expand Down
3 changes: 0 additions & 3 deletions tests/introspection/ApiSelectorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1368,9 +1368,6 @@ protected virtual bool SkipInit (string selector, MethodBase m)
case "initWithLocalIdentifier:":
case "initWithCollaborationIdentifier:":
return true;
// CloudKit
case "initWithExcludedZoneIDs:":
case "initWithZoneIDs:":
// DDDevicePickerViewController
case "initWithBrowseDescriptor:parameters:":
return true;
Expand Down