Example #1
0
        /// <summary>
        /// The register event handler.
        /// </summary>
        /// <param name="key">
        /// The key.
        /// </param>
        /// <param name="handler">
        /// The handler.
        /// </param>
        /// <typeparam name="T">
        /// This is the event argument class - e,g - LoadErrorEventArgs, FrameLoadStartEventArgs.
        /// </typeparam>
        public void RegisterEventHandler <T>(CefEventKey key, ChromelyEventHandler <T> handler)
        {
            if (_windowCreated)
            {
                throw new Exception("\"RegisterEventHandler\" method must be called before \"Run\" method.");
            }

            HostConfig?.RegisterEventHandler(key, handler);
        }