Files
cefsharp/CefSharp.Wpf.Example/Handlers/MenuHandler.cs
T
amaitland fa7728b0d0 Strongly type commandId
Add example of using custom menu id numbers
2015-08-31 11:36:49 +10:00

31 lines
1.0 KiB
C#

// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
namespace CefSharp.Wpf.Example.Handlers
{
public class MenuHandler : IContextMenuHandler
{
void IContextMenuHandler.OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
{
Console.WriteLine("Context menu opened");
Console.WriteLine(parameters.MisspelledWord);
//To disable context mode then clear
// model.Clear();
}
bool IContextMenuHandler.OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
{
return false;
}
void IContextMenuHandler.OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame)
{
}
}
}