コード例 #1
0
        /// <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)
                           ));
            }
        }
コード例 #2
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();
        }