Beispiel #1
0
 public void DictionaryHasDefinitionForTerm()
 {
     // note: iOS 6 beta 3 fails with: +[_UIDictionaryWrapper _availableDictionaryAssets] returned failed - retrying. Error: Error Domain=ASError Code=4 "The operation couldn’t be completed. (ASError error 4 - Unable to copy asset information)" UserInfo=0x16ac81a0 {NSDescription=Unable to copy asset information}
     // beta 3 always return true, beta 4 false ...
     Assert.True(UIReferenceLibraryViewController.DictionaryHasDefinitionForTerm("Mono"), "Mono");
     Assert.False(UIReferenceLibraryViewController.DictionaryHasDefinitionForTerm("zozo"), "zozo");
 }
        public UIContextualAction ContextualDefinitionAction(int row)
        {
            string word = taskList[row].Name;

            var action = UIContextualAction.FromContextualActionStyle(UIContextualActionStyle.Normal,
                                                                      "Definition",
                                                                      (ReadLaterAction, view, success) => {
                var def = new UIReferenceLibraryViewController(word);

                var alertController = UIAlertController.Create("No Dictionary Installed", "To install a Dictionary, Select Definition again, click `Manage` on the next screen and select a dictionary to download", UIAlertControllerStyle.Alert);
                alertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));

                if (UIReferenceLibraryViewController.DictionaryHasDefinitionForTerm(word) || hasViewedAlert == true)
                {
                    viewController.PresentViewController(def, true, null);
                    success(true);
                }
                else
                {
                    viewController.PresentViewController(alertController, true, null);
                    hasViewedAlert = true;
                    success(false);
                }
            });

            action.BackgroundColor = UIColor.Orange;
            return(action);
        }
Beispiel #3
0
        [Ignore("https://github.com/xamarin/maccore/issues/2348")]          // The native class doesn't exist
#endif

        public void InitWithTerm()
        {
            if (Runtime.Arch == Arch.DEVICE && TestRuntime.CheckSystemVersion(PlatformName.iOS, 9, 0))
            {
                Assert.Ignore("crash on iOS9 devices");
            }
            using (UIReferenceLibraryViewController rlvc = new UIReferenceLibraryViewController("Mono")) {
            }
        }
Beispiel #4
0
        [Ignore("https://github.com/xamarin/maccore/issues/2348")]          // The native class doesn't exist
#endif

        public void InitWithTerm()
        {
#if !__MACCATALYST__
            if (Runtime.Arch == Arch.DEVICE && TestRuntime.CheckSystemVersion(ApplePlatform.iOS, 9, 0))
            {
                Assert.Ignore("crash on iOS9 devices");
            }
#endif
            using (UIReferenceLibraryViewController rlvc = new UIReferenceLibraryViewController("Mono")) {
            }
        }