Exemplo n.º 1
0
        /// <summary>
        /// The register custom handler.
        /// The custom handler must be registered before calling "Run".
        /// Alternatively this can be done before window is created during ChromelyConfiguration instantiation.
        /// Only one type of custom handler can be registered. The first one is valid, consequent registrations will be ignored.
        /// </summary>
        /// <param name="key">
        /// The key.
        /// </param>
        /// <param name="implementation">
        /// The implementation.
        /// </param>
        public void RegisterCustomHandler(CefHandlerKey key, Type implementation)
        {
            if (_windowCreated)
            {
                throw new Exception("\"RegisterCustomHandler\" method must be called before \"Run\" method.");
            }

            HostConfig?.RegisterCustomHandler(key, implementation);
        }