Cef.InitializeAsync Method |
Version 111.2.70
Initializes CefSharp with user-provided settings. This method allows you to wait for
OnContextInitialized() to be called before continuing.
It's important to note that Initialize and Shutdown
MUST be called on your main
application thread (typically the UI thread). If you call them on different
threads, your application will hang. See the documentation for Cef.Shutdown() for more details.
Namespace:
CefSharp
Assembly:
CefSharp.Core (in CefSharp.Core.dll) Version: 111.2.70.0
Syntaxpublic static Task<bool> InitializeAsync(
CefSettingsBase settings,
bool performDependencyCheck = true,
IBrowserProcessHandler browserProcessHandler = null
)
public:
static Task<bool>^ InitializeAsync(
CefSettingsBase^ settings,
bool performDependencyCheck = true,
IBrowserProcessHandler^ browserProcessHandler = nullptr
)
Parameters
- settings
- Type: CefSharp.CefSettingsBase
CefSharp configuration settings. - performDependencyCheck (Optional)
- Type: System.Boolean
Check that all relevant dependencies available, throws exception if any are missing - browserProcessHandler (Optional)
- Type: CefSharp.IBrowserProcessHandler
The handler for functionality specific to the browser process. Null if you don't wish to handle these events
Return Value
Type:
Task<Boolean>returns a Task that can be awaited. true if successful; otherwise, false. If false check the log file for possible errors
Remarks
If successful then the Task will be completed successfully when
OnContextInitialized() is called.
If successful then the continuation will happen syncrionously on the CEF UI thread.
See Also