Esempio n. 1
0
        protected override bool ShouldStartLoad(Foundation.NSUrlRequest request, UIKit.UIWebViewNavigationType navigationType)
        {
            if (!request.Url.AbsoluteString.StartsWith("file://", System.StringComparison.Ordinal))
            {
                ViewModel.GoToLinkCommand.Execute(request.Url.AbsoluteString);
                return(false);
            }

            return(base.ShouldStartLoad(request, navigationType));
        }
Esempio n. 2
0
        protected override bool ShouldStartLoad(Foundation.NSUrlRequest request, UIKit.UIWebViewNavigationType navigationType)
        {
            // F*****g BitBucket and their horrible user interface.
            if (ForbiddenRoutes.Any(request.Url.AbsoluteString.StartsWith))
            {
                MonoTouch.Utilities.ShowAlert("Invalid Request", "Sorry, due to restrictions you can not sign-up for a new account in CodeBucket.");
                return(false);
            }

            //We're being redirected to our redirect URL so we must have been successful
            if (request.Url.Host == "codebucket")
            {
                var code = request.Url.Query.Split('=')[1];
                ViewModel.Login(code);
                return(false);
            }
            return(base.ShouldStartLoad(request, navigationType));
        }