本文整理汇总了C#中ManagedCefBrowserAdapter.CreateOffscreenBrowser方法的典型用法代码示例。如果您正苦于以下问题:C# ManagedCefBrowserAdapter.CreateOffscreenBrowser方法的具体用法?C# ManagedCefBrowserAdapter.CreateOffscreenBrowser怎么用?C# ManagedCefBrowserAdapter.CreateOffscreenBrowser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ManagedCefBrowserAdapter
的用法示例。
在下文中一共展示了ManagedCefBrowserAdapter.CreateOffscreenBrowser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChromiumWebBrowser
/// <summary>
/// Create a new OffScreen Chromium Browser
/// </summary>
/// <param name="address">Initial address (url) to load</param>
/// <param name="browserSettings">The browser settings to use. If null, the default settings are used.</param>
public ChromiumWebBrowser(string address, BrowserSettings browserSettings = null)
{
if (!Cef.IsInitialized && !Cef.Initialize())
{
throw new InvalidOperationException("Cef::Initialize() failed");
}
ResourceHandler = new DefaultResourceHandler();
Cef.AddDisposable(this);
Address = address;
managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, true);
managedCefBrowserAdapter.CreateOffscreenBrowser(IntPtr.Zero, browserSettings ?? new BrowserSettings(), address);
}
示例2: ChromiumWebBrowser
/// <summary>
/// Create a new OffScreen Chromium Browser
/// </summary>
/// <param name="address">Initial address (url) to load</param>
/// <param name="browserSettings">The browser settings to use. If null, the default settings are used.</param>
/// <param name="requestcontext">See <see cref="RequestContext"/> for more details. Defaults to null</param>
public ChromiumWebBrowser(string address = "", BrowserSettings browserSettings = null, RequestContext requestcontext = null)
{
if (!Cef.IsInitialized && !Cef.Initialize())
{
throw new InvalidOperationException("Cef::Initialize() failed");
}
BitmapFactory = new BitmapFactory(BitmapLock);
ResourceHandlerFactory = new DefaultResourceHandlerFactory();
BrowserSettings = browserSettings ?? new BrowserSettings();
RequestContext = requestcontext;
Cef.AddDisposable(this);
Address = address;
managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, true);
managedCefBrowserAdapter.CreateOffscreenBrowser(IntPtr.Zero, BrowserSettings, RequestContext, address);
}
示例3: ChromiumWebBrowser
public ChromiumWebBrowser()
{
Cef.AddDisposable(this);
Focusable = true;
FocusVisualStyle = null;
IsTabStop = true;
Dispatcher.BeginInvoke((Action)(() => WebBrowser = this));
Loaded += OnLoaded;
Unloaded += OnUnloaded;
GotKeyboardFocus += OnGotKeyboardFocus;
LostKeyboardFocus += OnLostKeyboardFocus;
IsVisibleChanged += OnIsVisibleChanged;
ToolTip = toolTip = new ToolTip();
toolTip.StaysOpen = true;
toolTip.Visibility = Visibility.Collapsed;
toolTip.Closed += OnTooltipClosed;
BackCommand = new DelegateCommand(Back, () => CanGoBack);
ForwardCommand = new DelegateCommand(Forward, () => CanGoForward);
ReloadCommand = new DelegateCommand(Reload, () => CanReload);
PrintCommand = new DelegateCommand(Print);
ZoomInCommand = new DelegateCommand(ZoomIn);
ZoomOutCommand = new DelegateCommand(ZoomOut);
ZoomResetCommand = new DelegateCommand(ZoomReset);
ViewSourceCommand = new DelegateCommand(ViewSource);
CleanupCommand = new DelegateCommand(Dispose);
StopCommand = new DelegateCommand(Stop);
managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this);
managedCefBrowserAdapter.CreateOffscreenBrowser(BrowserSettings ?? new BrowserSettings());
disposables.Add(managedCefBrowserAdapter);
disposables.Add(new DisposableEventWrapper(this, ActualHeightProperty, OnActualSizeChanged));
disposables.Add(new DisposableEventWrapper(this, ActualWidthProperty, OnActualSizeChanged));
}
示例4: WebView
public WebView()
{
Focusable = true;
FocusVisualStyle = null;
IsTabStop = true;
Dispatcher.BeginInvoke((Action)(() => WebBrowser = this));
Loaded += OnLoaded;
Unloaded += OnUnloaded;
this.IsVisibleChanged += OnIsVisibleChanged;
ToolTip = toolTip = new ToolTip();
toolTip.StaysOpen = true;
toolTip.Visibility = Visibility.Collapsed;
toolTip.Closed += OnTooltipClosed;
BackCommand = new DelegateCommand(Back, CanGoBack);
ForwardCommand = new DelegateCommand(Forward, CanGoForward);
ReloadCommand = new DelegateCommand(Reload, CanReload);
browserCore = new BrowserCore("about:blank");
browserCore.PropertyChanged += OnBrowserCorePropertyChanged;
managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this);
managedCefBrowserAdapter.CreateOffscreenBrowser(BrowserSettings ?? new BrowserSettings());
disposables.Add(managedCefBrowserAdapter);
disposables.Add(new DisposableEventWrapper(this, ActualHeightProperty, OnActualSizeChanged));
disposables.Add(new DisposableEventWrapper(this, ActualWidthProperty, OnActualSizeChanged));
}