Exemplo n.º 1
0
        private static void RegisterLocalScheme()
        {
            var scheme   = new LocalSchemeHandlerFactory();
            var gchandle = GCHandle.Alloc(scheme);

            ChromiumStartupSettings.SchemeHandlerGCHandles.Add(gchandle);

            RegisterScheme("local", null, scheme);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Register your filesystem content schema,and the content folder muse be same as your application path.
        /// </summary>
        /// <param name="schemeName">prefix schema name, default: res, usage: local://</param>
        /// <param name="domainName">domain name ,default:local,useage with default schema: local://local</param>
        /// <remarks>usage: local://local/yourcontentfolder/yourviewpath/index.html</remarks>
        public static void RegisterLocalScheme(string schemeName = "local", string domainName = "local")
        {
            if (string.IsNullOrEmpty(schemeName))
            {
                throw new ArgumentNullException("schemeName", "必须为scheme指定名称。");
            }
            var scheme = new LocalSchemeHandlerFactory(schemeName);

            RegisterScheme(schemeName, domainName, scheme);
        }