mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 11:42:36 +00:00
Apply changes to the WinForms control so exception throw
Will refactor a few more methods into extensions so it's not really a problem
This commit is contained in:
@@ -157,6 +157,8 @@ namespace CefSharp.WinForms
|
||||
|
||||
public void SendMouseWheelEvent(int x, int y, int deltaX, int deltaY)
|
||||
{
|
||||
this.ThrowExceptionIfBrowserNotInitialized();
|
||||
|
||||
managedCefBrowserAdapter.OnMouseWheel(x, y, deltaX, deltaY);
|
||||
}
|
||||
|
||||
@@ -317,10 +319,9 @@ namespace CefSharp.WinForms
|
||||
|
||||
public void NotifyMoveOrResizeStarted()
|
||||
{
|
||||
if (IsBrowserInitialized)
|
||||
{
|
||||
managedCefBrowserAdapter.NotifyMoveOrResizeStarted();
|
||||
}
|
||||
this.ThrowExceptionIfBrowserNotInitialized();
|
||||
|
||||
managedCefBrowserAdapter.NotifyMoveOrResizeStarted();
|
||||
}
|
||||
|
||||
protected override void OnGotFocus(EventArgs e)
|
||||
@@ -334,25 +335,26 @@ namespace CefSharp.WinForms
|
||||
/// </summary>
|
||||
public void SetFocus(bool isFocused)
|
||||
{
|
||||
if (IsBrowserInitialized)
|
||||
{
|
||||
managedCefBrowserAdapter.SetFocus(isFocused);
|
||||
}
|
||||
this.ThrowExceptionIfBrowserNotInitialized();
|
||||
|
||||
managedCefBrowserAdapter.SetFocus(isFocused);
|
||||
}
|
||||
|
||||
public IFrame GetMainFrame()
|
||||
{
|
||||
return IsBrowserInitialized ? managedCefBrowserAdapter.GetMainFrame() : null;
|
||||
this.ThrowExceptionIfBrowserNotInitialized();
|
||||
|
||||
return managedCefBrowserAdapter.GetMainFrame();
|
||||
}
|
||||
|
||||
public IFrame GetFocusedFrame()
|
||||
{
|
||||
return IsBrowserInitialized ? managedCefBrowserAdapter.GetFocusedFrame() : null;
|
||||
return managedCefBrowserAdapter.GetFocusedFrame();
|
||||
}
|
||||
|
||||
public IBrowser GetBrowser()
|
||||
{
|
||||
return IsBrowserInitialized ? managedCefBrowserAdapter.GetBrowser() : null;
|
||||
return managedCefBrowserAdapter.GetBrowser();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user