123456789101112131415161718192021222324252627282930 |
- using CefSharp;
- namespace UAS_Web.tool
- {
- class MenuHandler : IContextMenuHandler
- {
- public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
- {
- model.Clear();
- model.AddItem(CefMenuCommand.Copy, "复制");
- model.AddItem(CefMenuCommand.Paste, "粘贴");
- model.AddItem(CefMenuCommand.ReloadNoCache, "重新加载");
- }
- public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
- {
- return false;
- }
- public void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame)
- {
- }
- public bool RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
- {
- return false;
- }
- }
- }
|