public override Task <Results> Run() { CKNotificationID [] ids = Cache.NewNotificationIDs; var tcs = new TaskCompletionSource <Results> (); if (ids.Length > 0) { var operation = new CKMarkNotificationsReadOperation(ids); operation.Completed = (CKNotificationID [] notificationIDsMarkedRead, NSError operationError) => { if (operationError != null) { tcs.SetException(new NSErrorException(operationError)); } else { Cache.NotificationIDsToBeMarkedAsRead = notificationIDsMarkedRead; tcs.SetResult(Cache.Results); } }; operation.Start(); } else { tcs.SetResult(Cache.Results); } return(tcs.Task); }
public override Task<Results> Run () { CKNotificationID [] ids = Cache.NewNotificationIDs; var tcs = new TaskCompletionSource<Results> (); if (ids.Length > 0) { var operation = new CKMarkNotificationsReadOperation (ids); operation.Completed = (CKNotificationID [] notificationIDsMarkedRead, NSError operationError) => { if (operationError != null) { tcs.SetException (new NSErrorException (operationError)); } else { Cache.NotificationIDsToBeMarkedAsRead = notificationIDsMarkedRead; tcs.SetResult (Cache.Results); } }; operation.Start (); } else { tcs.SetResult (Cache.Results); } return tcs.Task; }
public void SetUp() { TestRuntime.AssertXcodeVersion(6, 0); op = new CKMarkNotificationsReadOperation(notificationIDs); }
public void SetUp() { TestRuntime.AssertXcodeVersion(6, 0); TestRuntime.AssertSystemVersion(PlatformName.MacOSX, 10, 10, throwIfOtherPlatform: false); op = new CKMarkNotificationsReadOperation(notificationIDs); }