/// <summary> /// Add a sub-menu to the menu. The new sub-menu is returned. /// </summary> public CefMenuModel AddSubMenu(int commandId, string label) { fixed(char *label_str = label) { var n_label = new cef_string_t(label_str, label.Length); return(CefMenuModel.FromNative( cef_menu_model_t.add_sub_menu(_self, commandId, &n_label) )); } }
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(); }
private int run_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, cef_run_context_menu_callback_t *callback) { CheckSelf(self); var mBrowser = CefBrowser.FromNative(browser); var mFrame = CefFrame.FromNative(frame); var mParameters = CefContextMenuParams.FromNative(@params); var mModel = CefMenuModel.FromNative(model); var mCallback = CefRunContextMenuCallback.FromNative(callback); var result = RunContextMenu(mBrowser, mFrame, mParameters, mModel, mCallback); mParameters.Dispose(); mModel.Dispose(); return(result ? 1 : 0); }