private int on_context_menu_command(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_context_menu_params_t* @params, int command_id, CefEventFlags event_flags)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mFrame = CefFrame.FromNative(frame);
            var mState = CefContextMenuParams.FromNative(@params);

            var result = OnContextMenuCommand(mBrowser, mFrame, mState, command_id, event_flags);

            mState.Dispose();

            return result ? 1 : 0;
        }
        private void on_before_context_menu(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_context_menu_params_t* @params, cef_menu_model_t* model)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mFrame = CefFrame.FromNative(frame);
            var mState = CefContextMenuParams.FromNative(@params);
            var mModel = CefMenuModel.FromNative(model);

            OnBeforeContextMenu(mBrowser, mFrame, mState, mModel);

            mState.Dispose();
            mModel.Dispose();
        }
 public static int get_misspelling_hash(cef_context_menu_params_t* self)
 {
     get_misspelling_hash_delegate d;
     var p = self->_get_misspelling_hash;
     if (p == _p11) { d = _d11; }
     else
     {
         d = (get_misspelling_hash_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_misspelling_hash_delegate));
         if (_p11 == IntPtr.Zero) { _d11 = d; _p11 = p; }
     }
     return d(self);
 }
 public static cef_string_userfree* get_misspelled_word(cef_context_menu_params_t* self)
 {
     get_misspelled_word_delegate d;
     var p = self->_get_misspelled_word;
     if (p == _p10) { d = _d10; }
     else
     {
         d = (get_misspelled_word_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_misspelled_word_delegate));
         if (_p10 == IntPtr.Zero) { _d10 = d; _p10 = p; }
     }
     return d(self);
 }
 public static cef_string_userfree* get_selection_text(cef_context_menu_params_t* self)
 {
     get_selection_text_delegate d;
     var p = self->_get_selection_text;
     if (p == _pf) { d = _df; }
     else
     {
         d = (get_selection_text_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_selection_text_delegate));
         if (_pf == IntPtr.Zero) { _df = d; _pf = p; }
     }
     return d(self);
 }
 public static CefContextMenuMediaType get_media_type(cef_context_menu_params_t* self)
 {
     get_media_type_delegate d;
     var p = self->_get_media_type;
     if (p == _pd) { d = _dd; }
     else
     {
         d = (get_media_type_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_media_type_delegate));
         if (_pd == IntPtr.Zero) { _dd = d; _pd = p; }
     }
     return d(self);
 }
 public static cef_string_userfree* get_frame_url(cef_context_menu_params_t* self)
 {
     get_frame_url_delegate d;
     var p = self->_get_frame_url;
     if (p == _pb) { d = _db; }
     else
     {
         d = (get_frame_url_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_frame_url_delegate));
         if (_pb == IntPtr.Zero) { _db = d; _pb = p; }
     }
     return d(self);
 }
 public static int is_spell_check_enabled(cef_context_menu_params_t* self)
 {
     is_spell_check_enabled_delegate d;
     var p = self->_is_spell_check_enabled;
     if (p == _p14) { d = _d14; }
     else
     {
         d = (is_spell_check_enabled_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_spell_check_enabled_delegate));
         if (_p14 == IntPtr.Zero) { _d14 = d; _p14 = p; }
     }
     return d(self);
 }
 public static int has_one_ref(cef_context_menu_params_t* self)
 {
     has_one_ref_delegate d;
     var p = self->_base._has_one_ref;
     if (p == _p2) { d = _d2; }
     else
     {
         d = (has_one_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(has_one_ref_delegate));
         if (_p2 == IntPtr.Zero) { _d2 = d; _p2 = p; }
     }
     return d(self);
 }
 public static int release(cef_context_menu_params_t* self)
 {
     release_delegate d;
     var p = self->_base._release;
     if (p == _p1) { d = _d1; }
     else
     {
         d = (release_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(release_delegate));
         if (_p1 == IntPtr.Zero) { _d1 = d; _p1 = p; }
     }
     return d(self);
 }
 public static void add_ref(cef_context_menu_params_t* self)
 {
     add_ref_delegate d;
     var p = self->_base._add_ref;
     if (p == _p0) { d = _d0; }
     else
     {
         d = (add_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_ref_delegate));
         if (_p0 == IntPtr.Zero) { _d0 = d; _p0 = p; }
     }
     d(self);
 }
 private CefContextMenuParams(cef_context_menu_params_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
 internal static CefContextMenuParams FromNativeOrNull(cef_context_menu_params_t* ptr)
 {
     if (ptr == null) return null;
     return new CefContextMenuParams(ptr);
 }
 internal static CefContextMenuParams FromNative(cef_context_menu_params_t* ptr)
 {
     return new CefContextMenuParams(ptr);
 }
 public static int get_dictionary_suggestions(cef_context_menu_params_t* self, cef_string_list* suggestions)
 {
     get_dictionary_suggestions_delegate d;
     var p = self->_get_dictionary_suggestions;
     if (p == _p12) { d = _d12; }
     else
     {
         d = (get_dictionary_suggestions_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_dictionary_suggestions_delegate));
         if (_p12 == IntPtr.Zero) { _d12 = d; _p12 = p; }
     }
     return d(self, suggestions);
 }
 public static int is_editable(cef_context_menu_params_t* self)
 {
     is_editable_delegate d;
     var p = self->_is_editable;
     if (p == _p13) { d = _d13; }
     else
     {
         d = (is_editable_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_editable_delegate));
         if (_p13 == IntPtr.Zero) { _d13 = d; _p13 = p; }
     }
     return d(self);
 }
 public static int get_ycoord(cef_context_menu_params_t* self)
 {
     get_ycoord_delegate d;
     var p = self->_get_ycoord;
     if (p == _p4) { d = _d4; }
     else
     {
         d = (get_ycoord_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_ycoord_delegate));
         if (_p4 == IntPtr.Zero) { _d4 = d; _p4 = p; }
     }
     return d(self);
 }
 public static CefContextMenuEditStateFlags get_edit_state_flags(cef_context_menu_params_t* self)
 {
     get_edit_state_flags_delegate d;
     var p = self->_get_edit_state_flags;
     if (p == _p15) { d = _d15; }
     else
     {
         d = (get_edit_state_flags_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_edit_state_flags_delegate));
         if (_p15 == IntPtr.Zero) { _d15 = d; _p15 = p; }
     }
     return d(self);
 }
 public static int has_image_contents(cef_context_menu_params_t* self)
 {
     has_image_contents_delegate d;
     var p = self->_has_image_contents;
     if (p == _p9) { d = _d9; }
     else
     {
         d = (has_image_contents_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(has_image_contents_delegate));
         if (_p9 == IntPtr.Zero) { _d9 = d; _p9 = p; }
     }
     return d(self);
 }