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 add_separator(cef_menu_model_t* self)
 {
     add_separator_delegate d;
     var p = self->_add_separator;
     if (p == _p5) { d = _d5; }
     else
     {
         d = (add_separator_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_separator_delegate));
         if (_p5 == IntPtr.Zero) { _d5 = d; _p5 = p; }
     }
     return d(self);
 }
 internal static CefMenuModel FromNativeOrNull(cef_menu_model_t* ptr)
 {
     if (ptr == null) return null;
     return new CefMenuModel(ptr);
 }
 public static int is_visible_at(cef_menu_model_t* self, int index)
 {
     is_visible_at_delegate d;
     var p = self->_is_visible_at;
     if (p == _p21) { d = _d21; }
     else
     {
         d = (is_visible_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_visible_at_delegate));
         if (_p21 == IntPtr.Zero) { _d21 = d; _p21 = p; }
     }
     return d(self, index);
 }
 public static int set_visible_at(cef_menu_model_t* self, int index, int visible)
 {
     set_visible_at_delegate d;
     var p = self->_set_visible_at;
     if (p == _p23) { d = _d23; }
     else
     {
         d = (set_visible_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_visible_at_delegate));
         if (_p23 == IntPtr.Zero) { _d23 = d; _p23 = p; }
     }
     return d(self, index, visible);
 }
 public static int set_group_id(cef_menu_model_t* self, int command_id, int group_id)
 {
     set_group_id_delegate d;
     var p = self->_set_group_id;
     if (p == _p1c) { d = _d1c; }
     else
     {
         d = (set_group_id_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_group_id_delegate));
         if (_p1c == IntPtr.Zero) { _d1c = d; _p1c = p; }
     }
     return d(self, command_id, group_id);
 }
 public static cef_menu_model_t* get_sub_menu(cef_menu_model_t* self, int command_id)
 {
     get_sub_menu_delegate d;
     var p = self->_get_sub_menu;
     if (p == _p1e) { d = _d1e; }
     else
     {
         d = (get_sub_menu_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_sub_menu_delegate));
         if (_p1e == IntPtr.Zero) { _d1e = d; _p1e = p; }
     }
     return d(self, command_id);
 }
 public static cef_menu_model_t* insert_sub_menu_at(cef_menu_model_t* self, int index, int command_id, cef_string_t* label)
 {
     insert_sub_menu_at_delegate d;
     var p = self->_insert_sub_menu_at;
     if (p == _pe) { d = _de; }
     else
     {
         d = (insert_sub_menu_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(insert_sub_menu_at_delegate));
         if (_pe == IntPtr.Zero) { _de = d; _pe = p; }
     }
     return d(self, index, command_id, label);
 }
 public static int remove(cef_menu_model_t* self, int command_id)
 {
     remove_delegate d;
     var p = self->_remove;
     if (p == _pf) { d = _df; }
     else
     {
         d = (remove_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(remove_delegate));
         if (_pf == IntPtr.Zero) { _df = d; _pf = p; }
     }
     return d(self, command_id);
 }
 public static int insert_separator_at(cef_menu_model_t* self, int index)
 {
     insert_separator_at_delegate d;
     var p = self->_insert_separator_at;
     if (p == _pa) { d = _da; }
     else
     {
         d = (insert_separator_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(insert_separator_at_delegate));
         if (_pa == IntPtr.Zero) { _da = d; _pa = p; }
     }
     return d(self, index);
 }
 public static int insert_radio_item_at(cef_menu_model_t* self, int index, int command_id, cef_string_t* label, int group_id)
 {
     insert_radio_item_at_delegate d;
     var p = self->_insert_radio_item_at;
     if (p == _pd) { d = _dd; }
     else
     {
         d = (insert_radio_item_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(insert_radio_item_at_delegate));
         if (_pd == IntPtr.Zero) { _dd = d; _pd = p; }
     }
     return d(self, index, command_id, label, group_id);
 }
 public static cef_menu_model_t* add_sub_menu(cef_menu_model_t* self, int command_id, cef_string_t* label)
 {
     add_sub_menu_delegate d;
     var p = self->_add_sub_menu;
     if (p == _p9) { d = _d9; }
     else
     {
         d = (add_sub_menu_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_sub_menu_delegate));
         if (_p9 == IntPtr.Zero) { _d9 = d; _p9 = p; }
     }
     return d(self, command_id, label);
 }
 public static int add_radio_item(cef_menu_model_t* self, int command_id, cef_string_t* label, int group_id)
 {
     add_radio_item_delegate d;
     var p = self->_add_radio_item;
     if (p == _p8) { d = _d8; }
     else
     {
         d = (add_radio_item_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_radio_item_delegate));
         if (_p8 == IntPtr.Zero) { _d8 = d; _p8 = p; }
     }
     return d(self, command_id, label, group_id);
 }
 public static int add_check_item(cef_menu_model_t* self, int command_id, cef_string_t* label)
 {
     add_check_item_delegate d;
     var p = self->_add_check_item;
     if (p == _p7) { d = _d7; }
     else
     {
         d = (add_check_item_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_check_item_delegate));
         if (_p7 == IntPtr.Zero) { _d7 = d; _p7 = p; }
     }
     return d(self, command_id, label);
 }
 public static CefMenuItemType get_type_at(cef_menu_model_t* self, int index)
 {
     get_type_at_delegate d;
     var p = self->_get_type_at;
     if (p == _p19) { d = _d19; }
     else
     {
         d = (get_type_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_type_at_delegate));
         if (_p19 == IntPtr.Zero) { _d19 = d; _p19 = p; }
     }
     return d(self, index);
 }
 public static int remove_at(cef_menu_model_t* self, int index)
 {
     remove_at_delegate d;
     var p = self->_remove_at;
     if (p == _p10) { d = _d10; }
     else
     {
         d = (remove_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(remove_at_delegate));
         if (_p10 == IntPtr.Zero) { _d10 = d; _p10 = p; }
     }
     return d(self, index);
 }
 public static int get_group_id_at(cef_menu_model_t* self, int index)
 {
     get_group_id_at_delegate d;
     var p = self->_get_group_id_at;
     if (p == _p1b) { d = _d1b; }
     else
     {
         d = (get_group_id_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_group_id_at_delegate));
         if (_p1b == IntPtr.Zero) { _d1b = d; _p1b = p; }
     }
     return d(self, index);
 }
 public static int get_index_of(cef_menu_model_t* self, int command_id)
 {
     get_index_of_delegate d;
     var p = self->_get_index_of;
     if (p == _p11) { d = _d11; }
     else
     {
         d = (get_index_of_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_index_of_delegate));
         if (_p11 == IntPtr.Zero) { _d11 = d; _p11 = p; }
     }
     return d(self, command_id);
 }
 public static int set_group_id_at(cef_menu_model_t* self, int index, int group_id)
 {
     set_group_id_at_delegate d;
     var p = self->_set_group_id_at;
     if (p == _p1d) { d = _d1d; }
     else
     {
         d = (set_group_id_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_group_id_at_delegate));
         if (_p1d == IntPtr.Zero) { _d1d = d; _p1d = p; }
     }
     return d(self, index, group_id);
 }
 public static cef_string_userfree* get_label(cef_menu_model_t* self, int command_id)
 {
     get_label_delegate d;
     var p = self->_get_label;
     if (p == _p14) { d = _d14; }
     else
     {
         d = (get_label_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_label_delegate));
         if (_p14 == IntPtr.Zero) { _d14 = d; _p14 = p; }
     }
     return d(self, command_id);
 }
 public static cef_menu_model_t* get_sub_menu_at(cef_menu_model_t* self, int index)
 {
     get_sub_menu_at_delegate d;
     var p = self->_get_sub_menu_at;
     if (p == _p1f) { d = _d1f; }
     else
     {
         d = (get_sub_menu_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_sub_menu_at_delegate));
         if (_p1f == IntPtr.Zero) { _d1f = d; _p1f = p; }
     }
     return d(self, index);
 }
 public static cef_string_userfree* get_label_at(cef_menu_model_t* self, int index)
 {
     get_label_at_delegate d;
     var p = self->_get_label_at;
     if (p == _p15) { d = _d15; }
     else
     {
         d = (get_label_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_label_at_delegate));
         if (_p15 == IntPtr.Zero) { _d15 = d; _p15 = p; }
     }
     return d(self, index);
 }
 public static int set_visible(cef_menu_model_t* self, int command_id, int visible)
 {
     set_visible_delegate d;
     var p = self->_set_visible;
     if (p == _p22) { d = _d22; }
     else
     {
         d = (set_visible_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_visible_delegate));
         if (_p22 == IntPtr.Zero) { _d22 = d; _p22 = p; }
     }
     return d(self, command_id, visible);
 }
 public static int set_label(cef_menu_model_t* self, int command_id, cef_string_t* label)
 {
     set_label_delegate d;
     var p = self->_set_label;
     if (p == _p16) { d = _d16; }
     else
     {
         d = (set_label_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_label_delegate));
         if (_p16 == IntPtr.Zero) { _d16 = d; _p16 = p; }
     }
     return d(self, command_id, label);
 }
 public static int is_enabled(cef_menu_model_t* self, int command_id)
 {
     is_enabled_delegate d;
     var p = self->_is_enabled;
     if (p == _p24) { d = _d24; }
     else
     {
         d = (is_enabled_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_enabled_delegate));
         if (_p24 == IntPtr.Zero) { _d24 = d; _p24 = p; }
     }
     return d(self, command_id);
 }
 public static int set_label_at(cef_menu_model_t* self, int index, cef_string_t* label)
 {
     set_label_at_delegate d;
     var p = self->_set_label_at;
     if (p == _p17) { d = _d17; }
     else
     {
         d = (set_label_at_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_label_at_delegate));
         if (_p17 == IntPtr.Zero) { _d17 = d; _p17 = p; }
     }
     return d(self, index, label);
 }
 internal static CefMenuModel FromNative(cef_menu_model_t* ptr)
 {
     return new CefMenuModel(ptr);
 }
 public static CefMenuItemType get_type(cef_menu_model_t* self, int command_id)
 {
     get_type_delegate d;
     var p = self->_get_type;
     if (p == _p18) { d = _d18; }
     else
     {
         d = (get_type_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_type_delegate));
         if (_p18 == IntPtr.Zero) { _d18 = d; _p18 = p; }
     }
     return d(self, command_id);
 }
 private CefMenuModel(cef_menu_model_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
 public static int get_count(cef_menu_model_t* self)
 {
     get_count_delegate d;
     var p = self->_get_count;
     if (p == _p4) { d = _d4; }
     else
     {
         d = (get_count_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_count_delegate));
         if (_p4 == IntPtr.Zero) { _d4 = d; _p4 = p; }
     }
     return d(self);
 }