ab56a9bcf7
SVN-Revision: r240
65 lines
2.1 KiB
C#
65 lines
2.1 KiB
C#
using Lskj.Business;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Xilium.CefGlue;
|
|
|
|
namespace Lskj.Control.BrowserSetting
|
|
{
|
|
public class BsClient : CefClient
|
|
{
|
|
public FrmWebBrowser frmWebBrowser;
|
|
public int rightKeyFlag;
|
|
public event EventHandler OnCreated;
|
|
private readonly CefLifeSpanHandler lifeSpanHandler;
|
|
private readonly CefDownloadHandler downloadHandler;
|
|
private readonly CefKeyboardHandler keyboardHandler;
|
|
private readonly CefFocusHandler focusHandler;
|
|
private readonly CefRequestHandler requestHandler;
|
|
private readonly CefContextMenuHandler contextMenuHandler;
|
|
public BsClient(int RightKeyFlag = 0)
|
|
{
|
|
if (SystemInfo.Instance.BrowserRight) RightKeyFlag = 1;
|
|
lifeSpanHandler = new BsLifeSpanHandler(this);
|
|
downloadHandler = new BsDownloadHandler(this);
|
|
keyboardHandler = new BsKeyboardHandler();
|
|
focusHandler = new BsFocusHandler();
|
|
requestHandler = new BsRequestHandler();
|
|
contextMenuHandler = new BsContextMenuHandler(RightKeyFlag);
|
|
}
|
|
protected override CefLifeSpanHandler GetLifeSpanHandler()
|
|
{
|
|
return lifeSpanHandler;
|
|
}
|
|
protected override CefDownloadHandler GetDownloadHandler()
|
|
{
|
|
return downloadHandler;
|
|
}
|
|
protected override CefKeyboardHandler GetKeyboardHandler()
|
|
{
|
|
return keyboardHandler;
|
|
}
|
|
protected override CefFocusHandler GetFocusHandler()
|
|
{
|
|
return focusHandler;
|
|
}
|
|
protected override CefRequestHandler GetRequestHandler()
|
|
{
|
|
return requestHandler;
|
|
}
|
|
protected override CefContextMenuHandler GetContextMenuHandler()
|
|
{
|
|
return contextMenuHandler;
|
|
}
|
|
public void Created(CefBrowser cefBrowser)
|
|
{
|
|
if (OnCreated != null)
|
|
{
|
|
OnCreated(cefBrowser, EventArgs.Empty);
|
|
}
|
|
}
|
|
}
|
|
}
|