本文整理汇总了C#中IWebBrowser.Load方法的典型用法代码示例。如果您正苦于以下问题:C# IWebBrowser.Load方法的具体用法?C# IWebBrowser.Load怎么用?C# IWebBrowser.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWebBrowser
的用法示例。
在下文中一共展示了IWebBrowser.Load方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnBeforePopup
public bool OnBeforePopup(IWebBrowser rpBrowserControl, IBlinkBrowser rpBrowser, IFrame rpFrame, string rpTargetUrl, string rpTargetFrameName, WindowOpenDisposition rpTargetDisposition, bool rpUserGesture, IPopupFeatures rpPopupFeatures, IWindowInfo rpWindowInfo, IBrowserSettings rpBrowserSettings, ref bool rrpNoJavascriptAccess, out IWebBrowser ropNewBrowser)
{
rpBrowserControl.Load(rpTargetUrl);
ropNewBrowser = rpBrowserControl;
return true;
}
示例2: OnBeforeBrowse
/*
* Handler for the browser on before browse event.
*/
public bool OnBeforeBrowse(IWebBrowser browser, IRequest request, bool isRedirect) {
// Disable browser forward/back navigation with keyboard keys
if((request.TransitionType & TransitionType.ForwardBack) != 0) {
return true;
}
// Let the Chromium web browser handle any internal link
if(InternalLinkKeywords.Any(request.Url.Contains)) {
return false;
}
// Load the active team address instead of the default sign-in page
if(request.Url.Equals(SignInUrl)) {
browser.Load(Program.ActiveTeamAddress);
return true;
}
// Let the Chromium web browser handle the event
return false;
}
示例3: LoadPageAsync
public static Task LoadPageAsync(IWebBrowser browser, string address = null)
{
var tcs = new TaskCompletionSource<bool>();
EventHandler<LoadingStateChangedEventArgs> handler = null;
handler = (sender, args) =>
{
//Wait for while page to finish loading not just the first frame
if (!args.IsLoading)
{
browser.LoadingStateChanged -= handler;
tcs.TrySetResult(true);
}
};
browser.LoadingStateChanged += handler;
if (!string.IsNullOrEmpty(address))
{
browser.Load(address);
}
return tcs.Task;
}
示例4: ShowErrorPage
static void ShowErrorPage(IWebBrowser browser, string pageUri)
{
var path = FileHelper.GetFullPath(pageUri);
browser.Load(path);
}
示例5:
void IRequestHandler.OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status)
{
// TODO: Add your own code here for handling scenarios where the Render Process terminated for one reason or another.
browserControl.Load(CefExample.RenderProcessCrashedUrl);
}
示例6: LoadPageAsync
public static Task LoadPageAsync(IWebBrowser browser, string address = null)
{
//If using .Net 4.6 then use TaskCreationOptions.RunContinuationsAsynchronously
//and switch to tcs.TrySetResult below - no need for the custom extension method
var tcs = new TaskCompletionSource<bool>();
EventHandler<LoadingStateChangedEventArgs> handler = null;
handler = (sender, args) =>
{
//Wait for while page to finish loading not just the first frame
if (!args.IsLoading)
{
browser.LoadingStateChanged -= handler;
//This is required when using a standard TaskCompletionSource
//Extension method found in the CefSharp.Internals namespace
tcs.TrySetResultAsync(true);
}
};
browser.LoadingStateChanged += handler;
if (!string.IsNullOrEmpty(address))
{
browser.Load(address);
}
return tcs.Task;
}