Ejemplo n.º 1
0
        /// <summary>
        /// Add an event listener to this node for the specified event type.
        /// If |useCapture| is true then this listener will be considered a capturing listener.
        /// Capturing listeners will recieve all events of the specified type before the events are dispatched to any other event targets beneath the current node in the tree.
        /// Events which are bubbling upwards through the tree will not trigger a capturing listener.
        /// Separate calls to this method can be used to register the same listener with and without capture.
        /// See WebCore/dom/EventNames.h for the list of supported event types.
        /// </summary>
        public void AddEventListener(string eventType, CefDomEventListener listener, bool useCapture)
        {
            fixed(char *eventType_str = eventType)
            {
                var n_eventType = new cef_string_t(eventType_str, eventType != null ? eventType.Length : 0);

                cef_domnode_t.invoke_add_event_listener(this.ptr, &n_eventType, listener.GetNativePointerAndAddRef(), useCapture ? 1 : 0);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Add an event listener to this node for the specified event type.
 /// If |useCapture| is true then this listener will be considered a capturing listener.
 /// Capturing listeners will recieve all events of the specified type before the events are dispatched to any other event targets beneath the current node in the tree.
 /// Events which are bubbling upwards through the tree will not trigger a capturing listener.
 /// Separate calls to this method can be used to register the same listener with and without capture.
 /// See WebCore/dom/EventNames.h for the list of supported event types.
 /// </summary>
 public void AddEventListener(string eventType, CefDomEventListener listener, bool useCapture)
 {
     fixed (char* eventType_str = eventType)
     {
         var n_eventType = new cef_string_t(eventType_str, eventType != null ? eventType.Length : 0);
         cef_domnode_t.invoke_add_event_listener(this.ptr, &n_eventType, listener.GetNativePointerAndAddRef(), useCapture ? 1 : 0);
     }
 }