Exemplo n.º 1
0
        //////////////////////////////////////////////////////////////////////////////

        #region URL handling

        internal static bool HandleURL(string urlString)
        {
            Assert.IsNotEmpty(urlString);

            try
            {
                Uri    uri    = new Uri(urlString);
                string scheme = uri.Scheme;

                URLHandler handler = FindURLHandler(scheme);
                if (handler == null)
                {
                    Log.e("Can't find URL handler for scheme: '{0}'", scheme);
                    return(false);
                }

                return(handler(urlString));
            }
            catch (Exception e)
            {
                Debug.LogException(e);
            }

            return(false);
        }
        private String BuildFormAction(String action, int currentPage)
        {
            String formAction = pageControlUrl;

            // Adiciona a variável action a url
            formAction = URLHandler.InsertQueryVariable(formAction, "action=" + action);
            // Adiciona a variável currentPage a url
            formAction = URLHandler.InsertQueryVariable(formAction, "currPage=" + currentPage);

            return(formAction);
        }
Exemplo n.º 3
0
        private static IDictionary <string, URLHandler> CreateURLHandlersLookup()
        {
            IDictionary <string, URLHandler> handlers = new Dictionary <string, URLHandler>();

            URLHandler webPageURLHandler = delegate(string urlString)
            {
                Application.OpenURL(urlString);
                return(true);
            };

            handlers["http"]  = webPageURLHandler;
            handlers["https"] = webPageURLHandler;

            return(handlers);
        }
Exemplo n.º 4
0
        internal static URLHandler RegisterURLHanlder(string scheme, URLHandler handler)
        {
            if (scheme == null)
            {
                throw new ArgumentNullException("scheme");
            }

            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }

            URLHandler oldHandler = FindURLHandler(scheme);

            s_urlHandlers[scheme] = handler;
            return(oldHandler);
        }
Exemplo n.º 5
0
        internal static URLHandler RegisterURLHanlder(string scheme, URLHandler handler)
        {
            if (scheme == null)
            {
                throw new ArgumentNullException("scheme");
            }

            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }

            URLHandler oldHandler = FindURLHandler(scheme);
            s_urlHandlers[scheme] = handler;
            return oldHandler;
        }