Example #1
0
        private IResourceHandler ResourceHandlerFor(ResourceType resourceType)
        {
            if (contentHandler == default(IResourceHandler))
            {
                contentHandler = CefSharp.ResourceHandler.FromString(htmlLoader.LoadBlockedContent());
            }

            if (pageHandler == default(IResourceHandler))
            {
                pageHandler = CefSharp.ResourceHandler.FromString(htmlLoader.LoadBlockedPage());
            }

            switch (resourceType)
            {
            case ResourceType.MainFrame:
            case ResourceType.SubFrame:
                return(pageHandler);

            default:
                return(contentHandler);
            }
        }