Пример #1
0
        public override bool ShouldStartLoad(UIWebView webView, NSURLRequest request, UIWebViewNavigationType navigationType)
        {
            Debug.Log("ShouldStartLoad");
            // handle the special url schema as a way to communicate from the web
            NSURL url = request.URL();

            if (url != null && url.Scheme().Equals("u3dxt"))
            {
                object[] paths = url.PathComponents();
                Debug.Log(paths.Length);
                string command = paths[1] as string;
                Debug.Log("command: " + command);
                if (command.Equals("say"))
                {
                    string phrase = paths[2] as string;
                    Debug.Log("Phrase: " + phrase);
                    SpeechXT.Speak(phrase);
                }

                // do not actually load this
                return(false);
            }
            else
            {
                return(true);
            }
        }
Пример #2
0
        public override bool ShouldStartLoad(UIWebView webView, NSURLRequest request, UIWebViewNavigationType navigationType)
        {
            Debug.Log ("ShouldStartLoad");
            // handle the special url schema as a way to communicate from the web
            NSURL url = request.URL();

            if (url!=null && url.Scheme().Equals("u3dxt"))
            {				object[] paths = url.PathComponents();
                Debug.Log (paths.Length);
                string command = paths[1] as string;
                Debug.Log ("command: " + command);
                if ( command.Equals("say") )
                {
                    string phrase = paths[2] as string;
                    Debug.Log ("Phrase: " + phrase);
                    SpeechXT.Speak(phrase);
                }

                // do not actually load this
                return false;
            }
            else
            {
                return true;
            }
        }
Пример #3
0
 public void setURL(string url)
 {
     lock(_webview){
         _url = new NSURL(url);
         _request =  new NSURLRequest( _url );
         _webview.LoadRequest(_request);
     }
 }
Пример #4
0
 public void setURL(string url)
 {
     lock (_webview){
         _url     = new NSURL(url);
         _request = new NSURLRequest(_url);
         _webview.LoadRequest(_request);
     }
 }
Пример #5
0
    void OnDestroy()
    {
        // load a blank page before removing it
        _webview.StopLoading();
        _webview.LoadHTMLString("", new NSURL(""));

        _webview.RemoveFromSuperview();
        //		_webview.hidden = true;
        _webview = null;
        _request = null;
        _url = null;
    }
Пример #6
0
    void OnDestroy()
    {
        // load a blank page before removing it
        _webview.StopLoading();
        _webview.LoadHTMLString("", new NSURL(""));

        _webview.RemoveFromSuperview();
//		_webview.hidden = true;
        _webview = null;
        _request = null;
        _url     = null;
    }
Пример #7
0
 public virtual void LoadRequest(NSURLRequest request)
 {
 }