////////////////////////////////////////////////////////////////////////////// #region URL handling internal static bool HandleURL(string urlString) { CAssert.IsNotEmpty(urlString); try { Uri uri = new Uri(urlString); string scheme = uri.Scheme; CURLHandler handler = FindURLHandler(scheme); if (handler == null) { CLog.e("Can't find URL handler for scheme: '{0}'", scheme); return(false); } return(handler(urlString)); } catch (Exception e) { Debug.LogException(e); } return(false); }
private static IDictionary <string, CURLHandler> CreateURLHandlersLookup() { IDictionary <string, CURLHandler> handlers = new Dictionary <string, CURLHandler>(); CURLHandler webPageURLHandler = delegate(string urlString) { Application.OpenURL(urlString); return(true); }; handlers["http"] = webPageURLHandler; handlers["https"] = webPageURLHandler; return(handlers); }
internal static CURLHandler RegisterURLHanlder(string scheme, CURLHandler handler) { if (scheme == null) { throw new ArgumentNullException("scheme"); } if (handler == null) { throw new ArgumentNullException("handler"); } CURLHandler oldHandler = FindURLHandler(scheme); s_urlHandlers[scheme] = handler; return(oldHandler); }