• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CefBrowser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CefBrowser的典型用法代码示例。如果您正苦于以下问题:C# CefBrowser类的具体用法?C# CefBrowser怎么用?C# CefBrowser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CefBrowser类属于命名空间,在下文中一共展示了CefBrowser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnAddressChange

 protected override void OnAddressChange(CefBrowser browser, CefFrame frame, string url)
 {
     if (frame.IsMain)
     {
         _core.OnAddressChanged(url);
     }
 }
开发者ID:GuoMarvin,项目名称:Xilium.CefGlue,代码行数:7,代码来源:CefWebDisplayHandler.cs


示例2: OnBeforeClose

		protected override void OnBeforeClose(CefBrowser browser)
		{
			if (_core.InvokeRequired)
				_core.BeginInvoke((Action)_core.OnBeforeClose);
			else
				_core.OnBeforeClose();
		}
开发者ID:rajsite,项目名称:lvcef,代码行数:7,代码来源:CefWebLifeSpanHandler.cs


示例3: OnJSPrompt

 protected override bool OnJSPrompt(CefBrowser browser, CefFrame frame, string message, string defaultValue, out bool retval, out string result)
 {
     // TODO: CefWebJSDialogHandler.OnJSPrompt
     retval = false;
     result = null;
     return false;
 }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:7,代码来源:CefWebJSDialogHandler.cs


示例4: OnAddressChange

 protected override void OnAddressChange(CefBrowser browser, CefFrame frame, string url)
 {
     if (frame.IsMain)
     {
        _core.InvokeIfRequired(() => _core.OnAddressChanged(new AddressChangedEventArgs(frame, url)));
     }
 }
开发者ID:rajsite,项目名称:lvcef,代码行数:7,代码来源:CefWebDisplayHandler.cs


示例5: OnNavStateChange

 protected override void OnNavStateChange(CefBrowser browser, bool canGoBack, bool canGoForward)
 {
     #if DIAGNOSTICS
     Cef.Logger.Trace(LogTarget.CefDisplayHandler, "OnNavStateChange: CanGoBack=[{0}] CanGoForward=[{1}]", canGoBack, canGoForward);
     #endif
     this.context.OnNavStateChanged(canGoBack, canGoForward);
 }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:7,代码来源:CefWebDisplayHandler.cs


示例6: ConsoleMessageEventArgs

 public ConsoleMessageEventArgs(CefBrowser browser, string message, string source, int line)
 {
     this.CefBrowser = browser;
     this.Message = message;
     this.Source = source;
     this.Line = line;
 }
开发者ID:timfish,项目名称:MVVM.CEF.Glue,代码行数:7,代码来源:ConsoleMessageEventArgs.cs


示例7: OnConsoleMessage

		protected override bool OnConsoleMessage(CefBrowser browser, string message, string source, int line)
		{
			var e = new ConsoleMessageEventArgs(message, source, line);
			_core.InvokeIfRequired(() => _core.OnConsoleMessage(e));

			return e.Handled;
		}
开发者ID:rajsite,项目名称:lvcef,代码行数:7,代码来源:CefWebDisplayHandler.cs


示例8: OnAfterCreated

        protected override void OnAfterCreated(CefBrowser browser)
        {
            #if DIAGNOSTICS
            Cef.Logger.Trace(LogTarget.CefLifeSpanHandler, "OnAfterCreated");
            #endif

            this.context.OnAfterCreated(browser);

            // TODO: check context state, it can be already closed
            this.context.Attach(browser);

            /*
            if (!browser.IsPopup)
            {
                if (this.context.IsDisposed)
                {
                    browser.Close();
                    return;
                }

                this.context.browser = browser;
                this.context.browserWindowHandle = browser.WindowHandle;

                this.context.SetStyle(ControlStyles.Opaque, true);

                this.context.ResizeBrowserWindow();

                // FIXME: this is invalid - can't be accessed from another thread
                //if (this.control.Focused)
                //{
                //    this.control.browser.SetFocus(true);
                //}
            }
            */
        }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:35,代码来源:CefWebLifeSpanHandler.cs


示例9: OnContextReleased

 protected unsafe override void OnContextReleased(CefBrowser browser, CefFrame frame, CefV8Context context)
 {
     if (_context.MainFrame != null)
     {
         _context.MainFrame.UnbindV8Context();
     }
 }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:7,代码来源:CefWebV8ContextHandler.cs


示例10: OnBeforeBrowse

        protected override bool OnBeforeBrowse(CefBrowser browser, CefFrame frame, CefRequest request, CefHandlerNavType navType, bool isRedirect)
        {
            #if DIAGNOSTICS
            Cef.Logger.Trace(LogTarget.CefRequestHandler, "OnBeforeBrowse: Method=[{0}] Url=[{1}] NavType=[{2}] IsRedirect=[{3}]", request.GetMethod(), request.GetURL(), navType, isRedirect);
            #endif

            var cancel = this.context.OnNavigating(frame, request, navType, isRedirect);
            if (cancel) return true;

            if (frame.IsMain)
            {
                // browser navigating to a new page
                this.context.ClearFrames();
                this.context.AttachMainFrame(frame);

                this.context.ClearReadyState();
                this.context.SetFrameReadyState(null, FrameReadyState.Navigating);
            }
            else if ((this.context.ReadyOptions & CefReadyOptions.Frames) != 0)
            {
                this.context.SetFrameReadyState(frame.GetName(), FrameReadyState.Navigating);
            }

            return false;
        }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:25,代码来源:CefWebRequestHandler.cs


示例11: OnTitleChange

        protected override void OnTitleChange(CefBrowser browser, string title)
        {
            #if DIAGNOSTICS
            Cef.Logger.Trace(LogTarget.CefDisplayHandler, "OnTitleChange: Title=[{0}]", title);
            #endif

            this.context.OnTitleChanged(title);
        }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:8,代码来源:CefWebDisplayHandler.cs


示例12: OnCursorChange

 protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle)
 {
     _uiHelper.PerformInUiThread(() =>
         {
             Cursor cursor = CursorInteropHelper.Create(new SafeFileHandle(cursorHandle, false));
             _owner.Cursor = cursor;
         });
 }
开发者ID:vebin,项目名称:Xilium.CefGlue,代码行数:8,代码来源:WpfCefRenderHandler.cs


示例13: CefUncaughtExceptionEventArgs

 public CefUncaughtExceptionEventArgs(CefBrowser browser, CefFrame frame, CefV8Context context, CefV8Exception exception, CefV8StackTrace stackTrace)
 {
     this.browser = browser;
     this.frame = frame;
     this.context = context;
     this.exception = exception;
     this.stackTrace = stackTrace;
 }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:8,代码来源:CefUncaughtExceptionEventArgs.cs


示例14: DoClose

        protected override bool DoClose(CefBrowser browser)
        {
            #if DIAGNOSTICS
            Cef.Logger.Trace(LogTarget.CefLifeSpanHandler, "DoClose");
            #endif

            return false;
        }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:8,代码来源:CefWebLifeSpanHandler.cs


示例15: CefBeforePopupEventArgs

 public CefBeforePopupEventArgs(CefBrowser parentBrowser, CefPopupFeatures popupFeatures, CefWindowInfo windowInfo, string url, ref CefClient client, CefBrowserSettings settings)
 {
     this.parentBrowser = parentBrowser;
     this.popupFeatures = popupFeatures;
     this.windowInfo = windowInfo;
     this.url = url;
     this.client = client;
     this.settings = settings;
 }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:9,代码来源:CefBeforePopupEventArgs.cs


示例16: OnKeyEvent

        protected override bool OnKeyEvent(CefBrowser browser, CefHandlerKeyEventType type, int code, CefHandlerKeyEventModifiers modifiers, bool isSystemKey, bool isAfterJavaScript)
        {
            #if DIAGNOSTICS
            Cef.Logger.Trace(LogTarget.CefKeyboardHandler, "OnKeyEvent: type=[{0}] code=[{1}] modifiers=[{2}] isSystemKey=[{3}] isAfterJavaScript=[{4}]", type, code, modifiers, isSystemKey, isAfterJavaScript);
            #endif

            // TODO: CefWebKeyboardHandler.OnKeyEvent: return this.context.PostKeyEvent(type, code, modifiers, isSystemKey);
            return false;
        }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:9,代码来源:CefWebKeyboardHandler.cs


示例17: OnAddressChange

 protected override void OnAddressChange(CefBrowser browser, CefFrame frame, string url)
 {
     #if DIAGNOSTICS
     Cef.Logger.Trace(LogTarget.CefDisplayHandler, "OnAddressChange: URL=[{0}] Frame.IsMain=[{1}]", url, frame.IsMain);
     #endif
     if (frame.IsMain)
     {
         this.context.OnAddressChanged(url);
     }
 }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:10,代码来源:CefWebDisplayHandler.cs


示例18: OnConsoleMessage

        protected override bool OnConsoleMessage(CefBrowser browser, string message, string source, int line)
        {
            #if DIAGNOSTICS
            Cef.Logger.Trace(LogTarget.CefDisplayHandler, "OnConsoleMessage: Message=[{0}] Source=[{1}] Line=[{2}]", message, source, line);
            #endif
            // FIXME: check context state? if (this.context.IsDisposed) return false;

            this.context.OnConsoleMessage(new ConsoleMessageEventArgs(message, source, line));

            return true;
        }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:11,代码来源:CefWebDisplayHandler.cs


示例19: OnBeforeResourceLoad

        // TODO: use OnBeforeResourceLoad to OnResourceResponse to detect resource loading, and waiting when all resources will be loaded
        protected override bool OnBeforeResourceLoad(CefBrowser browser, CefRequest request, out string redirectUrl, out CefStreamReader resourceStream, CefResponse response, int loadFlags)
        {
            var prevColor = Console.ForegroundColor;
            Console.ForegroundColor = ConsoleColor.DarkMagenta;
            Console.WriteLine("OnBeforeResourceLoad: {0}", request.GetURL());
            Console.ForegroundColor = prevColor;

            redirectUrl = null;
            resourceStream = null;
            return false;
        }
开发者ID:yasoonOfficial,项目名称:cefglue,代码行数:12,代码来源:CefWebRequestHandler.cs


示例20: OnCreated

        internal void OnCreated(CefBrowser browser)
        {
            //if (_created) throw new InvalidOperationException("Browser already created.");
            _created = true;
            _browser = browser;

            var handler = Created;
            if (handler != null)
            {
                handler(this, EventArgs.Empty);
            }
        }
开发者ID:rajsite,项目名称:lvcef,代码行数:12,代码来源:WebBrowser.cs



注:本文中的CefBrowser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CelestialBody类代码示例发布时间:2022-05-24
下一篇:
C# CedEntidades类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap