當前位置: 首頁>>代碼示例>>C#>>正文


C# CefGlue.CefBrowser類代碼示例

本文整理匯總了C#中Xilium.CefGlue.CefBrowser的典型用法代碼示例。如果您正苦於以下問題:C# CefBrowser類的具體用法?C# CefBrowser怎麽用?C# CefBrowser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CefBrowser類屬於Xilium.CefGlue命名空間,在下文中一共展示了CefBrowser類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnLoadEnd

 protected override void OnLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode)
 {
     if (OnLoadEndEvent != null)
     {
         OnLoadEndEvent(browser, frame, httpStatusCode);
     }
 }
開發者ID:Zaharkov,項目名稱:CLRBrowserSourcePlugin,代碼行數:7,代碼來源:BrowserLoadHandler.cs

示例2: OnAddressChange

 protected override void OnAddressChange( CefBrowser browser, CefFrame frame, string url )
 {
     if( frame.IsMain )
     {
         owner.OnAddressChanged( url );
     }
 }
開發者ID:whztt07,項目名稱:SDK,代碼行數:7,代碼來源:WebDisplayHandler.cs

示例3: ConsoleMessageEventArgs

 public ConsoleMessageEventArgs(CefBrowser browser, string message, string source, int line)
 {
     this.CefBrowser = browser;
     this.Message = message;
     this.Source = source;
     this.Line = line;
 }
開發者ID:David-Desmaisons,項目名稱:MVVM.CEF.Glue,代碼行數:7,代碼來源:ConsoleMessageEventArgs.cs

示例4: OnProcessMessageReceived

        protected override bool OnProcessMessageReceived(CefBrowser browser, CefProcessId sourceProcess, CefProcessMessage message)
        {
            if (!this.loggingService.IsDebugEnabled)
            {
                return false;
            }

            this.loggingService.Debug("Client::OnProcessMessageReceived: SourceProcess={0}", sourceProcess);
            this.loggingService.Debug("Message Name={0} IsValid={1} IsReadOnly={2}", message.Name, message.IsValid, message.IsReadOnly);
            var arguments = message.Arguments;
            for (var i = 0; i < arguments.Count; i++)
            {
                var type = arguments.GetValueType(i);
                object value;
                switch (type)
                {
                    case CefValueType.Null: value = null; break;
                    case CefValueType.String: value = arguments.GetString(i); break;
                    case CefValueType.Int: value = arguments.GetInt(i); break;
                    case CefValueType.Double: value = arguments.GetDouble(i); break;
                    case CefValueType.Bool: value = arguments.GetBool(i); break;
                    default: value = null; break;
                }

                this.loggingService.Debug("  [{0}] ({1}) = {2}", i, type, value);
            }

            return false;
        }
開發者ID:axle-h,項目名稱:Axh.PageTracker,代碼行數:29,代碼來源:ScreenshotCefClient.cs

示例5: OnBeforeClose

		protected override void OnBeforeClose(CefBrowser browser)
		{
			if (_core.InvokeRequireOnUi())
                _core.MainUiDispatcher.BeginInvoke((Action)_core.OnBeforeClose);
			else
				_core.OnBeforeClose();
		}
開發者ID:sjoerd222888,項目名稱:playground,代碼行數:7,代碼來源:MyLifeSpanHandler.cs

示例6: DoClose

 protected override bool DoClose(CefBrowser browser)
 {
     Debug.WriteLine(DBGPREFIX + "DoClose");
     // Returning false will send a top level browser close event? guess that is why the labview window closed?
     // Sure does, need to return true and figure out more about the workflow
     return true;
 }
開發者ID:rajsite,項目名稱:lvcef,代碼行數:7,代碼來源:LVCefLifeSpanHandler.cs

示例7: OnProcessMessageReceived

        protected override bool OnProcessMessageReceived(CefBrowser browser, CefProcessId sourceProcess, CefProcessMessage message)
        {
            Console.WriteLine("Render::OnProcessMessageReceived: SourceProcess={0}", sourceProcess);
            Console.WriteLine("Message Name={0} IsValid={1} IsReadOnly={2}", message.Name, message.IsValid, message.IsReadOnly);
            var arguments = message.Arguments;
            for (var i = 0; i < arguments.Count; i++)
            {
                var type = arguments.GetValueType(i);
                object value;
                switch (type)
                {
                    case CefValueType.Null: value = null; break;
                    case CefValueType.String: value = arguments.GetString(i); break;
                    case CefValueType.Int: value = arguments.GetInt(i); break;
                    case CefValueType.Double: value = arguments.GetDouble(i); break;
                    case CefValueType.Bool: value = arguments.GetBool(i); break;
                    default: value = null; break;
                }

                Console.WriteLine("  [{0}] ({1}) = {2}", i, type, value);
            }

            if (message.Name == "myMessage2") return true;

            var message2 = CefProcessMessage.Create("myMessage2");
            var success = browser.SendProcessMessage(CefProcessId.Renderer, message2);
            Console.WriteLine("Sending myMessage2 to renderer process = {0}", success);

            var message3 = CefProcessMessage.Create("myMessage3");
            var success2 = browser.SendProcessMessage(CefProcessId.Browser, message3);
            Console.WriteLine("Sending myMessage3 to browser process = {0}", success);

            return false;
        }
開發者ID:sim0629,項目名稱:CefGlue,代碼行數:34,代碼來源:DemoRenderProcessHandler.cs

示例8: InitTask

        private Task<IWebBrowserWindowProvider> InitTask(string fullpath, IWebSessionLogger logger)
        {
            TaskCompletionSource<IWebBrowserWindowProvider> tcs = new TaskCompletionSource<IWebBrowserWindowProvider>();
            Task.Run(async () =>
            {
                var cefWindowInfo = CefWindowInfo.Create();
                cefWindowInfo.SetAsWindowless(IntPtr.Zero, true);

                //// Settings for the browser window itself (e.g. enable JavaScript?).
                var cefBrowserSettings = new CefBrowserSettings();

                // Initialize some the cust interactions with the browser process.
                var cefClient = new TestCefClient();

                // Start up the browser instance.
                CefBrowserHost.CreateBrowser(cefWindowInfo, cefClient, cefBrowserSettings, fullpath);

                _CefBrowser = await cefClient.GetLoadedBrowserAsync();

                _CefFrame = _CefBrowser.GetMainFrame();
                _TestCefGlueHTMLWindowProvider = new TestCefGlueHTMLWindowProvider(_CefFrame, cefClient);
                tcs.SetResult(_TestCefGlueHTMLWindowProvider);
            });

            return tcs.Task;
        }
開發者ID:David-Desmaisons,項目名稱:MVVM.CEF.Glue,代碼行數:26,代碼來源:CefGlueWindowlessSharedHtmlEngine.cs

示例9: OnProcessMessageReceived

        protected override bool OnProcessMessageReceived(CefBrowser browser, CefProcessId sourceProcess, CefProcessMessage message)
        {
            if (DumpProcessMessages)
            {
                Console.WriteLine("Client::OnProcessMessageReceived: SourceProcess={0}", sourceProcess);
                Console.WriteLine("Message Name={0} IsValid={1} IsReadOnly={2}", message.Name, message.IsValid, message.IsReadOnly);
                var arguments = message.Arguments;
                for (var i = 0; i < arguments.Count; i++)
                {
                    var type = arguments.GetValueType(i);
                    object value;
                    switch (type)
                    {
                        case CefValueType.Null: value = null; break;
                        case CefValueType.String: value = arguments.GetString(i); break;
                        case CefValueType.Int: value = arguments.GetInt(i); break;
                        case CefValueType.Double: value = arguments.GetDouble(i); break;
                        case CefValueType.Bool: value = arguments.GetBool(i); break;
                        default: value = null; break;
                    }

                    Console.WriteLine("  [{0}] ({1}) = {2}", i, type, value);
                }
            }

            var handled = DemoApp.BrowserMessageRouter.OnProcessMessageReceived(browser, sourceProcess, message);
            if (handled) return true;

            if (message.Name == "myMessage2" || message.Name == "myMessage3") return true;

            return false;
        }
開發者ID:rajsite,項目名稱:lvcef,代碼行數:32,代碼來源:WebClient.cs

示例10: OnLoadStart

        protected override void OnLoadStart(CefBrowser browser, CefFrame frame)
        {
            base.OnLoadStart(browser, frame);

            var message = CefProcessMessage.Create("SetOverlayAPI");
            message.Arguments.SetString(0, frame.Name);
            browser.SendProcessMessage(CefProcessId.Renderer, message);
        }
開發者ID:alalwww,項目名稱:OverlayPlugin,代碼行數:8,代碼來源:LoadHandler.cs

示例11: OnGetResourceHandlerEventArgs

 public OnGetResourceHandlerEventArgs(string _id, CefBrowser _browser, CefFrame _frame, CefRequest _request)
 {
     id = _id;
     browser = _browser;
     frame = _frame;
     request = _request;
     DelegateRequest = false; //Default do not delegate, allow CEF to handle using network
 }
開發者ID:rajsite,項目名稱:lvcef,代碼行數:8,代碼來源:LVCefRequestHandler.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:whztt07,項目名稱:SDK,代碼行數:8,代碼來源:WebRenderHandler.cs

示例13: GetRootScreenRect

        protected override bool GetRootScreenRect(CefBrowser browser, ref CefRectangle rect)
        {
            rect.X = 0;
            rect.Y = 0;
            rect.Width = this.screenWidth;
            rect.Height = this.screenHeight;

            return true;
        }
開發者ID:axle-h,項目名稱:Axh.PageTracker,代碼行數:9,代碼來源:ScreenshotRenderHandler.cs

示例14: GetScreenInfo

        protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
        {
            var rect = screenInfo.Rectangle;
            this.GetRootScreenRect(browser, ref rect);
            screenInfo.Depth = 32;
            screenInfo.IsMonochrome = false;

            return true;
        }
開發者ID:axle-h,項目名稱:Axh.PageTracker,代碼行數:9,代碼來源:ScreenshotRenderHandler.cs

示例15: OnStatusMessage

 protected override void OnStatusMessage(CefBrowser browser, string value)
 {
     if (browser == null)
     {
         API.Instance.Log("Browser null: invalid OnStatusMessage.");
         return;
     }
     API.Instance.Log("Browser {0}: Status message: {1}", browser.Identifier, value);
 }
開發者ID:Zaharkov,項目名稱:CLRBrowserSourcePlugin,代碼行數:9,代碼來源:BrowserDisplayHandler.cs


注:本文中的Xilium.CefGlue.CefBrowser類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。