本文整理汇总了C#中WebView.FocusView方法的典型用法代码示例。如果您正苦于以下问题:C# WebView.FocusView方法的具体用法?C# WebView.FocusView怎么用?C# WebView.FocusView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebView
的用法示例。
在下文中一共展示了WebView.FocusView方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeView
private void InitializeView(WebView view)
{
if (view == null)
return;
_aweWebView = view;
_aweWebView.CursorChanged += OnCursorChanged;
_aweWebView.AddressChanged += OnAddressChanged;
_aweWebView.ShowCreatedWebView += OnShowNewView;
_aweWebView.Crashed += OnCrashed;
_aweWebView.DocumentReady += OnDocumentReady;
// Load a URL, if this is not a child view.
if (_aweWebView.ParentView == null)
{
if(Settings.FoEServer=="Default")
_aweWebView.Source = new Uri("http://www.forgeofempires.com");
else
_aweWebView.Source = new Uri("http://" + Settings.FoEServer);
}
if(WebCore.IsRunning)
WebCore.ResourceInterceptor = new FoEResourceInterceptor();
// Give focus to the view.
_aweWebView.FocusView();
_needsResize = true;
ResizeView();
}
示例2: InitializeView
private void InitializeView(WebView view)
{
if (view == null)
return;
// Create an image surface to render the
// WebView's pixel buffer.
surface = new ImageSurface();
surface.Updated += OnSurfaceUpdated;
webView = view;
// Assign our surface.
webView.Surface = surface;
// Handle some important events.
webView.CursorChanged += OnCursorChanged;
//webView.TitleChanged += OnTitleChanged;
bindingSource = new BindingSource() { DataSource = webView };
this.DataBindings.Add(new Binding("Text", bindingSource, "Title", true));
//webView.AddressChanged += OnAddressChanged;
//webView.ShowCreatedWebView += OnShowNewView;
//webView.Crashed += OnCrashed;
// Load a URL, if this is not a child view.
if (webView.ParentView == null)
// Tip: /ncr = No Country Redirect ;-)
webView.Source = new Uri("http://www.forgeofempires.com/");
// Give focus to the view.
webView.FocusView();
}
示例3: InitializeView
private void InitializeView( WebView view, bool isChild = false, Uri targetURL = null )
{
if ( view == null )
return;
// Create an image surface to render the
// WebView's pixel buffer.
surface = new ImageSurface();
surface.Updated += OnSurfaceUpdated;
webView = view;
// Assign our surface.
webView.Surface = surface;
if ( !isChild )
webView.Source = targetURL ?? new Uri( "http://www.google.com/ncr" );
// Give focus to the view.
webView.FocusView();
}
示例4: InitializeView
private void InitializeView( WebView view )
{
if ( view == null )
return;
// Create an image surface to render the
// WebView's pixel buffer.
surface = new ImageSurface();
surface.Updated += OnSurfaceUpdated;
webView = view;
// Assign our surface.
webView.Surface = surface;
// Handle some important events.
webView.CursorChanged += OnCursorChanged;
webView.TitleChanged += OnTitleChanged;
webView.DocumentReady += OnDocumentReady;
webView.ShowCreatedWebView += OnShowNewView;
webView.Crashed += OnCrashed;
// Load a URL, if this is not a child view.
if ( webView.Parent == null )
webView.LoadHTML( "<h1>Opening a popup window...</h1>" );
// Give focus to the view.
webView.FocusView();
}