public void OperatorPlusReferenceTest() { var str1 = (NSString)"1"; var str2 = (NSString)"2"; var str3 = (NSString)"3"; var str4 = (NSString)"4"; var str5 = (NSString)"5"; var str6 = (NSString)"6"; var one = new NSOrderedSet <NSString> (str1, str2, str3); var two = new NSOrderedSet <NSString> (str4, str5, str6); NSOrderedSet <NSString> nil = null; using (var sum = one + nil) using (var sum2 = two + one) using (var sum3 = one + two) { } Assert.AreNotEqual(IntPtr.Zero, one.Handle, "Handle must be != IntPtr.Zero"); Assert.AreNotEqual(IntPtr.Zero, two.Handle, "Handle must be != IntPtr.Zero"); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); if (!authorizationRequestManager.RequestingRestrictedAppleiOSSDKAPIAuthorization) { NSOrderedSet <NSNumber> restrictedAppleiOSSKDAPIs = WTAuthorizationRequestManager.RestrictedAppleiOSSDKAPIAuthorizationsForRequiredFeatures(WTFeatures.WTFeature_ImageTracking); authorizationRequestManager.RequestRestrictedAppleiOSSDKAPIAuthorization(restrictedAppleiOSSKDAPIs, (bool success, NSError error) => { authorized = success; if (success) { StartAR(); } else { handleAuthorizationError(error); } }); } }
public static void AuthorizeRestricedAPIAccess(WTAuthorizationRequestManager authorizationRequestManager, WTFeatures requiredFeatures, Action successHandler, Action <UIAlertController> errorHandler) { if (!authorizationRequestManager.RequestingRestrictedAppleiOSSDKAPIAuthorization) { NSOrderedSet <NSNumber> restrictedAppleiOSSDKAPIs = WTAuthorizationRequestManager.RestrictedAppleiOSSDKAPIAuthorizationsForRequiredFeatures(requiredFeatures); authorizationRequestManager.RequestRestrictedAppleiOSSDKAPIAuthorization(restrictedAppleiOSSDKAPIs, (bool success, NSError error) => { if (success) { successHandler(); } else { NSDictionary unauthorizedAPIInfo = (NSDictionary)error.UserInfo.ObjectForKey(WTAuthorizationRequestManager.WTUnauthorizedAppleiOSSDKAPIsKey); string detailedAuthorizationErrorLogMessage = "The following authorization states do not meet the requirements: "; string missingAuthorizations = "In order to use the Wikitude SDK, please grant access to the following:"; foreach (NSString unauthorizedAPIKey in unauthorizedAPIInfo.Keys) { int authorizationStatus = Int32.Parse(unauthorizedAPIInfo.ObjectForKey(unauthorizedAPIKey).ToString()); detailedAuthorizationErrorLogMessage += "\n" + unauthorizedAPIKey.ToString() + " = " + WTAuthorizationRequestManager.StringFromAuthorizationStatusForUnauthorizedAppleiOSSDKAPI(authorizationStatus, unauthorizedAPIKey); missingAuthorizations += "\n* " + WTAuthorizationRequestManager.HumanReadableDescriptionForUnauthorizedAppleiOSSDKAPI(unauthorizedAPIKey); } Console.WriteLine(detailedAuthorizationErrorLogMessage); UIAlertController settingsAlertController = UIAlertController.Create("Required API authorizations missing", missingAuthorizations, UIAlertControllerStyle.Alert); settingsAlertController.AddAction(UIAlertAction.Create("Open Settings", UIAlertActionStyle.Default, (UIAlertAction action) => { UIApplication.SharedApplication.OpenUrl(NSUrl.FromString(UIApplication.OpenSettingsUrlString)); })); settingsAlertController.AddAction(UIAlertAction.Create("NO", UIAlertActionStyle.Destructive, null)); errorHandler(settingsAlertController); } }); } }
public void Ctor_Params() { var oSet = new NSOrderedSet <NSString> ((NSString)"foo", (NSString)"bar", (NSString)"xyz"); Assert.AreEqual((nint)3, oSet.Count, "NSOrderedSet1Test Count"); }
public void Ctor_Start() { var oSet = new NSOrderedSet <NSString> (start: (NSString)"foo"); Assert.AreEqual((nint)1, oSet.Count, "NSOrderedSet1Test Count"); }
public void Ctor() { var oset = new NSOrderedSet <NSData> (); Assert.AreEqual((nint)0, oset.Count, "NSOrderedSet1Test Count"); }